From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7053 invoked by alias); 19 Nov 2007 15:03:56 -0000 Received: (qmail 7037 invoked by uid 22791); 19 Nov 2007 15:03:55 -0000 X-Spam-Check-By: sourceware.org Received: from mail.intrepid.com (HELO mail.intrepid.com) (74.95.8.113) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 19 Nov 2007 15:03:51 +0000 Received: from screamer.intrepid.com (screamer.intrepid.com [10.10.1.2]) by mail.intrepid.com (8.13.8/8.13.8) with ESMTP id lAJF3nT3016592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Nov 2007 07:03:49 -0800 Received: from screamer.intrepid.com (screamer.intrepid.com [127.0.0.1]) by screamer.intrepid.com (8.13.8/8.13.8) with ESMTP id lAJF3m4x003733; Mon, 19 Nov 2007 07:03:48 -0800 Received: (from gary@localhost) by screamer.intrepid.com (8.13.8/8.13.8/Submit) id lAJF3mo9003732; Mon, 19 Nov 2007 07:03:48 -0800 Date: Mon, 19 Nov 2007 15:03:00 -0000 From: Gary Funck To: GDB List Cc: Robert Norton Subject: Re: SGI/Irix: how to call procedure from GDB? Message-ID: <20071119150348.GA32008@intrepid.com> References: <20071119043012.GB23963@intrepid.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i 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: 2007-11/txt/msg00189.txt.bz2 On 11/19/07 03:04:38, Robert Norton wrote: > > -----Original Message----- > > From: Gary Funck > > Sent: 19 November 2007 04:30 > > To: GDB List > > Subject: SGI/Irix: how to call procedure from GDB? > > > > [...] > > Any suggestions on what might've happened here, and what I > > need to do to get GDB to to run the "debug_tree()" procedure? > > GDB called the debug_tree function _on the target_ in order to evaluate > the expression. During execution of this the breakpoint at fancy_abort > was hit again. You could try disabling the breakpoint, continuing then > doing the pt command again, but it looks like you've run into another > internal error during the evaluation of debug_tree so this probably > isn't going to help. That makes sense. Thanks. However, I just tried something simple. A test program: 1 #include 2 3 int sq(int x) 4 { 5 return x * x; 6 } 7 8 int main() 9 { 10 int x = 10; 11 int s = sq(x); 12 printf ("x = %d s = %d\n", x, s); 13 } % gcc t.c -O0 -g -o t % gdb t GNU gdb 6.7.1 Copyright (C) 2007 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 "mips-sgi-irix6.5"... (gdb) b 11 Breakpoint 1 at 0x100013c0: file t.c, line 11. (gdb) r Starting program: /upc/dev/gary/gcc-upc-4-2/wrk/upc_test/test/t Breakpoint 1, main () at t.c:11 11 int s = sq(x); (gdb) p sq(x) Breakpoint 1, main () at t.c:11 11 int s = sq(x); The program being debugged stopped while in a function called from GDB. When the function (sq) is done executing, GDB will silently stop (instead of continuing to evaluate the expression containing the function call). ### if I delete all breakpoints, the following occurs: (gdb) d Delete all breakpoints? (y or n) y (gdb) p sq(x) x = 10 s = 100 Program exited normally. The program being debugged stopped while in a function called from GDB. When the function (sq) is done executing, GDB will silently stop (instead of continuing to evaluate the expression containing the function call). Interestingly, I saw the same behavior with gdb 6.5, which I had installed a while back. But when I try the "freeware" version built by SGI (gdb 5.3), all is well: % /usr/freeware/bin/gdb --version GNU gdb 5.3 Copyright 2002 Free Software Foundation, Inc. [...] This GDB was configured as "mips-sgi-irix6.5"... (gdb) b 12 Breakpoint 1 at 0x100013a8: file t.c, line 12. (gdb) c The program is not being run. (gdb) r Starting program: /upc/dev/gary/gcc-upc-4-2/wrk/upc_test/test/t Breakpoint 1, main () at t.c:12 12 int s = sq(x); (gdb) p sq(x) $1 = 100 It's been a while since I ran anything on that now antiquated SGI/MIPS Irix box. I recall installing gdb 6.5 because there were limitations in gdb 5.3's understanding of the dwarf debugging info. What I don't recall is whether I tried calling a procedure from gdb.