Re: [Anjuta-list] Basic problems with Anjuta



Hi Steve,

Steve a écrit :
The User's Manual, para 5.1.1 says "Choose the menu item Debug->Run Target..." but there is no Debug menu
item. After some investigation, I found that if I go to Edit->Preferences select the Installed plugins tab
and select the Debugger Manager plugin, then Debug becomes an option in the menu. Shouldn't the User Manual
mention this?

Almost all functions in Anjuta are handled by plugin so it's common to do this. Anyway, I think I have already read such request, so I will update the documentation.

I was also having a problem that when I closed Anjuta and then re-opened it, the Debug option disappeared
and I would have to repeat the process. I have now found that this does not always happen but I cannot
> find any pattern or specific reason for what causes this.

All loaded plugins are load in a project session file when you exit Anjuta. But it means that you have to enable the debugger plugin for each project. If it doesn't work like this please put a bug report in bugzilla here:
http://bugzilla.gnome.org/enter_bug.cgi?product=anjuta

So I select Debug->Run Target, select "Run in terminal" and "stop at the beginning". main.c opens
(after selecting an editor) highlighs the get_set_locale() line with a yellow arrow next to a bolded
line number (52) in the margin. I hit F5 to step into the function but we step over the function to the
gtk_init line. The highlighting, arrow and bolding step down one line. Presumably, we do not step into
gtk_set_locale() because Anjuta doesn't know where to find the source file? No advisory messages?

I think it is a common behavior. F5 steps into a function only if gdb get debugging information about it, which is normally not the case for common libraries functions. It's not only the source file which is missing, but the information about the link between a particular place in the code and the source files. If you really want it is possible to get debugging information by recompiling the corresponding library with debugging informations.

There is no message about this. I think that most of the time you don't want to dig into such function. I don't remember if other debugger gives such message. I don't think it is possible to do it with gdb.

Now we get to the main problem. I hit F5 again and the app window appears, the yellow arrow and highlighting
dissappear and the bolding moves to line 50, ie up 3 lines to a blank line. I read a couple of days ago that
someone else was having problems where the debugger was not following the source code because of optimization.
I looked in the Makefiles and changed -O2 to -O0, rebuilt and tried again but I get the same problems.

Yes. Instead of changing the Makefile, it's better to change the Makefile.am file or run ./configure 'CFLAG=-g -O0' instead because autotools can recreate the Makefile from Makefile.am. That's fine for just a test though.

I've tried this exercise several times and sometimes the yellow arrow and highlighting don't appear at all.
> The one thing that does alwasy happen is that the debugger does not stop when stepping into the gtk_init line.
> It appears to run on into the gtk_main loop.

I'm not sure you can step into gtk_init function. I think a easier way to stop the debugger is to put breakpoint into your program.

Am I missing some vital step here? Do I have something mis-configured?

I don't think you missed something here. I think that you rather try to do things those are not possible now or run into bugs in the debugger plugin. If your program is small enough, perhaps you can attach to a bug report and tell me exactly what you do (press this key, click on this button...). I will try to do the same and tell you if it is a bug or not.

Regards,

Sébastien




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