开发者

gdb unable to set breakpoint

开发者 https://www.devze.com 2023-02-10 22:28 出处:网络
I am using g++ 4.1.2 and gdb 7.2 I am debugging code that uses Xerces, which I built using the same tools, though presumably without debugging.

I am using g++ 4.1.2 and gdb 7.2

I am debugging code that uses Xerces, which I built using the same tools, though presumably without debugging.

GDB steps through my code just fine, but of course does NOT step through Xerces because it probably doesn't have debugging information, and definitely does not know where the source directory is. But all I want is to set a breakpoint when Xerces (a callback parser) calls a callback object.

Their base class is DefaultHandler

I have a class ContentHandlerBase : public DefaultHandler Then leaf cl开发者_运维百科asses inherit from ContentHandlerBase. These leaf classes are inside namespace A, for example

in gdb I try to set a breakpoint.

b A::LeafContentHandler::LeafContentHandler b A::LeafContentHandler::endElement

The first breakpoint works because the code is inline (defined in the header).

The second breakpoint does not work, meaning gdb claims that no such symbol exists, even though it obviously does. It is a virtual function defined in the Xerces library, if that makes a difference. Before I recompiled Xerces, it was built with g++3.4.6 and I could not find the symbol in gdb. Now, gdb finds the symbol (I can hit tab) but then it says it doesn't exist, should I wait for a library to load.

Can anyone tell me what I have to do to make it work? I'd prefer not to build all of xerces with debugging.

Note that in some cases, with the constructor in the .cpp file, it also worked for some reason, and then, because it was in the same file, I could set a subsequent breakpoint at linenumber, and that worked.


Try gdb 7.1 - it seems there are some problems in setting breakpoint by function name in gdb 7.2

0

精彩评论

暂无评论...
验证码 换一张
取 消