开发者

Set breakpoint for class member function not successful

开发者_如何学运维

I have a class looks like this:

namespace madoka
{
class polarizable_sites
{
public:
void resize(const size_t dim_);
void clear(void);
};
}

in gdb, I could set breakpoint on clear by

b 'madoka::polarizable_sites::clear()'

however, for member function resize, a

b 'madoka::polarizable_sites::resize(const size_t)'

does not work. GDB reported error:

the class madoka::polarizable_sites does not have any method named resize(const size_t) Hint: try 'madoka::polarizable_sites::resize(const size_t)' or 'madoka::polarizable_sites::resize(const size_t)' (Note leading single quote.)

I am wondering why since the function style is auto-completed by TAB.

BTW: I'm using GDB

GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2 Copyright (C) 2010 Free Software Foundation, Inc.

with compiler'

g++ (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 Copyright (C) 2010 Free Software Foundation, Inc.


Probably the function is inlined. Try adding __asm int 3 if it's x86 code in GDB syntax and walk the code. This trick has saved me a lot of time when debugging MSVC x86 code.


I'm guessing the compiler has stripped the const specifier,

Try b 'madoka::polarizable_sites::resize(size_t)'

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜