Skip to content

Commit 58cc46d

Browse files
[release/9.0-staging] [mono][debugger] Fix assertion when stepping (#118459)
* Fix assertion when stepping * Backport of #118542 --------- Co-authored-by: Thays Grazia <[email protected]>
1 parent a10b790 commit 58cc46d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/mono/mono/mini/mini-arm64.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4204,7 +4204,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
42044204

42054205
arm_ldrx (code, ARMREG_IP1, info_var->inst_basereg, GTMREG_TO_INT (info_var->inst_offset));
42064206
/* Add the bp_tramp_offset */
4207-
val = ((bp_tramp_offset / 4) * sizeof (target_mgreg_t)) + MONO_STRUCT_OFFSET (SeqPointInfo, bp_addrs);
4207+
val = (bp_tramp_offset * sizeof (target_mgreg_t)) + MONO_STRUCT_OFFSET (SeqPointInfo, bp_addrs);
42084208
/* Load the info->bp_addrs [bp_tramp_offset], which is either 0 or the address of the bp trampoline */
42094209
code = emit_ldrx (code, ARMREG_IP1, ARMREG_IP1, val);
42104210
/* Skip the load if its 0 */
@@ -6873,9 +6873,7 @@ mono_arch_set_breakpoint (MonoJitInfo *ji, guint8 *ip)
68736873

68746874
if (enable_ptrauth)
68756875
NOT_IMPLEMENTED;
6876-
g_assert (native_offset % 4 == 0);
6877-
g_assert (info->bp_addrs [native_offset / 4] == 0);
6878-
info->bp_addrs [native_offset / 4] = (guint8*)mini_get_breakpoint_trampoline ();
6876+
info->bp_addrs [native_offset] = (guint8*)mini_get_breakpoint_trampoline ();
68796877
} else {
68806878
/* ip points to an ldrx */
68816879
code += 4;
@@ -6898,8 +6896,7 @@ mono_arch_clear_breakpoint (MonoJitInfo *ji, guint8 *ip)
68986896
if (enable_ptrauth)
68996897
NOT_IMPLEMENTED;
69006898

6901-
g_assert (native_offset % 4 == 0);
6902-
info->bp_addrs [native_offset / 4] = NULL;
6899+
info->bp_addrs [native_offset] = NULL;
69036900
} else {
69046901
/* ip points to an ldrx */
69056902
code += 4;
@@ -6967,7 +6964,7 @@ mono_arch_get_seq_point_info (guint8 *code)
69676964
ji = mini_jit_info_table_find (code);
69686965
g_assert (ji);
69696966

6970-
info = g_malloc0 (sizeof (SeqPointInfo) + (ji->code_size / 4) * sizeof(guint8*));
6967+
info = g_malloc0 (sizeof (SeqPointInfo) + (ji->code_size) * sizeof(guint8*));
69716968

69726969
info->ss_tramp_addr = &ss_trampoline;
69736970

0 commit comments

Comments
 (0)