[Ecls-list] Attach-GDB restart in Slime CVS

Matthew Mondor mm_lists at pulsar-zone.net
Thu Mar 18 15:53:42 UTC 2010


On Thu, 18 Mar 2010 16:33:55 +0100
"Tobias C. Rittweiler" <tcr at freebits.de> wrote:

> Matthew Mondor <mm_lists at pulsar-zone.net>
> writes:
> 
> > On Thu, 18 Mar 2010 15:54:05 +0100
> > "Tobias C. Rittweiler" <tcr at freebits.de> wrote:
> >
> >> I just added an ATTACH-GDB restart to Slime CVS which attachs runs 
> >> gdb -p <ecl's pid> in an Emacs buffer.
> >
> > This is a nice feature, however I think that to get the debug symbols
> > properly loaded you also need to specify the file to load them from
> > (i.e. gdb -p <pid> <file>).
> 
> Seems to work for me just fine. Perhaps GDB will look at the argv[0] of
> the process and try that as file?

Hmm, or it might make use of /proc, which is not normally used on
NetBSD perhaps (except for those using Linux binary compatibility,
sysctl being a preferred interface).

A small test here:

$ echo "int main(void) { for (;;) ; }" >/tmp/test.c
$ cc -o /tmp/test -g -O0 /tmp/test.c
$ /tmp/test &
$ pgrep -x test
13938

$ gdb -p 13938
GNU gdb 6.5
Copyright (C) 2006 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 "i386--netbsdelf".
Attaching to process 13938
0x080486de in ?? ()
(gdb) bt
#0  0x080486de in ?? ()
(gdb) ^D The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: , process 13938

$ gdb -p 13938 /tmp/test
GNU gdb 6.5
Copyright (C) 2006 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 "i386--netbsdelf"...
Attaching to program: /tmp/test, process 13938
Reading symbols from /usr/lib/libc.so.12...done.
Loaded symbols for /usr/lib/libc.so.12
Reading symbols from /usr/libexec/ld.elf_so...done.
Loaded symbols for /usr/libexec/ld.elf_so
main () at /tmp/test.c:1
1       int main(void) { for (;;) ; }
(gdb)

Thanks,
-- 
Matt




More information about the ecl-devel mailing list