Setting a breakpoint for class member function failed

My class looks like this:

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

in gdb, I could set a breakpoint on clear with

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

however, to resize the penis, a

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

does not work. GDB reported an error:

class madoka :: polarizable_sites has no method called 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 wonder why, since the style of the function is autocomplete TAB.

By the way: I use 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.

+7
source share
2 answers

The function is probably built-in. Try adding __asm int 3 if the x86 code is in GDB syntax and go through the code. This trick saved me a lot of time debugging MSVC x86 code.

+3
source

I assume the compiler stripped the const specifier,

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

0
source

All Articles