From 0254b43f1e7031a0ca9237032039b7ff6578b9ef Mon Sep 17 00:00:00 2001 From: pancake Date: Fri, 24 Jan 2025 10:04:00 +0100 Subject: [PATCH] Enable dbg.hwbp on macOS-arm64 (not just x64) ##debug --- libr/core/cconfig.c | 4 ++-- libr/core/cmd_debug.inc.c | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libr/core/cconfig.c b/libr/core/cconfig.c index 1e1759e8f815a..d9ad378bc89b8 100644 --- a/libr/core/cconfig.c +++ b/libr/core/cconfig.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2024 - pancake */ +/* radare - LGPL - Copyright 2009-2025 - pancake */ #include #include @@ -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"); diff --git a/libr/core/cmd_debug.inc.c b/libr/core/cmd_debug.inc.c index 3f3234c35003d..d569e59c6d132 100644 --- a/libr/core/cmd_debug.inc.c +++ b/libr/core/cmd_debug.inc.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2024 - pancake */ +/* radare - LGPL - Copyright 2009-2025 - pancake */ #if R_INCLUDE_BEGIN @@ -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; @@ -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"); @@ -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 (" "); } @@ -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); }