From: Joel Brobecker <brobecker@adacore.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/commit] ia64: incorrect breakpoint save/restore with L-type instruction at slot 1
Date: Tue, 29 Sep 2009 00:16:00 -0000 [thread overview]
Message-ID: <20090929001641.GH9003@adacore.com> (raw)
In-Reply-To: <20090926215709.GA26221@host0.dyn.jankratochvil.net>
> b *(0x4000000000000691 + 1)
> Breakpoint 5 at 0x4000000000000692: file ./gdb.base/breakpoint-shadow.c, line 28.
> ia64-tdep.c:672: internal-error: Address 0x4000000000000692 already contains a breakpoint.
> +
> 0x4000000000000690 <main+16>: [MLX] st8.rel [r2]=r14
> 0x4000000000000691 <main+17>: movl r14=0x7fffffff;;
> ->
> 0x4000000000000690 <main+16>: [MLX] data8 0x1fe8dc021c0
> 0x4000000000000691 <main+17>: data8 0x0cfffefe3
Yeah, good catch. The only comment I had on the patch is that
it doesn't error out while trying to insert the breakpoint in
the normal case where "breakpoint always-inserted" is off. Instead,
it errors out while trying to resume the execution of the inferior,
and the breakpoint prevents us from continuing until the breakpoint
is either removed or deleted. I don't think we really have any
mechanism in place at the moment that would allow us to catch
the problem early. But your patch already improves the situation.
So I checked it in both HEAD and branch (I want to add some comments
as discussed on IRC).
Given that this only occurs when either: debugging info points
to the wrong address, or when the user specifically indicates slot
2 of an L+X instruction as the address of the breakpoint, I consider
this as a non-problem.
> gdb/testsuite/
> 2009-09-26 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * gdb.base/breakpoint-shadow.c (main): Change `int i' type to `long l'.
> Use wider value for the second initialization.
> * gdb.base/breakpoint-shadow.exp <ia64>: Fix TCL error on missing
> bpt2address value. Require now $bpt2address to be at slot 1. Move
> "Third breakpoint" from slot 2 to slot 0. New test `Slot X breakpoint
> refusal'.
You found an astute solution to provoking the situation.
However, even if the logical way of storing the new value for our long
is to use an L+X instruction on ia64, I am wondering if we wouldn't be
better off building our executable from assembly instead of from source,
the way we do in gdb.arch. That way, we would know for sure in which
slot each breakpoint is inserted and what type of instruction we have
underneath. We can also make sure we test all sort of combinations.
I wanted to write a testcase when I initially submitted my own patch,
but I couldn't work from my Ada example, because Ada programs usually
require the Ada Runtime.
What do you think? I've held the testsuite patch for now, because
the comment in breakpoint-shadow.c is a little confusing, and
the following comment in breakpoint-shadow.exp becomes a little
outdated:
# Unoptimized code should not use the 3rd slot for the first instruction of
# a source line. This is important for our test, because we want both
# breakpoints ("Second breakpoint" and the following one) to be in the same
# bundle.
If we go for the gdb.arch approach, we can then remove the who section
specific to ia64 from breakpoint-shadow.exp.
--
Joel
next prev parent reply other threads:[~2009-09-29 0:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-25 20:48 Joel Brobecker
2009-09-26 21:57 ` Jan Kratochvil
2009-09-29 0:16 ` Joel Brobecker [this message]
2009-09-29 1:31 ` Joel Brobecker
2009-09-29 18:55 ` Jan Kratochvil
2009-09-29 19:14 ` Joel Brobecker
2009-09-29 19:29 ` Jan Kratochvil
2009-09-29 0:00 ` Joel Brobecker
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=20090929001641.GH9003@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.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