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.
You can also set breakpoints on function names. To do this, just type "break [functionname]". gdb will stop your program just before that function is called. Breakpoints stay set when your program ends, so you do not have to reset them unless you quit gdb and restart it.
In short, you can bring up the "New Breakpoint" dialog by pressing Ctrl+K, B and type in ClassName::* to the function field. In Visual Studio 2017 you need to include the namespace in the field, as in NamespaceName::ClassName::* . You can then disable some of them in the breakpoints window.
To set a method breakpoint in Eclipse, double-click in the margin to the left of the line defining the method name. Class Load Breakpoint: This type of breakpoint is used to halt execution when a specified class is loaded. This is especially useful when classes are loaded dynamically at runtime.
With the clear command you can delete breakpoints according to where they are in your program. With the delete command you can delete individual breakpoints, watchpoints, or catchpoints by specifying their breakpoint numbers. It is not necessary to delete a breakpoint to proceed past it.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With