Reply
Thread Tools
Posts: 111 | Thanked: 31 times | Joined on May 2007
#1
Hi there !

I do not underestand how to correctly set breakpoints with gdb for a c++ application.

The bits i am interested in are in calendar_backend.

For example, I would like to get a break poing whenever i reach CMulticalendar::importIcsFileData:

[sbox-FREMANTLE_X86: ~/dev/test-cal/test1] > run-standalone.sh gdb ./test
GNU gdb (GDB) 6.8.50.20090417
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
(gdb) set args ./sample.ical
(gdb) b CMulticalendar::importIcsFileData
the class CMulticalendar does not have any method named importIcsFileData
Hint: try 'CMulticalendar::importIcsFileData<TAB> or 'CMulticalendar::importIcsFileData<ESC-?>
(Note leading single quote.)

Any idea what i am doing wrong ?
 
Posts: 111 | Thanked: 31 times | Joined on May 2007
#2
ouch... i should have read the "note leading single quote" .
I have been puzzled by since since yesterday evening, and i just find it 10 seconds after i posted here....
 
Posts: 111 | Thanked: 31 times | Joined on May 2007
#3
Actually, i still have a problem, the leading single quote trick did not work for ICalConverter::importEventDateEnd

(gdb) b ICalConverter::importEventDateEnd
Can't find member of namespace, class, struct, or union named "ICalConverter::importEventDateEnd"
Hint: try 'ICalConverter::importEventDateEnd<TAB> or 'ICalConverter::importEventDateEnd<ESC-?>
(Note leading single quote.)
(gdb) b 'ICalConverter::importEventDateEnd

here, tabs show nothing.

any help is appreciated.
 
Posts: 143 | Thanked: 205 times | Joined on Apr 2008
#4
Originally Posted by pamadio View Post
Actually, i still have a problem, the leading single quote trick did not work for ICalConverter::importEventDateEnd

(gdb) b ICalConverter::importEventDateEnd
Can't find member of namespace, class, struct, or union named "ICalConverter::importEventDateEnd"
Hint: try 'ICalConverter::importEventDateEnd<TAB> or 'ICalConverter::importEventDateEnd<ESC-?>
(Note leading single quote.)
(gdb) b 'ICalConverter::importEventDateEnd

here, tabs show nothing.

any help is appreciated.
You forgot the leading quote?
So: b 'CalConverter::importEventDateEnd
and then press Tab (two tabs to show all matching functions).
Note that in c++, arguments are added to the functions, something like foo(int,char*). Also namespaces needs to be added, so for 'namespace Foo { foo(int, char*); }' you need to write in gdb 'Foo::foo(int,char*)'
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:10.