gdb does not want to attach to a primitive process

a at zeos.net a at zeos.net
Wed Sep 6 06:18:13 PDT 2006


Subject: gdb does not want to attach to a primitive process

I have written the next program:

// foo.c

#include <unistd.h>

int main(void) {
  sleep(30);
  return 0;
}

compiled it with

cc -g -o foo foo.c

then run it with

./foo

then switched to another tty and tried to attach to the process:

--- begin of screenshot ---

[elisej at localhost ~/Programming]$ ps
  PID  TT  STAT      TIME COMMAND
	...............	
 2160  v5  S+     0:00.00 ./foo
	...............

[elisej at localhost ~/Programming]$ gdb
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 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-marcel-freebsd".
(gdb) attach 2160
Attaching to process 2160
/usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/solib-svr4.c:1443: internal-error: legacy_fetch_link_map_offsets called without legacy link_map support enabled.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

/usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/solib-svr4.c:1443: internal-error: legacy_fetch_link_map_offsets called without legacy link_map support enabled.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Abort trap: 6 (core dumped)

--- end of screenshot ---

ttyv5 (were ./foo was running) reads the following:

--- begin of screenshot ---

[elisej at localhost ~/Programming]$ ./foo
Killed: 9

--- end of screenshot ---

Is this program too difficult to gdb?

Elisej Babenko


More information about the freebsd-questions mailing list