Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Martin Galvan <martin.galvan@tallertechnologies.com>,
	       gdb-patches@sourceware.org, Doug Evans <dje@google.com>,
	       Eli Zaretskii <eliz@gnu.org>,
	Ulrich Weigand <uweigand@de.ibm.com>,
	       Daniel Gutson <daniel.gutson@tallertechnologies.com>
Subject: Re: [PING][RFC][PATCH v2] Python API: add gdb.stack_may_be_invalid
Date: Fri, 07 Nov 2014 17:09:00 -0000	[thread overview]
Message-ID: <545CFCCA.1070304@redhat.com> (raw)
In-Reply-To: <CAOKbPbZd+ppseGQW2OirBm4y5O=LgUMP-Pf8=RF00hnPOuMutw@mail.gmail.com>

On 11/07/2014 01:32 PM, Martin Galvan wrote:
> 2) The behavior of handle_step_into_function and setting breakpoints
> is inconsistent for optimized code, at least in ARM. If you step into
> a function in a program compiled with gcc -O1, you'll see the PC ends
> up one instruction after the set of instructions that place the
> arguments passed as registers in the registers they'll be used in. If
> you do "break myFunction", however, the breakpoint will correctly be
> placed at the very first instruction. Both handle_step.. and setting
> breakpoints have the same effect on -O0 code.

We should really fix this.  I can't imagine we do this on purpose.

> If we look at how "break myFunction" works, we'll see that we end up
> calling find_function_start_sal to determine at which PC we have to
> place our breakpoint. Therefore, that's the function we should be
> calling when checking whether the stack frame will be valid at a
> prologue, as it also accounts for optimizations.

We expose functions and sals as python objects.
Shouldn't we instead consider exposing find_function_start_sal
in the function object?  Or maybe symbol_to_sal in the Symbol object?
I can well imagine these being useful to other use cases.

Thanks,
Pedro Alves


  reply	other threads:[~2014-11-07 17:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 13:32 Martin Galvan
2014-11-07 17:09 ` Pedro Alves [this message]
2014-11-07 17:18   ` Martin Galvan
2014-11-07 17:27 ` Ulrich Weigand
2014-11-07 17:37   ` Martin Galvan
2014-11-12 15:55     ` Martin Galvan
2014-11-12 17:06       ` Doug Evans
2014-11-12 17:20         ` Pedro Alves
2014-11-12 17:26           ` Martin Galvan
2014-11-12 17:32           ` Doug Evans
2014-11-12 17:24         ` Martin Galvan

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=545CFCCA.1070304@redhat.com \
    --to=palves@redhat.com \
    --cc=daniel.gutson@tallertechnologies.com \
    --cc=dje@google.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=martin.galvan@tallertechnologies.com \
    --cc=uweigand@de.ibm.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