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)'

链接地址: http://www.djcxy.com/p/8758.html

上一篇: 如何从android联系人列表中获取skype信息

下一篇: 为类成员函数设置断点不成功