This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: x64 machine code and stack frames
- From: Dov Grobgeld <dov dot grobgeld at gmail dot com>
- To: Matt Rice <ratmice at gmail dot com>
- Cc: GDB <gdb at sourceware dot org>
- Date: Fri, 22 Jan 2016 08:46:54 +0200
- Subject: Re: x64 machine code and stack frames
- Authentication-results: sourceware.org; auth=none
- References: <CA++fsGHJ0AD2ZvPjdc3RbWurDvdqKYdtPuJp_HXO_m9uA=i3hQ at mail dot gmail dot com> <CACTLOFpnvXky3guqoNwcQyxY0c_5AENUpYY2xvo7Yu26Ya=J5g at mail dot gmail dot com>
Thanks. Indeed it sounds like the right direction. I have to figure
out how it works in a mixed environment with both static DWARF based
code as well as dynamically allocated code.
On Fri, Jan 22, 2016 at 4:27 AM, Matt Rice <ratmice@gmail.com> wrote:
>
>
> On Thu, Jan 21, 2016 at 11:45 AM, Dov Grobgeld <dov.grobgeld@gmail.com>
> wrote:
>>
>> Hello,
>>
>> I've inherited some clever x64 machine code for linux that creates an
>> machine code wrapper around a c-function call. I guess that in higher
>> language terms the code might be called a decorator or a closure. The
>> code is functioning well, but with the unfortunate artifact that when
>> the wrapper is called, it gobbles the stack trace in gdb.
>>
>> From what I have learned from the net gdb uses
>> https://en.wikipedia.org/wiki/DWARF as a guide for separating the
>> stack frames in the stack. This works well for static code, but
>> obviously code generated and called at run time isn't registered in
>> the DWARF framework.
>>
>> My question is if there is any way to rescue the stack trace in this
>> situation?
>
>
> While i haven't really used it before & can't comment on the particulars,
> It sounds like you should be using the jit interface to make gdb aware of
> the symbols generated at runtime.
>
> https://sourceware.org/gdb/onlinedocs/gdb/JIT-Interface.html