From b47b22bdce2ba657aab7477bd4fa8b38eac16551 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Thu, 13 Jun 2024 15:04:12 -0700 Subject: [PATCH] correct thread -> src mapping, given inline info --- src/df/core/df_core.c | 2 +- src/df/gfx/df_views.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/df/core/df_core.c b/src/df/core/df_core.c index a2b09bcf..47affbc6 100644 --- a/src/df/core/df_core.c +++ b/src/df/core/df_core.c @@ -3333,7 +3333,7 @@ df_text_line_dasm2src_info_from_dbgi_key_voff(DI_Key *dbgi_key, U64 voff, U64 in { U64 idx = 0; for(RDI_Scope *s = scope; - s->inline_site_idx != 0 && idx < inline_unwind_idx; + s->inline_site_idx != 0 && idx <= inline_unwind_idx; s = rdi_element_from_name_idx(rdi, Scopes, s->parent_scope_idx), idx += 1) { if(idx == inline_unwind_idx) diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index cd329b61..9df21f5b 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -5957,13 +5957,14 @@ DF_VIEW_UI_FUNCTION_DEF(Code) { DF_Entity *thread = thread_n->entity; DF_Entity *process = df_entity_ancestor_from_kind(thread, DF_EntityKind_Process); - U64 unwind_count = (thread == selected_thread) ? ctrl_ctx.unwind_count : 0; + U64 base_unwind_count = (thread == selected_thread) ? ctrl_ctx.unwind_count : 0; + U64 inline_unwind_count = (thread == selected_thread) ? ctrl_ctx.inline_unwind_count : 0; U64 rip_vaddr = df_query_cached_rip_from_thread_unwind(thread, unwind_count); U64 last_inst_on_unwound_rip_vaddr = rip_vaddr - !!unwind_count; DF_Entity *module = df_module_from_process_vaddr(process, last_inst_on_unwound_rip_vaddr); U64 rip_voff = df_voff_from_vaddr(module, last_inst_on_unwound_rip_vaddr); DI_Key dbgi_key = df_dbgi_key_from_module(module); - DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff, 0); + DF_TextLineDasm2SrcInfo dasm2src_info = df_text_line_dasm2src_info_from_dbgi_key_voff(&dbgi_key, rip_voff, inline_unwind_count); if(dasm2src_info.file == entity && visible_line_num_range.min <= dasm2src_info.pt.line && dasm2src_info.pt.line <= visible_line_num_range.max) { U64 slice_line_idx = dasm2src_info.pt.line-visible_line_num_range.min;