public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Sasha Da Rocha Pinheiro <darochapinhe@wisc.edu>
Cc: "elfutils-devel@sourceware.org" <elfutils-devel@sourceware.org>
Subject: Re: Dwarf_Op
Date: Wed, 01 May 2019 23:02:00 -0000	[thread overview]
Message-ID: <20190501230213.GD39969@wildebeest.org> (raw)
In-Reply-To: <DM5PR06MB3369F312398360A5BAA988A7A63B0@DM5PR06MB3369.namprd06.prod.outlook.com>

On Wed, May 01, 2019 at 05:08:15PM +0000, Sasha Da Rocha Pinheiro wrote:
> yes, I did use dwarf_frame_register(), I believe I mentioned that :).

Sorry, I missed that.

> In the case I brought up you're saying it was an elfutils' libdw
> decision to provide negative number as DW_OP_plus_uconst (unsigned
> constant)? So there would be no harm to cast it to a signed int??

Yes, since I don't believe there is a better representation.
There is no DW_OP_plus_sconst for example.

> Do you know if the rules to find the registers will always have only
> another one register associated to it?  Because libdwarf function
> dwarf_get_fde_info_for_reg3() returns a register_num, which is
> described as: "Argument register_num should point to a location
> which will hold the register number associated with the register
> rule."

I am not familiar with libdwarf, so don't know how to answer this question

> elfutils only gives us a location description in an array of
> Dwarf_Op. Does it provide methods to "execute" it so we can get the
> result of the expressions? Or it delegates it to the consumer?

It doesn't have a generic location description "executor". It really
should have. But to make it generic it needs a lot of context.

libdwfl does contain a partial operator interpreter for unwinding. See
expr_eval in libdwfl/frame_unwind.c. To turn that into something more
generic we would need some way to provide it with things like memory
accessors and register values. libdwfl provides some of that through
dwfl_attach_state.

Cheers,

Mark

  reply	other threads:[~2019-05-01 23:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25 23:59 Dwarf_Op Sasha Da Rocha Pinheiro
2019-04-26  8:20 ` Dwarf_Op Mark Wielaard
2019-04-26 16:48   ` Dwarf_Op Sasha Da Rocha Pinheiro
2019-04-27 17:57     ` Dwarf_Op Mark Wielaard
2019-05-01 17:08       ` Dwarf_Op Sasha Da Rocha Pinheiro
2019-05-01 23:02         ` Mark Wielaard [this message]
2019-05-02 19:29           ` Dwarf_Op Sasha Da Rocha Pinheiro
2019-05-03 21:09             ` Dwarf_Op Mark Wielaard
2019-05-08 18:04               ` Dwarf_Op Sasha Da Rocha Pinheiro
2019-05-10 23:39                 ` Dwarf_Op Mark Wielaard

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=20190501230213.GD39969@wildebeest.org \
    --to=mark@klomp.org \
    --cc=darochapinhe@wisc.edu \
    --cc=elfutils-devel@sourceware.org \
    /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).