public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Dov Grobgeld <dov.grobgeld@gmail.com>
To: Matt Rice <ratmice@gmail.com>
Cc: GDB <gdb@sourceware.org>
Subject: Re: x64 machine code and stack frames
Date: Fri, 22 Jan 2016 06:47:00 -0000	[thread overview]
Message-ID: <CA++fsGGbUyCjnJ8Ff0PmMuSNtre5Jtf5Qb=k4=caFytrj8p4SQ@mail.gmail.com> (raw)
In-Reply-To: <CACTLOFpnvXky3guqoNwcQyxY0c_5AENUpYY2xvo7Yu26Ya=J5g@mail.gmail.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

  parent reply	other threads:[~2016-01-22  6:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 19:45 Dov Grobgeld
     [not found] ` <CACTLOFpnvXky3guqoNwcQyxY0c_5AENUpYY2xvo7Yu26Ya=J5g@mail.gmail.com>
2016-01-22  6:47   ` Dov Grobgeld [this message]
2016-01-22 10:37     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA++fsGGbUyCjnJ8Ff0PmMuSNtre5Jtf5Qb=k4=caFytrj8p4SQ@mail.gmail.com' \
    --to=dov.grobgeld@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=ratmice@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).