[Glade-users] Program debugging in GPS 2013



I just found the problem. By downloading XML Notepad I could just put GPS 
2013 and XML Notepad beside each other and I found the problem. I don't 
think I would have found it by just searching in Glade and/or GPS 2013 
together. It would be a good idea to create in glade a list of all the 
signals in a project and creating an error message within Do_Connect which 
signal is the problem.

L. Dries

-----Oorspronkelijk bericht----- 
From: Bertus Dries
Sent: Wednesday, April 30, 2014 5:23 PM
To: Juan Pablo Ugarte
Cc: gtk-devel-list at gnome.org ; glade-users at lists.ximian.com ; 
glade-devel at lists.ximian.com
Subject: Re: [Glade-users] Program debugging in GPS 2013

JP,

I am using Windows 7 and am programming in Ada. and I am using Glade 3.14.2.

In the Debugger console of GPS 2013 the following Is presented
(gdb) run
Starting program: E:\ada\project\ConvertCtoAda\ConvertCtoAda.exe
[New Thread 7924.0x1600]
[New Thread 7924.0x1460]
[New Thread 7924.0xbd4]
[New Thread 7924.0x1574]
[Inferior 1 (process 7924) exited with code 01]

The code up to the position where the "error" occurred is

   procedure Init is
      Object               : GObject;
   begin
      -------------------------------------------------------------------------
      -- Step 1: create a Builder and add the XML data,
      -------------------------------------------------------------------------
      Gtk_New (Builder);
      nr_Error := Add_From_File (Builder, "ConvertCtoAda.glade",
Error'Access);
      if Error /= null then
         answer := Message_Dialog( Msg     => "Error : " & Get_Message
(Error),
                                   Buttons => Button_OK,
                                   Title   => "Error");
         Error_Free (Error);
         return;
      end if;
      -------------------------------------------------------------------------
      -- Step 2: add calls to "Register_Handler" to associate your
      --         handlers with your callbacks.
      -------------------------------------------------------------------------
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "main_quit", -- from XML file <signal handler=..>
         Handler      => On_Window_Destroy'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_New", -- from XML file <signal handler=..>
         Handler      => On_File_New'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Open", -- from XML file <signal handler=..>
         Handler      => On_File_Open'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Save", -- from XML file <signal handler=..>
         Handler      => On_File_Save'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Save_As", -- from XML file <signal handler=..>
         Handler      => On_File_Save_As'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Print", -- from XML file <signal handler=..>
         Handler      => On_File_Print'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Quit", -- from XML file <signal handler=..>
         Handler      => On_File_Quit'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Cut", -- from XML file <signal handler=..>
         Handler      => On_Edit_Cut'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "Copy_Activate", -- from XML file <signal
handler=..>
         Handler      => On_Edit_Copy'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Paste", -- from XML file <signal handler=..>
         Handler      => On_Edit_Paste'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Delete", -- from XML file <signal handler=..>
         Handler      => On_Edit_Delete'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Show_Inter_Buffer", -- from XML file <signal
handler=..>
         Handler      => On_Show_Inter_Buffer'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_About_Activate", -- from XML file <signal
handler=..>
         Handler      => On_Help_About'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Inter_Buffer_OK", -- from XML file <signal
handler=..>
         Handler      => On_Interbuffer_OK'Access);
      Register_Handler
        (Builder      => Builder,
         Handler_Name => "On_Inter_Buffer_Print", -- from XML file <signal
handler=..>
         Handler      => On_Interbuffer_Print'Access);
      -------------------------------------------------------------------------
      -- Step 3: call Do_Connect. Once to connect all registered handlers
      -------------------------------------------------------------------------
      Do_Connect (Builder); -- The program does not return from this
function.

I checked as good as I could the case sensitive handler names and have all
names copied from the glade program.
Sorry, but I did not mention the programming language because I think it has
little to do with the problem. What I would like is a debugging tool that
could specify where the problem is.


-----Oorspronkelijk bericht----- 
From: Juan Pablo Ugarte
Sent: Wednesday, April 30, 2014 5:03 PM
To: Bertus Dries
Cc: glade-users at lists.ximian.com ; gtk-devel-list at gnome.org ;
glade-devel at lists.ximian.com
Subject: Re: [Glade-users] Program debugging in GPS 2013

On Wed, 2014-04-30 at 09:17 +0200, Bertus Dries wrote:
I have some troubles in debugging a program in which I do use a glade file
for creating the GUI. The problem is the fact that I cannot find the 
reason
why the Do_Connect function fails. The normal reason I found was that the
names of the handlers in the glade file and in the program file are not
completely the same. I now have the problem that I introduced a new dialog
within an existing glade file with two buttons that have a "clicked"
activation. Afterwards I did not pass the Do_Connect routine but when I 
made
sure the handler names were the same by a copy/paste operation it still 
did
not work. My problem is that I cannot find a way to get the the program to
tell me what creates the trouble. At this moment I have stripped all 
events
from the glade file and commented all register handlers out but the 
programs
still stops at the do_connect routine. Icannot enter the routine with the
GPS debugger, so what is the best way to handle the problem. Starting all
over again in a program of several thousands of program lines is certainly
not the best way.

Hi you need to be a little more specific about your environment,
which language are you using?
Its better to refer to the language binding documentation to know
exactly how your functions/method map in builder handler names

BTW, is there any output in the console when you run your program?

cheers

JP

_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]