* Breakpoints in the library code
@ 2004-06-30 10:44 Roland Zerek
2004-06-30 13:28 ` Kris Warkentin
0 siblings, 1 reply; 6+ messages in thread
From: Roland Zerek @ 2004-06-30 10:44 UTC (permalink / raw)
To: gdb
Hi,
I'm developing wxWidgets based applications on MinGW (gcc-3.4.0). And I
would like to set a breakpoint inside some method that is implemented in
the library (DLL). How do I do this?
I am trying to use command line gdb currently since I see that a frontend
(MinGW Developer Studio) does not handle everything correctly what makes
debugging difficult or impossible.
TIA
--
Roland
r o l a n d z (at) poczta fm
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Breakpoints in the library code
2004-06-30 10:44 Breakpoints in the library code Roland Zerek
@ 2004-06-30 13:28 ` Kris Warkentin
[not found] ` <40E2B3B6.6070802@poczta.fm>
0 siblings, 1 reply; 6+ messages in thread
From: Kris Warkentin @ 2004-06-30 13:28 UTC (permalink / raw)
To: Roland Zerek; +Cc: gdb
Once the dll is loaded (ie. you've run to main() or dlopen()ed), you can
just set a breakpoint as you normally would. If gdb can find the shared
library, it will read the symbols when it detects that it has been
loaded. (if auto-solib-add is set) Newer versions of gdb also have the
concept of a deferred breakpoint where gdb will ask if you want to make
a breakpoint pending on a future library load.
cheers,
Kris
Roland Zerek wrote:
> Hi,
>
> I'm developing wxWidgets based applications on MinGW (gcc-3.4.0). And I
> would like to set a breakpoint inside some method that is implemented in
> the library (DLL). How do I do this?
>
> I am trying to use command line gdb currently since I see that a
> frontend (MinGW Developer Studio) does not handle everything correctly
> what makes debugging difficult or impossible.
>
> TIA
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Breakpoints in the library code
[not found] ` <40E2B3B6.6070802@poczta.fm>
@ 2004-06-30 14:54 ` Kris Warkentin
[not found] ` <40E2C6CE.4070703@poczta.fm>
0 siblings, 1 reply; 6+ messages in thread
From: Kris Warkentin @ 2004-06-30 14:54 UTC (permalink / raw)
To: Roland Zerek; +Cc: gdb
It's possible that the symbols are not loaded. After stopping within
the program, type 'info shared' to see if the symbol table is loaded for
the dll. If not, you can type 'shared' to load them.
cheers,
Kris
Roland Zerek wrote:
> UÂżytkownik Kris Warkentin napisaÂł:
>
>> Once the dll is loaded (ie. you've run to main() or dlopen()ed), you
>> can just set a breakpoint as you normally would. If gdb can find the
>> shared library, it will read the symbols when it detects that it has
>> been loaded. (if auto-solib-add is set) Newer versions of gdb also
>> have the concept of a deferred breakpoint where gdb will ask if you
>> want to make a breakpoint pending on a future library load.
>
>
> So if there is a class wxXmlResource in the wxWidgets library and that
> class has a LoadObject method then I try to write:
>
> break wxXmlResource::LoadObject()
>
> However gdb answers to me:
>
> Function wxXmlResource::LoadObject() not defined. Does gdb treat
> wxXmlResource class name as file name or what? However I have a class
> myApp with method OnInit() and following command works:
>
> break myApp::OnInit()
>
> I want to add that these commands fail when my application is already
> running ( or rather is just after it stopped on a breakpoint ) so DLL's
> are already loaded... Libs are built with all gdb debugs :-(
>
>>> I'm developing wxWidgets based applications on MinGW (gcc-3.4.0). And
>>> I would like to set a breakpoint inside some method that is
>>> implemented in the library (DLL). How do I do this?
>>>
>>> I am trying to use command line gdb currently since I see that a
>>> frontend (MinGW Developer Studio) does not handle everything
>>> correctly what makes debugging difficult or impossible.
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Breakpoints in the library code
[not found] ` <40E2C6CE.4070703@poczta.fm>
@ 2004-06-30 16:04 ` Kris Warkentin
[not found] ` <40E2E20A.7070000@poczta.fm>
0 siblings, 1 reply; 6+ messages in thread
From: Kris Warkentin @ 2004-06-30 16:04 UTC (permalink / raw)
To: Roland Zerek; +Cc: gdb
Roland Zerek wrote:
> UÂżytkownik Kris Warkentin napisaÂł:
>
>> It's possible that the symbols are not loaded. After stopping within
>> the program, type 'info shared' to see if the symbol table is loaded
>> for the dll. If not, you can type 'shared' to load them.
>
>
> Well, libraries are loaded at the beginning - info shared says that. Any
> other ideas, please???
Hmm. Well, if it's not recognizing the name of the method, you might
want to try setting the breakpoint by filename:line number. (ie
foo.cc:73). If that works, then when you hit the breakpoint, you can do
a backtrace and see what gdb thinks the name of the method is.
cheers,
Kris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Breakpoints in the library code
[not found] ` <40E2E20A.7070000@poczta.fm>
@ 2004-06-30 17:56 ` Kris Warkentin
2004-06-30 18:53 ` Roland Zerek
0 siblings, 1 reply; 6+ messages in thread
From: Kris Warkentin @ 2004-06-30 17:56 UTC (permalink / raw)
To: Roland Zerek; +Cc: gdb
You should hit 'reply all' when you reply to me - that way you response
goes to the mailing list as well. You might get help from someone else
as well. Question: did you try break wxXmlResource<tab> to see which
members gdb thinks are available for breakpoints?
cheers,
Kris
Roland Zerek wrote:
> UÂżytkownik Kris Warkentin napisaÂł:
>
>> Hmm. Well, if it's not recognizing the name of the method, you might
>> want to try setting the breakpoint by filename:line number. (ie
>> foo.cc:73). If that works, then when you hit the breakpoint, you can
>> do a backtrace and see what gdb thinks the name of the method is.
>
>
> It works quite well, thanks. However backtrace gives me the same method
> name as expected...
>
> Another question is: why command line debugger works perfectly and GUI
> frontends not... Are there some incompatibilities in gdb api or the way
> the insight or ddd comunicates with gdb is incorrect? Sorry for possibly
> trivial question but I am not gdb expert.
>
> Thanks for advises :-)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Breakpoints in the library code
2004-06-30 17:56 ` Kris Warkentin
@ 2004-06-30 18:53 ` Roland Zerek
0 siblings, 0 replies; 6+ messages in thread
From: Roland Zerek @ 2004-06-30 18:53 UTC (permalink / raw)
To: Kris Warkentin; +Cc: gdb
Użytkownik Kris Warkentin napisał:
> You should hit 'reply all' when you reply to me - that way you response
> goes to the mailing list as well. You might get help from someone else
Oops.... Sorry - did not notify to whom I am writting... I always just
simply reply to sender when sending to mailing lists since the sender is
usually the mailserver...
> as well. Question: did you try break wxXmlResource<tab> to see which
> members gdb thinks are available for breakpoints?
You mean that gdb is capable to autocomplete the name? I did not know it.
Will try.
>>> Hmm. Well, if it's not recognizing the name of the method, you might
>>> want to try setting the breakpoint by filename:line number. (ie
>>> foo.cc:73). If that works, then when you hit the breakpoint, you can
>>> do a backtrace and see what gdb thinks the name of the method is.
>> It works quite well, thanks. However backtrace gives me the same
>> method name as expected...
>>
>> Another question is: why command line debugger works perfectly and GUI
>> frontends not... Are there some incompatibilities in gdb api or the
>> way the insight or ddd comunicates with gdb is incorrect? Sorry for
>> possibly trivial question but I am not gdb expert.
--
Roland
r o l a n d z (at) poczta fm
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-06-30 17:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-30 10:44 Breakpoints in the library code Roland Zerek
2004-06-30 13:28 ` Kris Warkentin
[not found] ` <40E2B3B6.6070802@poczta.fm>
2004-06-30 14:54 ` Kris Warkentin
[not found] ` <40E2C6CE.4070703@poczta.fm>
2004-06-30 16:04 ` Kris Warkentin
[not found] ` <40E2E20A.7070000@poczta.fm>
2004-06-30 17:56 ` Kris Warkentin
2004-06-30 18:53 ` Roland Zerek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox