Subject: Re: debugging a process
To: Michael L. Hitch <mhitch@lightning.oscs.montana.edu>
From: Chris Jones <cjones@rupert.honors.montana.edu>
List: port-pmax
Date: 04/02/1998 15:39:07
[CC'd to port-pmax, in case this helps somebody else]
On Thu, 2 Apr 1998, Michael L. Hitch wrote:
> On Apr 2, 3:06pm, Chris Jones wrote:
> > Hmm. I guess I didn't do enough testing. The problem actually comes in
> > when I try to attach to a running process. When I try that, it says my
> > stack frame is named ??, and it's the only stack frame that exists.
> You need to tell gdb to load the symbols:
>
> news$ cc -g -static -o x x.c
> news$ ./x &
> news$ jobs
> [1] 2535 ./x
> (gdb) attach 2535
> Attaching to process 2535
> 0x401744 in ?? ()
> (gdb) symbol x
> Reading symbols from x...done.
> (gdb) bt
> #0 0x401744 in nanosleep () at nanosleep:2
> #1 0x40170c in sleep ()
> #2 0x4013dc in main () at x.c:4
>
> Look any better? [I linked the target program static so that library symbols
> would be available. The mips gdb doesn't handle shared libraries too well
> yet.]
Wonderful. I can now proceed to debug our latest xdm/xterminal conflict.
:)
The info about linking statically is very useful, too. Thanks.
Chris
-------------------------------------------------------------------------------
Chris Jones cjones@rupert.oscs.montana.edu
Mad scientist in training...
"Is this going to be a stand-up programming session, sir, or another bug hunt?"