[haiku-commits] Re: BRANCH xyzzy-github.x86_64 - in src/system/kernel/arch/x86: . 64

  • From: Alex Smith <alex@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 13 Jul 2012 16:20:08 +0100

On 13 July 2012 15:44, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:

> xyzzy-github.x86_64 wrote:
> [...]
> > +#else // __x86_64__
> > +
> > +
> > +static status_t
> > +print_demangled_call(const char* image, const char* symbol, addr_t args,
> > + bool noObjectMethod, bool addDebugVariables)
> > +{
> > + // Since x86_64 uses registers rather than the stack for the first 6
> > + // arguments we cannot use the same method as x86 to read the function
> > + // arguments. Maybe we need DWARF support in the kernel debugger. For
> now
> > + // just print out the function signature without the argument values.
>
> Well, theoretically Dwarf support would be nice. I think it's a bit
> overkill though. gdb (or eventually Debugger) would be able to get the
> information, if desired, even if that won't usually be done for the common
> bug reports. The x86 gcc 4 kernel stack traces aren't always correct
> either, BTW. When calling static functions gcc 4 often optimizes the call
> by passing arguments via registers (at least eax).
>

Plus even with DWARF, it still may not be possible to get all the arguments
as their values may be lost due to optimization. If I fix up the GDB stub
for x86_64 that should be sufficient. Not sure what the problem is with it,
it's faulting when I connect GDB to it. Probably the stub code is not
correct for 64-bit, I'll look into it later.

Thanks,
Alex

Other related posts: