killing pdebug hangs QNX/RtP

I am able to hang my machine by sending a
kill -9 to a pdebug process.
I am attempting to debug via Tcl’s shared library.
I have built Tcl with symbols (and had to fix its
‘configure’ script to allow building a .so).
I am running on a self-hosted x86. Here is what I am doing:

$ gdb /usr/local/bin/tclsh8.3
(gdb) sym /usr/local/lib/libtcl8.3g.so
(gdb) run
(gdb) c
<I expect to see the tclsh prompt of %, but don’t>
^C
%
Program received signal 0, Signal 0.
0xb0328575 in Tcl_FileObjCmd (dummy=0x804a1ec,
interp=0x806796c, objc=4096,
objv=0x80475a4) at ./…/generic/tclCmdAH.c:944
944 if (objc != 3) {
(gdb) s
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n) y
Remote exhausted 3 retries.

At this point, the gdb session is hung. I go to another
shell window and say 'kill -9 ’
and the machine hangs. My mouse pointer doesn’t move
and I can do nothing but reboot the machine.

Any suggestions on how to get gdb to work in this
case (I am actually trying to get debug a shared
library that Tcl will load later, so I am not even close
to debugging what I really need to)? I may be doing
something illegal in trying to debug this way (I don’t
think so though), but it shouldn’t hang the
system. Is this a known problem?

Sue LoVerso
sue@sleepycat.com

There are a couple of issues here.

The first is that you are incorrectly trying to debug
the dll. You can’t load the symbols for the dll before
the dll has been loaded by the program. In order to
do this, you must debug the main program, then
ask gdb to detect the loaded shared libraries and load
the symbol information. The relevant commands are

info shared - show shared libs
shared - load symbol information

and the important gdb variable:

solib-search-path - where to look for shared objects

Set solib-search-path to where your shared objects are,
(you will also need /lib:/usr/lib)

Once you have loaded the shared object, type shared
at the gdb prompt (if you only want your dll’s symbols
loaded, then shared will take a partial string as
an argument).

The second problem is that gdb current doesn’t properly support
debugging apps that require text-mode input.

In that case, you need to attach to the target from another
console. This will be fixed soon, I hope.

The third problem is a nasty one, and I will try
to reproduce it here.

Colin

Susan LoVerso <sue@loverso.southborough.ma.us> wrote:

I am able to hang my machine by sending a
kill -9 to a pdebug process.
I am attempting to debug via Tcl’s shared library.
I have built Tcl with symbols (and had to fix its
‘configure’ script to allow building a .so).
I am running on a self-hosted x86. Here is what I am doing:

$ gdb /usr/local/bin/tclsh8.3
(gdb) sym /usr/local/lib/libtcl8.3g.so
(gdb) run
(gdb) c
I expect to see the tclsh prompt of %, but don’t
^C
%
Program received signal 0, Signal 0.
0xb0328575 in Tcl_FileObjCmd (dummy=0x804a1ec,
interp=0x806796c, objc=4096,
objv=0x80475a4) at ./…/generic/tclCmdAH.c:944
944 if (objc != 3) {
(gdb) s
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n) y
Remote exhausted 3 retries.

At this point, the gdb session is hung. I go to another
shell window and say 'kill -9 ’
and the machine hangs. My mouse pointer doesn’t move
and I can do nothing but reboot the machine.

Any suggestions on how to get gdb to work in this
case (I am actually trying to get debug a shared
library that Tcl will load later, so I am not even close
to debugging what I really need to)? I may be doing
something illegal in trying to debug this way (I don’t
think so though), but it shouldn’t hang the
system. Is this a known problem?

Sue LoVerso
sue@sleepycat.com


cburgess@qnx.com