Skip to content

Commit

Permalink
Enable dbg.hwbp on macOS-arm64 (not just x64) ##debug
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jan 24, 2025
1 parent 3027141 commit 0254b43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libr/core/cconfig.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2009-2024 - pancake */
/* radare - LGPL - Copyright 2009-2025 - pancake */

#include <r_core.h>
#include <r_types_base.h>
Expand Down Expand Up @@ -4124,7 +4124,7 @@ R_API int r_core_config_init(RCore *core) {
SETCB ("dbg.wrap", "false", &cb_dbg_wrap, "enable the ptrace-wrap abstraction layer (needed for debugging from iaito)");
SETCB ("dbg.libs", "", &cb_dbg_libs, "If set stop when loading matching libname");
SETBPREF ("dbg.skipover", "false", "make dso perform a dss (same goes for esil and visual/graph");
#if __APPLE__ && __x86_64__
#if __APPLE__
SETBPREF ("dbg.hwbp", "true", "use hardware breakpoints instead of software ones when enabled");
#else
SETBPREF ("dbg.hwbp", "false", "use hardware breakpoints instead of software ones when enabled");
Expand Down
9 changes: 6 additions & 3 deletions libr/core/cmd_debug.inc.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2009-2024 - pancake */
/* radare - LGPL - Copyright 2009-2025 - pancake */

#if R_INCLUDE_BEGIN

Expand Down Expand Up @@ -2092,6 +2092,7 @@ static bool regcb(void *u, const ut64 k, const void *v) {
}

R_API void r_core_debug_ri(RCore *core, RReg *reg, int mode) {
R_RETURN_IF_FAIL (core && reg);
RList *list = r_reg_get_list (reg, R_REG_TYPE_GPR);
RListIter *iter;
RRegItem *r;
Expand Down Expand Up @@ -2155,6 +2156,7 @@ static const char *mode_to_bitstr(int mode) {
}

R_API void r_core_debug_rr(RCore *core, RReg *reg, int mode) {
R_RETURN_IF_FAIL (core && reg);
char *color = "";
char *colorend = "";
const int scr_color = r_config_get_i (core->config, "scr.color");
Expand Down Expand Up @@ -4127,7 +4129,9 @@ static void trace_traverse_pre(RTreeNode *n, RTreeVisitor *vis) {
const char *name = "";
struct trace_node *tn = n->data;
unsigned int i;
if (!tn) return;
if (!tn) {
return;
}
for (i = 0; i < n->depth - 1; i++) {
r_cons_printf (" ");
}
Expand Down Expand Up @@ -4530,7 +4534,6 @@ static bool is_x86_ret(RDebug *dbg, ut64 addr) {
}

static ut64 getnum(RCore *core, const char *a) {
eprintf ("a (%s)\n", a);
if (r_str_startswith (a, "..")) {
return r_num_tail (core->num, core->offset, a + 2);
}
Expand Down

0 comments on commit 0254b43

Please sign in to comment.