From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14721 invoked by alias); 3 May 2004 02:54:37 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14654 invoked from network); 3 May 2004 02:54:35 -0000 Received: from unknown (HELO mail.wiu.edu) (143.43.222.219) by sources.redhat.com with SMTP; 3 May 2004 02:54:35 -0000 Received: from scanner0.wiu.edu (scanner0 [143.43.222.140]) by mail.wiu.edu (8.9.3/8.9.3) with SMTP id VAA14523; Sun, 2 May 2004 21:54:28 -0500 (CDT) Received: from ecom1.wiu.edu ([143.43.222.11]) by scanner0.wiu.edu (SAVSMTP 3.1.1.32) with SMTP id M2004050221542706053 ; Sun, 02 May 2004 21:54:27 -0500 Received: from localhost (muctn@localhost) by ecom1.wiu.edu (8.9.3/8.9.3) with SMTP id VAA04558; Sun, 2 May 2004 21:54:28 -0500 (CDT) X-Authentication-Warning: ecom1.wiu.edu: muctn owned process doing -bs Date: Mon, 03 May 2004 02:54:00 -0000 From: C T Nebergall X-Sender: muctn@ecom1 To: Nick Roberts cc: ct-nebergall@wiu.edu, gdb@sources.redhat.com Subject: Re: Non-interactive stepping In-Reply-To: <16533.26532.533759.49792@nick.uklinux.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-05/txt/msg00017.txt.bz2 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 |