From: Andreas Schwab <schwab@suse.de>
To: Vlad Ivanov <vlad.ivanov@lab-systems.ru>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdbarch: Add pc_signed field and use it when adjusting BP addresses
Date: Thu, 15 Mar 2018 13:46:00 -0000 [thread overview]
Message-ID: <mvm8tatlaed.fsf@suse.de> (raw)
In-Reply-To: <830441521113797@web37j.yandex.ru> (Vlad Ivanov's message of "Thu, 15 Mar 2018 14:36:37 +0300")
On Mär 15 2018, Vlad Ivanov <vlad.ivanov@lab-systems.ru> wrote:
> 15.03.2018, 14:33, "Andreas Schwab" <schwab@suse.de>:
>> On Mär 15 2018, vlad.ivanov@lab-systems.ru wrote:
>>
>>> Â diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
>>> Â index 454fda7684..247ec34857 100644
>>> Â --- a/gdb/breakpoint.c
>>> Â +++ b/gdb/breakpoint.c
>>> Â @@ -6999,7 +6999,10 @@ adjust_breakpoint_address (struct gdbarch *gdbarch,
>>> Â Â Â Â Â Â Â Â Â Â Â Â adjusted_bpaddr = gdbarch_adjust_breakpoint_address (gdbarch, bpaddr);
>>> Â Â Â Â Â Â Â Â Â Â }
>>>
>>> Â - adjusted_bpaddr = address_significant (gdbarch, adjusted_bpaddr);
>>> Â + /* Don't cut out "insignificant" address bits on targets with
>>> Â + signed PC. */
>>> Â + if (!gdbarch_pc_signed (gdbarch))
>>> Â + adjusted_bpaddr = address_significant (gdbarch, adjusted_bpaddr);
>>
>> Shouldn't it be sign-extended instead?
>>
>> Andreas.
>>
>
> MIPS backend already returns a sign-extended value, and address_significant
> cuts out bits 63 to 32. This makes breakpoint address comparison in step
> routines to misbehave.
What happens if you start with a non-canonical address? The call to
address_significant wouldn't be needed if adjusted_bpaddr were always
canonical to begin with.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
next prev parent reply other threads:[~2018-03-15 13:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-15 11:22 vlad.ivanov
2018-03-15 11:34 ` Andreas Schwab
2018-03-15 11:36 ` Vlad Ivanov
2018-03-15 12:59 ` Ulrich Weigand
2018-03-15 13:10 ` Vlad Ivanov
2018-03-15 14:06 ` Ulrich Weigand
2018-03-15 14:23 ` Vlad Ivanov
2018-03-19 14:14 ` Maciej W. Rozycki
2018-03-19 14:29 ` Ulrich Weigand
2018-03-15 13:46 ` Andreas Schwab [this message]
2018-03-15 13:56 ` Vlad Ivanov
2018-03-15 11:43 ` Vlad Ivanov
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=mvm8tatlaed.fsf@suse.de \
--to=schwab@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=vlad.ivanov@lab-systems.ru \
/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).