From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Add mips_software_single_step
Date: Wed, 04 Jul 2001 11:56:00 -0000 [thread overview]
Message-ID: <20010704115630.A16310@nevyn.them.org> (raw)
This function's pretty straightforward; the Linux port uses it. Ok to
commit?
I've been tempted to redo this more like the Sparc's version, in which we
set breakpoints at all possible destinations rather than at the calculated
next destination. But I think that with the previously posted patch, I
trust mips_next_pc enough to leave it this way.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2001-07-04 Daniel Jacobowitz <drow@mvista.com>
* mips-tdep.c (mips_software_single_step): New function.
Index: gdb/mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.54
diff -u -r1.54 mips-tdep.c
--- mips-tdep.c 2001/06/16 20:00:24 1.54
+++ mips-tdep.c 2001/07/04 18:15:03
@@ -1379,6 +1392,35 @@
return addr;
}
+/* mips_software_single_step() is called just before we want to resume
+ the inferior, if we want to single-step it but there is no hardware
+ or kernel single-step support (MIPS on Linux for example). We find
+ the target of the coming instruction and breakpoint it.
+
+ single_step is also called just after the inferior stops. If we had
+ set up a simulated single-step, we undo our damage. */
+
+void
+mips_software_single_step (signal, insert_breakpoints_p)
+ unsigned int signal;
+ int insert_breakpoints_p;
+{
+ static CORE_ADDR next_pc;
+ typedef char binsn_quantum[BREAKPOINT_MAX];
+ static binsn_quantum break_mem;
+ CORE_ADDR pc;
+
+ if (insert_breakpoints_p)
+ {
+ pc = read_register (PC_REGNUM);
+ next_pc = mips_next_pc (pc);
+
+ target_insert_breakpoint (next_pc, break_mem);
+ }
+ else
+ target_remove_breakpoint (next_pc, break_mem);
+}
+
static void
mips_init_frame_pc_first (int fromleaf, struct frame_info *prev)
{
next reply other threads:[~2001-07-04 11:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-04 11:56 Daniel Jacobowitz [this message]
2001-07-05 14:50 ` Andrew Cagney
2001-07-05 15:05 ` Daniel Jacobowitz
2001-07-05 15:50 ` Andrew Cagney
2001-07-05 16:10 ` Daniel Jacobowitz
2001-07-05 16:24 ` Andrew Cagney
2001-07-05 16:31 ` Daniel Jacobowitz
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=20010704115630.A16310@nevyn.them.org \
--to=dmj+@andrew.cmu.edu \
--cc=gdb-patches@sources.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