This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: Call function in gdb
- To: hjl at lucon dot org (H.J. Lu)
- Subject: Re: Call function in gdb
- From: Jim Blandy <jimb at cygnus dot com>
- Date: 15 Nov 1999 13:43:59 -0500
- Cc: gdb at sourceware dot cygnus dot com (GDB)
- References: <19991112214208.CAB231B493@ocean.lucon.org>
> With old gdb, I can do
>
> (gdb) call foo (1)
>
> Now with gdb in CVS, I got "segmentation fault". Any ideas, BTW,
> I am using Linux/i386.
Not sure what's up --- it works for me:
zenia:play$ $c6/gdb/gdb -nw bar
Tip of the day: GUIs are not evil.
To disable command-line taunts, run gdb with "-w".
GNU gdb 4.18.1
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) break main
Breakpoint 1 at 0x80483e7: file bar.c, line 12.
(gdb) run
Starting program: /home/jimb/play/bar
Breakpoint 1, main (argc=1, argv=0xbffff524) at bar.c:12
12 printf ("%d\n", bar (argc));
(gdb) p bar(3)
$1 = 4
(gdb) list
7 }
8
9 int
10 main (int argc, char **argv)
11 {
12 printf ("%d\n", bar (argc));
13
14 return 0;
15 }
(gdb) The program is running. Exit anyway? (y or n)