Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: grv575 on August 16, 2005, 06:36:53 am

Title: gdb tutorials
Post by: grv575 on August 16, 2005, 06:36:53 am
Know of any good links to get started with gdb?  Tutorials, quickrefs,...
Title: Re: gdb tutorials
Post by: rickg22 on August 16, 2005, 07:44:12 am
your friends:

gdb> run

(oooh a crash!)

gdb> bt

gdb> frame 1
(switches to stack frame #1)

gdb> print mylocalvar

(shows you some pointer to an object, to say an example)

gdb> print mylocalvar->something()

I don't know how to set breakpoints.. yet :P
Title: Re: gdb tutorials
Post by: pa3k on August 16, 2005, 10:50:27 am
maybe these links will help you:

http://heather.cs.ucdavis.edu/~matloff/debug.html
http://heather.cs.ucdavis.edu/~matloff/UnixAndC/CLanguage/Debug.html
Title: Re: gdb tutorials
Post by: grv575 on August 16, 2005, 12:01:04 pm
pa3k: great,thx for the links.

also:
http://www.isi.edu/acal/documentation/Tools/gdb.refcard.ps
http://dsl.ee.unsw.edu.au/dsl-cdrom/gnutools/doc/gnu-debugger-quickref.pdf
http://ugweb.cs.ualberta.ca/~c201/resources/emacs/refcards/gdb-refcard.pdf
Title: Re: gdb tutorials
Post by: Funto on August 17, 2005, 12:46:14 am
There is a nice GDB tutorial provided with Dev-C++ (:roll:), made by Richard Stallman himself ^^
Title: Re: gdb tutorials
Post by: rickg22 on August 17, 2005, 04:01:25 am
why not ask him to refurbish it? :P "Code::Blocks. No proprietary compilers required" lol
Title: Re: gdb tutorials
Post by: Funto on August 17, 2005, 10:42:33 am
Hmm about debugging in C::B...
Is it possible to debug and watch variables as we can do with VC++? I mean, without having to add manually the variable name in the "Watch" tab...
Title: Re: gdb tutorials
Post by: mandrav on August 18, 2005, 09:23:49 pm
Hmm about debugging in C::B...
Is it possible to debug and watch variables as we can do with VC++? I mean, without having to add manually the variable name in the "Watch" tab...

You can place the editor caret over the variable's name you want to watch and [right-click->Watch 'your var'].
Or you can provide more info on what you 'd like to do...

Yiannis.