Subject: Re: evaluating symbols in ddb
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Andrew Cagney <cagney@mac.com>
List: tech-kern
Date: 06/05/2002 23:39:43
> Kamal Prasad <kamalpr@yahoo.com> writes:
>
>
>> I am using ddb in macppc-netbsd to look at
>> panics,deadlocks etc.. I cannot/may not be able to
>> -access this via gdb.
>> assuming I have a stack from trace /t ... in ddb:-
>
>
>> 1. How do I evaluate parameters to a function call
>> inside a stack frame?
>
>
> This is hard. Like most other RISC architectures, powerpc uses
> registers to pass the first several (six for ppc) arguments. For
> functions other than the most recent, the register values may be
> stored on the stack, but only if their values were live at the moment
> of the function call. You need something that can parse the full
> debugging information built into a -g kernel to figure this out, and
> even then you are likely to not have all the values saved any more.
Why not teach GDB to (gulp) talk to ddb? See gdb/remote-rom.c for the
general theory.
Andrew
>> 2. the local variables inside a stack frame
>
>
> Also requires parsing debug information beyond the basic symbol
> table. I usually find it easist to have another computer with a
> debugger or objdump, disassemble the functions in question, and
> interpolate the storage locations of variables from the action of the
> machine code.
>
> - Nathan