Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Elizabeth Chastain <mec@shout.net>
To: gdb@sources.redhat.com, i_am_triumph@ofir.dk
Subject: Re: Debugging GDB and breaking?
Date: Wed, 18 Dec 2002 07:23:00 -0000	[thread overview]
Message-ID: <200212181523.gBIFNUZ10382@duracef.shout.net> (raw)

Some general hints for debugging gdb:

I start with "gdb /my/gdb/to/debug/bin/gdb".  I like to use a stable gdb
for the top gdb, such as the vendor-supplied gdb or gdb 5.3.  Also this
helps separate, in my mind, the top gdb from the inferior gdb.

Then I immediately:

  (gdb) set prompt [top] 
  [top] break help_command
  [top] set args /program/under/test

The first line distinguishes the top gdb from the inferior gdb.

The second line lets me get back to the top gdb from the inferior gdb.
If the inferior gdb is waiting at a prompt, I just type "help foo"
and take the breakpoint at help_command.

The third line is the normal way to provide arguments to the inferior gdb.

After that, in your specific case, you want to break at break_command
and then use "next" and "step" from there.

Hope this helps,

Michael C


             reply	other threads:[~2002-12-18 15:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-18  7:23 Michael Elizabeth Chastain [this message]
2002-12-18  7:59 ` Andreas Schwab
2002-12-18 11:01 ` Grant Edwards
  -- strict thread matches above, loose matches on Subject: below --
2002-12-19  1:16 James Sampson
2002-12-18  5:49 James Sampson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200212181523.gBIFNUZ10382@duracef.shout.net \
    --to=mec@shout.net \
    --cc=gdb@sources.redhat.com \
    --cc=i_am_triumph@ofir.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox