From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 899 invoked by alias); 23 Jul 2009 00:34:52 -0000 Received: (qmail 890 invoked by uid 22791); 23 Jul 2009 00:34:51 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33,SARE_MSGID_LONG40,SPF_PASS 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.43rc1) with ESMTP; Thu, 23 Jul 2009 00:34:43 +0000 Received: from zps19.corp.google.com (zps19.corp.google.com [172.25.146.19]) by smtp-out.google.com with ESMTP id n6N0Ye5k019375 for ; Wed, 22 Jul 2009 17:34:40 -0700 Received: from qw-out-2122.google.com (qwh8.prod.google.com [10.241.194.200]) by zps19.corp.google.com with ESMTP id n6N0YbG6013713 for ; Wed, 22 Jul 2009 17:34:38 -0700 Received: by qw-out-2122.google.com with SMTP id 8so342855qwh.37 for ; Wed, 22 Jul 2009 17:34:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.91.13 with SMTP id k13mr276596qcm.98.1248309277608; Wed, 22 Jul 2009 17:34:37 -0700 (PDT) In-Reply-To: <20090722213048.GD4952@adacore.com> References: <4A670F21.407@redpinesignals.com> <20090722213048.GD4952@adacore.com> Date: Thu, 23 Jul 2009 00:34:00 -0000 Message-ID: <8ac60eac0907221734i18c1aa12sae62b0f2de115f32@mail.gmail.com> Subject: Re: gdb script From: Paul Pluzhnikov To: Joel Brobecker Cc: "nagaraju.m" , gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-System-Of-Record: true 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: 2009-07/txt/msg00179.txt.bz2 On Wed, Jul 22, 2009 at 2:30 PM, Joel Brobecker wrote: >> *can any one please help me out why gdb is not giving control back to >> script > > That's actually the documented behavior. Really? I thought script execution stopped only on errors: Node: Command Files An error in any command terminates execution of the command file and control is returned to the console. Anyway, this seems to work for me: cat t.c int main() { return 0; } gcc -g t.c cat gdb.cmd break main run info reg quit gdb -q -nx -x gdb.cmd ./a.out Breakpoint 1 at 0x40044c: file t.c, line 1. Breakpoint 1, main () at t.c:1 1 int main() { return 0; } rax 0x7ffff7ddca60 140737351895648 rbx 0x7ffff7ffdc00 140737354128384 rcx 0x400470 4195440 rdx 0x7fffffffdb88 140737488345992 rsi 0x7fffffffdb78 140737488345976 rdi 0x1 1 rbp 0x7fffffffda90 0x7fffffffda90 rsp 0x7fffffffda90 0x7fffffffda90 r8 0x7ffff7ddb2e0 140737351889632 r9 0x7ffff7dee580 140737351968128 r10 0x0 0 r11 0x7ffff7a9c0d0 140737348485328 r12 0x0 0 r13 0x7fffffffdb70 140737488345968 r14 0x0 0 r15 0x0 0 rip 0x40044c 0x40044c eflags 0x246 [ PF ZF IF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 fctrl 0x37f 895 fstat 0x0 0 ftag 0xffff 65535 fiseg 0x0 0 fioff 0x0 0 foseg 0x0 0 fooff 0x0 0 fop 0x0 0 mxcsr 0x1f80 [ IM DM ZM OM UM PM ] The program is running. Exit anyway? (y or n) [answered Y; input not from terminal] -- Paul Pluzhnikov