From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9447 invoked by alias); 21 Nov 2008 19:05:02 -0000 Received: (qmail 9404 invoked by uid 22791); 21 Nov 2008 19:04:59 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Nov 2008 19:04:24 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 1DE3247007; Fri, 21 Nov 2008 11:04:22 -0800 (PST) Received: from [10.20.92.151] (promb-2s-dhcp151.eng.vmware.com [10.20.92.151]) by mailhost3.vmware.com (Postfix) with ESMTP id 0DBC3C9A88; Fri, 21 Nov 2008 11:04:22 -0800 (PST) Message-ID: <4927062C.4020806@vmware.com> Date: Fri, 21 Nov 2008 19:05:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Gaius Mulley CC: Sandeep222 , "gdb@sourceware.org" Subject: Re: How to store function-name and its return values while program runs References: <20618721.post@talk.nabble.com> <87skpl1gy7.fsf@j228-gm.comp.glam.ac.uk> In-Reply-To: <87skpl1gy7.fsf@j228-gm.comp.glam.ac.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00135.txt.bz2 Gaius Mulley wrote: > Sandeep222 writes: > >> As we proceed with debugging a program, if I need to know the order of >> functions being executed by printing on screen along with their return >> values when a 'run' command or 'next' command is executed, how can i >> proceed? I went thru frame.c but all the function seem to execute only when >> a command is executed in the gdb. Plz help. >> Reg, >> Sandeep > > set a breakpoint at each of the functions of interest. > > (gdb) break function1 > (gdb) break function2 > > etc > > now run the program > > (gdb) run > > when gdb hits a breakpoint you can finish the function and > print the result via: > > (gdb) fin And indeed, you can make that automatic by attaching the commands to the breakpoints: (gdb) break function1 (gdb) commands > finish > continue > end (gdb)