Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: C T Nebergall <CT-Nebergall@wiu.edu>
To: Nick Roberts <nick@nick.uklinux.net>
Cc: ct-nebergall@wiu.edu, gdb@sources.redhat.com
Subject: Re: Non-interactive stepping
Date: Mon, 03 May 2004 02:54:00 -0000	[thread overview]
Message-ID: <Pine.SOL.3.95.1040502213757.23523A-100000@ecom1> (raw)
In-Reply-To: <16533.26532.533759.49792@nick.uklinux.net>

Thanks! That'll work ok for relatively small programs, so I'll probably
take advantage of it, but I'm still in need of something cleaner for large
programs.  I'm starting to code in Mozilla, a tool like this would be
invaluable for understanding the flow of the code when its running.  I
wouldn't mind hacking GDB to try and get this type of functionality if I
knew where to start.

Thanks,
Christopher


On Sun, 2 May 2004, Nick Roberts wrote:

|> I want to do something similar to
|
|> gdb -[Some command line argument] a.out
|> a.out: main.c:5 main() May  1 16:18:07 CDT 2004
|> a.out: main.c:6 main() May  1 16:18:08 CDT 2004
|> a.out: main.c:7 main() May  1 16:18:09 CDT 2004
|> a.out: main.c:25 print() May  1 16:18:09 CDT 2004
|> a.out: main.c:28 print() May  1 16:18:09 CDT 2004
|> a.out: source2.c:10 echo() May  1 16:18:10 CDT 2004
|> a.out: source2.c:11 echo() May  1 16:18:10 CDT 2004
|> a.out: source2.c:11 echo() May  1 16:18:12 CDT 2004
|> a.out: main.c:29 print() May  1 16:18:13 CDT 2004
|> a.out: main.c:8 main() May  1 16:18:14 CDT 2004
|> etc...
|
|Here's an ugly hack that gives you line information.
|
|Put the following user-defined command in your .gdbinit file:
|
|define mytrace
|  set height 0
|  b main
|  run
|  while 1
|    step
|  end
|end
|
|Run gdb with "gdb -ann=1 myprog" and type "mytrace" at the prompt
|
|to get something like:
|
|(gdb) mytrace
|Breakpoint 1 at 0x804849f: file myprog.c, line 38.
|
|Breakpoint 1, main () at myprog.c:38
|^Z^Z/home/nick/myprog.c:38:389:beg:0x804849f
|^Z^Z/home/nick/myprog.c:44:470:beg:0x80484a6
|^Z^Z/home/nick/myprog.c:49:585:beg:0x80484ec
|^Z^Z/home/nick/myprog.c:50:595:beg:0x80484f5
|^Z^Z/home/nick/myprog.c:51:611:beg:0x804850d
|^Z^Z/home/nick/myprog.c:52:628:beg:0x8048525
|^Z^Z/home/nick/myprog.c:53:637:beg:0x804852c
|...
|
|You might want to re-direct any program output.
|
|Nick
|


  reply	other threads:[~2004-05-03  2:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-02 21:27 Nick Roberts
2004-05-03  2:54 ` C T Nebergall [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-05-01 21:34 Christopher Nebergall
2004-05-02 13:04 ` Bob Rossi
2004-05-02 16:03   ` Kip Macy

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=Pine.SOL.3.95.1040502213757.23523A-100000@ecom1 \
    --to=ct-nebergall@wiu.edu \
    --cc=gdb@sources.redhat.com \
    --cc=nick@nick.uklinux.net \
    /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