From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: brobecker@adacore.com, gdb-patches@sourceware.org
Subject: Re: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #3
Date: Fri, 30 Dec 2011 14:16:00 -0000 [thread overview]
Message-ID: <20111230112414.GB21767@host2.jankratochvil.net> (raw)
In-Reply-To: <201112301038.pBUAcxQS004801@glazunov.sibelius.xs4all.nl>
On Fri, 30 Dec 2011 11:38:59 +0100, Mark Kettenis wrote:
> I'm still a little bit worried that Jan's approach is making
> additional assumptions. The chance that the 2nd instruction of the
> program will be executed again as part of the normal flow is probably
> not much higher than for the 1st instructions,
The patched code does not use the original entry_point_address in any way,
it passes to gdbarch_push_dummy_call already the adjusted address as bp_addr.
This is also the reason why it no longer uses gdb_buffered_insn_length but
just gdbarch_breakpoint_from_pc's bp_len is enough. We may place the
breakpoint inside the first instruction ("corrupting" it) but as the first
instruction is not used anywhere it does not matter. The inferior call will
return right to our placed breakpoint address.
> And I know Jan has checked his diff on ia64, but there might be other
> architectures that have the concept of instruction bundles where jumping
> into the middle of a bundle doesn't work.
It is only important entry_point_address + bp_len is still a valid placement
for a breakpoint. ia64 will place it to the next bundle (+16 bytes) which
will work.
Still I can imagine for example big endian architecture with 32-bit fixed
lenght instructions where any opcode 0xFF?????? is a breakpoint and therefore
its gdbarch_breakpoint_from_pc returns BP_LEN as 1. But we cannot place
our breakpoint on entry_point_address + 1. Unaware if such arch exists.
My patch would break such arch. It also means the current
displaced_step_at_entry_point implementation for displaced stepping would not
work on that arch, if one would try to implemented displaced stepping there.
Thanks,
Jan
next prev parent reply other threads:[~2011-12-30 11:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-22 20:49 [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 Jan Kratochvil
2011-12-27 6:23 ` Joel Brobecker
2011-12-28 16:30 ` Jan Kratochvil
2011-12-28 18:47 ` [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #2 Jan Kratochvil
2011-12-28 20:40 ` Mark Kettenis
2011-12-30 2:45 ` [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #3 Jan Kratochvil
2011-12-30 8:46 ` Joel Brobecker
2011-12-30 11:11 ` Mark Kettenis
2011-12-30 14:16 ` Jan Kratochvil [this message]
2011-12-31 2:56 ` Peter Schauer
2011-12-30 11:25 ` Jan Kratochvil
2012-01-01 22:22 ` Jan Kratochvil
2012-01-02 2:45 ` Joel Brobecker
2012-01-02 2:58 ` Jan Kratochvil
2012-01-03 14:45 ` Regression on PowerPC (Re: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #3) Ulrich Weigand
2012-01-03 15:52 ` Joel Brobecker
2012-01-04 14:01 ` [revert] " Jan Kratochvil
2012-01-04 14:09 ` Joel Brobecker
2012-03-08 23:24 ` [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #4 [Re: [revert] Regression on PowerPC] Jan Kratochvil
2012-03-09 7:22 ` cancel: " Jan Kratochvil
2012-01-02 14:10 ` [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 Pedro Alves
2012-01-02 14:20 ` Jan Kratochvil
2012-01-02 14:44 ` Pedro Alves
2012-01-02 14:53 ` Jan Kratochvil
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=20111230112414.GB21767@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
/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