From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12198 invoked by alias); 21 Nov 2008 22:11:20 -0000 Received: (qmail 12133 invoked by uid 22791); 21 Nov 2008 22:11:19 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Nov 2008 22:10:24 +0000 Received: from zps76.corp.google.com (zps76.corp.google.com [172.25.146.76]) by smtp-out.google.com with ESMTP id mALMAMQh001989 for ; Fri, 21 Nov 2008 14:10:22 -0800 Received: from rv-out-0506.google.com (rvfb25.prod.google.com [10.140.179.25]) by zps76.corp.google.com with ESMTP id mALMAK4x032588 for ; Fri, 21 Nov 2008 14:10:21 -0800 Received: by rv-out-0506.google.com with SMTP id b25so1116220rvf.41 for ; Fri, 21 Nov 2008 14:10:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.157.1 with SMTP id f1mr563040wae.43.1227305420538; Fri, 21 Nov 2008 14:10:20 -0800 (PST) In-Reply-To: <4927062C.4020806@vmware.com> References: <20618721.post@talk.nabble.com> <87skpl1gy7.fsf@j228-gm.comp.glam.ac.uk> <4927062C.4020806@vmware.com> Date: Fri, 21 Nov 2008 22:11:00 -0000 Message-ID: <8ac60eac0811211410s2196e9a1g28c824850b222bf6@mail.gmail.com> Subject: Re: How to store function-name and its return values while program runs From: Paul Pluzhnikov To: Michael Snyder Cc: Gaius Mulley , Sandeep222 , "gdb@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 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/msg00137.txt.bz2 On Fri, Nov 21, 2008 at 11:04 AM, Michael Snyder wrote: > (gdb) break function1 > (gdb) commands >> finish >> continue >> end > (gdb) I wished many times that above worked, but it doesn't: 'finish' appears to interrupt flow of script, and subsequent commands are never executed: cat t.c int foo() { return 42; } int main() { return foo(); } gcc -g t.c gdb64-cvs ./a.out GNU gdb (GDB) 6.8.50.20081118-cvs Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: ... (gdb) b foo Breakpoint 1 at 0x400310: file t.c, line 1. (gdb) commands 1 >finish >print/a $pc >continue >end (gdb) r Breakpoint 1, foo () at t.c:1 1 int foo() { return 42; } 0x0000000000400325 in main () at t.c:2 2 int main() { return foo(); } Value returned is $1 = 42 # Neither 'print/a $pc' nor 'continue' executed :( (gdb) q Is this a bug? -- Paul Pluzhnikov