From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4339 invoked by alias); 1 May 2004 21:34:15 -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 4330 invoked from network); 1 May 2004 21:34:14 -0000 Received: from unknown (HELO sccrmhc11.comcast.net) (204.127.202.55) by sources.redhat.com with SMTP; 1 May 2004 21:34:14 -0000 Received: from raven (pcp01876134pcs.sandia01.nm.comcast.net[68.35.12.10]) by comcast.net (sccrmhc11) with SMTP id <2004050121341301100mks03e>; Sat, 1 May 2004 21:34:13 +0000 From: "Christopher Nebergall" To: Subject: Non-interactive stepping Date: Sat, 01 May 2004 21:34:00 -0000 Message-ID: <000101c42fc4$0f9d0260$6401a8c0@raven> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-SW-Source: 2004-05/txt/msg00005.txt.bz2 Is it possible to use GDB (or another app) to print out the executing source code file name, line number, function name etc, for an application (compiled with -g) in a non-interactive manner (print the output to stdout)? I used a similar type of debugging in basica years ago and miss having something similar in modern debuggers. 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... The main reason I want this is to record program flow during real execution of the program without having to step through it line by line in the debugger. If there is a segfault, it's pretty easy to determine the program flow which caused it. It would also be useful to discover how a large program works, and what operations in a program's GUI or command line touch which lines of source code. It could also be used for very crude profiling. Thanks, Christopher