Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Andrea Corallo via gdb-patches" <gdb-patches@sourceware.org>
To: GDB Patches <gdb-patches@sourceware.org>
Subject: [PATCH] sim: microblaze: breakpoint inst check + a couple of questions
Date: Sat, 03 Jun 2017 11:00:00 -0000	[thread overview]
Message-ID: <295196608.1570236.1496487588855@mail.yahoo.com> (raw)
In-Reply-To: <295196608.1570236.1496487588855.ref@mail.yahoo.com>

I have couple of questions related to microblaze debugging and its simulator:

When gdb add a breakpoint writes to memory the following word 0xb9cc0060, this is defined in gdb/microblaze-tdep.h:120

/* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used.
Only used for native debugging.  */
#define MICROBLAZE_BREAKPOINT {0xb9, 0xcc, 0x00, 0x60}

This brki instruction cause the cpu to jump to 0x60
I guess this is because there is supposed to start a monitor program in some configuration correct?
Because the simulator is not expecting any monitor program wouldn't be more appropriate to use hardware breakpoints instead?

The other question is: the simulator is checking against the presence of a brk instruction but not brki making gdb not stopping on the breakpoint just inserted.
Would make sense to check against both as in the following patch?

sim/microblaze/ChangeLog:
2017-06-01  Andrea Corallo  <andrea_corallo@yahoo.it>

* interp.c (sim_engine_run): check also for breakpoint instruction brki.
---
sim/microblaze/interp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c
index 75fc98b..d094a69 100644
--- a/sim/microblaze/interp.c
+++ b/sim/microblaze/interp.c
@@ -161,7 +161,7 @@ sim_engine_run (SIM_DESC sd,
oldpc = PC;
delay_slot_enable = 0;
branch_taken = 0;
-      if (op == microblaze_brk)
+      if (op == microblaze_brk || op == brki)
sim_engine_halt (sd, NULL, NULL, NULL_CIA, sim_stopped, SIM_SIGTRAP);
else if (inst == MICROBLAZE_HALT_INST)
{


       reply	other threads:[~2017-06-03 11:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <295196608.1570236.1496487588855.ref@mail.yahoo.com>
2017-06-03 11:00 ` Andrea Corallo via gdb-patches [this message]
2017-06-03 19:18   ` Michael Eager
2017-06-04  8:14     ` Andrea Corallo via gdb-patches
2017-06-07  6:19       ` Andrea Corallo via gdb-patches
2017-06-07 16:54       ` Michael Eager
2021-02-01  3:04         ` Mike Frysinger via Gdb-patches

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=295196608.1570236.1496487588855@mail.yahoo.com \
    --to=gdb-patches@sourceware.org \
    --cc=andrea_corallo@yahoo.it \
    /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