mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-21 12:48:36 +00:00
Fixed breakpoint infinete loop error (#10410)
This commit is contained in:
parent
2153021aea
commit
b643095d1f
@ -93,6 +93,40 @@ static int r_debug_bp_hit(RDebug *dbg, RRegItem *pc_ri, ut64 pc, RBreakpointItem
|
||||
# else
|
||||
int pc_off = dbg->bpsize;
|
||||
/* see if we really have a breakpoint here... */
|
||||
if (!dbg->pc_at_bp_set) {
|
||||
b = r_bp_get_at (dbg->bp, pc - dbg->bpsize);
|
||||
if (!b) { /* we don't. nothing left to do */
|
||||
/* Some targets set pc to breakpoint */
|
||||
b = r_bp_get_at (dbg->bp, pc);
|
||||
if (!b) {
|
||||
/* Couldn't find the break point. Nothing more to do... */
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
dbg->pc_at_bp_set = true;
|
||||
dbg->pc_at_bp = true;
|
||||
}
|
||||
} else {
|
||||
dbg->pc_at_bp_set = true;
|
||||
dbg->pc_at_bp = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dbg->pc_at_bp_set) {
|
||||
eprintf ("failed to determine position of pc after breakpoint");
|
||||
}
|
||||
|
||||
if (dbg->pc_at_bp) {
|
||||
pc_off = 0;
|
||||
b = r_bp_get_at (dbg->bp, pc);
|
||||
} else {
|
||||
b = r_bp_get_at (dbg->bp, pc - dbg->bpsize);
|
||||
}
|
||||
|
||||
if (!b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
b = r_bp_get_at (dbg->bp, pc - dbg->bpsize);
|
||||
if (!b) { /* we don't. nothing left to do */
|
||||
/* Some targets set pc to breakpoint */
|
||||
|
@ -298,6 +298,9 @@ typedef struct r_debug_t {
|
||||
struct r_debug_plugin_t *h;
|
||||
RList *plugins;
|
||||
|
||||
bool pc_at_bp; /* after a breakpoint, is the pc at the bp? */
|
||||
bool pc_at_bp_set; /* is the pc_at_bp variable set already? */
|
||||
|
||||
RAnal *anal;
|
||||
RList *maps; // <RDebugMap>
|
||||
RList *maps_user; // <RDebugMap>
|
||||
|
Loading…
Reference in New Issue
Block a user