From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz)
Cc: emi-suzuki@tjsys.co.jp (Emi SUZUKI),
jan.kratochvil@redhat.com, luisgpm@linux.vnet.ibm.com,
gdb-patches@sourceware.org
Subject: Re: [RFC] "single step" atomic instruction sequences as a whole on PPC
Date: Thu, 10 May 2007 22:58:00 -0000 [thread overview]
Message-ID: <200705102258.l4AMwSF4026578@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20070510213624.GA2822@caradoc.them.org> from "Daniel Jacobowitz" at May 10, 2007 05:36:24 PM
Daniel Jacobowitz wrote:
> On Thu, May 10, 2007 at 11:30:53PM +0200, Ulrich Weigand wrote:
> > This looks just like a problem we fixed for the combined debugger;
> > cancel_breakpoints_callback should cancel SIGTRAP events caused by
> > software single-step breakpoints just the same as those caused by
> > other breakpoints.
>
> Maybe it would be more elegant to anticipate the day that single step
> breakpoints are completely normal: make breakpoint_inserted_here_p
> check them? This is already the only caller.
Good point. Something like the patch below? I've also added the
check to software_breakpoint_inserted_here_p; that seemed to make
more sense that not.
(I'm suspicious about adjust_pc_after_break, the only caller of
software_breakpoint_inserted_here_p anyway; I think this may no
longer be correct after the software single-step changes ...)
Bye,
Ulrich
ChangeLog:
* breakpoint.c (single_step_breakpoint_inserted_here_p): New function.
(breakpoint_inserted_here_p): Call it.
(software_breakpoint_inserted_here_p): Likewise.
diff -urNp gdb-orig/gdb/breakpoint.c gdb-head/gdb/breakpoint.c
--- gdb-orig/gdb/breakpoint.c 2007-05-11 00:15:25.160082872 +0200
+++ gdb-head/gdb/breakpoint.c 2007-05-11 00:22:39.846579732 +0200
@@ -202,6 +202,8 @@ static void tcatch_command (char *arg, i
static void ep_skip_leading_whitespace (char **s);
+static int single_step_breakpoint_inserted_here_p (CORE_ADDR pc);
+
/* Prototypes for exported functions. */
/* If FALSE, gdb will not use hardware support for watchpoints, even
@@ -1841,6 +1843,10 @@ breakpoint_inserted_here_p (CORE_ADDR pc
}
}
+ /* Also check for software single-step breakpoints. */
+ if (single_step_breakpoint_inserted_here_p (pc))
+ return 1;
+
return 0;
}
@@ -1872,6 +1878,10 @@ software_breakpoint_inserted_here_p (COR
}
}
+ /* Also check for software single-step breakpoints. */
+ if (single_step_breakpoint_inserted_here_p (pc))
+ return 1;
+
return 0;
}
@@ -7951,6 +7961,23 @@ remove_single_step_breakpoints (void)
}
}
+/* Check whether a software single-step breakpoint is inserted at PC. */
+
+static int
+single_step_breakpoint_inserted_here_p (CORE_ADDR pc)
+{
+ int i;
+
+ for (i = 0; i < 2; i++)
+ {
+ struct bp_target_info *bp_tgt = single_step_breakpoints[i];
+ if (bp_tgt && bp_tgt->placed_address == pc)
+ return 1;
+ }
+
+ return 0;
+}
+
\f
/* This help string is used for the break, hbreak, tbreak and thbreak commands.
It is defined as a macro to prevent duplication.
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2007-05-10 22:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1177964763.15264.45.camel@localhost>
2007-05-02 14:08 ` uweigand
2007-05-03 14:51 ` Luis Machado
2007-05-06 21:20 ` Ulrich Weigand
2007-05-07 15:14 ` Luis Machado
2007-05-07 18:11 ` Ulrich Weigand
2007-05-07 19:28 ` Luis Machado
2007-05-07 22:47 ` Ulrich Weigand
2007-05-07 23:23 ` Luis Machado
2007-05-08 12:50 ` Ulrich Weigand
2007-05-09 14:33 ` Ulrich Weigand
2007-05-09 18:05 ` Luis Machado
2007-05-09 18:12 ` Daniel Jacobowitz
2007-05-09 18:21 ` Luis Machado
2007-05-09 18:34 ` Jan Kratochvil
2007-05-09 18:46 ` Daniel Jacobowitz
2007-05-09 19:10 ` Ulrich Weigand
2007-05-09 19:14 ` Luis Machado
2007-05-10 10:57 ` Emi SUZUKI
2007-05-10 21:31 ` Ulrich Weigand
2007-05-10 21:36 ` Daniel Jacobowitz
2007-05-10 22:58 ` Ulrich Weigand [this message]
2007-05-10 23:25 ` Daniel Jacobowitz
2007-05-11 7:34 ` Emi SUZUKI
2007-05-11 12:46 ` Ulrich Weigand
2007-05-09 19:45 ` Ulrich Weigand
2007-05-10 0:48 ` Luis Machado
2007-05-10 20:29 ` Ulrich Weigand
2007-04-09 2:13 Patch for gdb build on hppa hp-ux Daniel Jacobowitz
2007-04-09 23:25 ` Steve Ellcey
2007-04-10 12:05 ` Daniel Jacobowitz
2007-04-10 19:03 ` Eli Zaretskii
2007-04-10 20:22 ` Daniel Jacobowitz
2007-04-13 14:04 ` Daniel Jacobowitz
2007-04-13 17:07 ` [patch] "single step" atomic instruction sequences as a whole on PPC Luis Machado
2007-04-28 23:34 ` [RFC] " Luis Machado
2007-04-28 23:45 ` Ulrich Weigand
2007-04-29 1:53 ` Luis Machado
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=200705102258.l4AMwSF4026578@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=drow@false.org \
--cc=emi-suzuki@tjsys.co.jp \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=luisgpm@linux.vnet.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