mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 17:28:07 +00:00
finish addresses-before-content single-line eval visualization path
This commit is contained in:
@@ -1813,6 +1813,7 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
|||||||
B32 did_prefix_string;
|
B32 did_prefix_string;
|
||||||
B32 did_redirect;
|
B32 did_redirect;
|
||||||
B32 did_pre_prefix_ptr;
|
B32 did_pre_prefix_ptr;
|
||||||
|
B32 addr_is_good;
|
||||||
};
|
};
|
||||||
EV_StringPtrData *ptr_data = it->top_task->user_data;
|
EV_StringPtrData *ptr_data = it->top_task->user_data;
|
||||||
if(ptr_data == 0)
|
if(ptr_data == 0)
|
||||||
@@ -1825,6 +1826,13 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
|||||||
ptr_data->ptee_has_string = ((E_TypeKind_Char8 <= ptr_data->direct_type->kind && ptr_data->direct_type->kind <= E_TypeKind_UChar32) ||
|
ptr_data->ptee_has_string = ((E_TypeKind_Char8 <= ptr_data->direct_type->kind && ptr_data->direct_type->kind <= E_TypeKind_UChar32) ||
|
||||||
ptr_data->direct_type->kind == E_TypeKind_S8 ||
|
ptr_data->direct_type->kind == E_TypeKind_S8 ||
|
||||||
ptr_data->direct_type->kind == E_TypeKind_U8);
|
ptr_data->direct_type->kind == E_TypeKind_U8);
|
||||||
|
U8 byte = 0;
|
||||||
|
U64 byte_bad_flags = 0;
|
||||||
|
E_SpaceRangeInfo range_info = {.byte_bad_flags = &byte_bad_flags};
|
||||||
|
if(e_space_read(ptr_data->value_eval.space, &byte, &range_info, r1u64(ptr_data->value_eval.value.u64, ptr_data->value_eval.value.u64+1)))
|
||||||
|
{
|
||||||
|
ptr_data->addr_is_good = !(byte_bad_flags & 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(ptr_data->did_redirect)
|
if(ptr_data->did_redirect)
|
||||||
{
|
{
|
||||||
@@ -1837,13 +1845,22 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
|||||||
//- rjf: step 0: do pre-prefix pointer value if requested
|
//- rjf: step 0: do pre-prefix pointer value if requested
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
if(!(params->flags & EV_StringFlag_DisableAddresses) &&
|
if(!ptr_data->addr_is_good ||
|
||||||
params->flags & EV_StringFlag_AddressesBeforeContent)
|
(!(params->flags & EV_StringFlag_DisableAddresses) &&
|
||||||
|
params->flags & EV_StringFlag_AddressesBeforeContent))
|
||||||
{
|
{
|
||||||
*out_string = str8_from_u64(arena, ptr_data->value_eval.value.u64, 16, 0, 0);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
ptr_data->did_pre_prefix_ptr = 1;
|
String8 ptr_value_string = str8_from_u64(scratch.arena, ptr_data->value_eval.value.u64,
|
||||||
|
ptr_data->value_eval.value.u64 != 0 ? 16 : 10, 0, 0);
|
||||||
|
if(ptr_data->value_eval.value.u64 != 0 && !ptr_data->addr_is_good && params->flags & EV_StringFlag_ReadOnlyDisplayRules)
|
||||||
|
{
|
||||||
|
ptr_value_string = str8f(scratch.arena, "%S (unmapped)", ptr_value_string);
|
||||||
}
|
}
|
||||||
need_pop = 0;
|
*out_string = str8_copy(arena, ptr_value_string);
|
||||||
|
ptr_data->did_pre_prefix_ptr = 1;
|
||||||
|
scratch_end(scratch);
|
||||||
|
}
|
||||||
|
need_pop = !ptr_data->addr_is_good;
|
||||||
}break;
|
}break;
|
||||||
|
|
||||||
//- rjf: step 1 -> try "prefix content", which we want to print before the pointer value,
|
//- rjf: step 1 -> try "prefix content", which we want to print before the pointer value,
|
||||||
@@ -2005,6 +2022,7 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
|||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
String8List list = {0};
|
String8List list = {0};
|
||||||
|
str8_list_push(scratch.arena, &list, pre_prefix);
|
||||||
str8_list_pushf(scratch.arena, &list, "[inlined] ");
|
str8_list_pushf(scratch.arena, &list, "[inlined] ");
|
||||||
e_type_lhs_string_from_key(scratch.arena, type, &list, 0, 0);
|
e_type_lhs_string_from_key(scratch.arena, type, &list, 0, 0);
|
||||||
str8_list_push(scratch.arena, &list, name);
|
str8_list_push(scratch.arena, &list, name);
|
||||||
@@ -2040,7 +2058,7 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
|||||||
String8 joined = str8_list_join(scratch.arena, &list, 0);
|
String8 joined = str8_list_join(scratch.arena, &list, 0);
|
||||||
*out_string = str8f(arena, "%S%S", pre_prefix, joined);
|
*out_string = str8f(arena, "%S%S", pre_prefix, joined);
|
||||||
}
|
}
|
||||||
else
|
else if(name.size != 0)
|
||||||
{
|
{
|
||||||
*out_string = str8f(arena, "%S%S", pre_prefix, name);
|
*out_string = str8f(arena, "%S%S", pre_prefix, name);
|
||||||
}
|
}
|
||||||
@@ -2068,8 +2086,10 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
|||||||
RDI_Symbol *procedure = rdi_procedure_from_scope(rdi, scope);
|
RDI_Symbol *procedure = rdi_procedure_from_scope(rdi, scope);
|
||||||
String8 procedure_name = {0};
|
String8 procedure_name = {0};
|
||||||
procedure_name.str = rdi_name_from_procedure(rdi, procedure, &procedure_name.size);
|
procedure_name.str = rdi_name_from_procedure(rdi, procedure, &procedure_name.size);
|
||||||
|
if(procedure_name.size != 0)
|
||||||
|
{
|
||||||
*out_string = str8f(arena, "%S%S", pre_prefix, procedure_name);
|
*out_string = str8f(arena, "%S%S", pre_prefix, procedure_name);
|
||||||
|
}
|
||||||
good_symbol_match = (procedure_name.size != 0);
|
good_symbol_match = (procedure_name.size != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2106,22 +2126,11 @@ ev_string_iter_next(Arena *arena, EV_StringIter *it, String8 *out_string)
|
|||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
Temp scratch = scratch_begin(&arena, 1);
|
Temp scratch = scratch_begin(&arena, 1);
|
||||||
String8 ptr_value_string = str8_from_u64(scratch.arena, ptr_data->value_eval.value.u64, 16, 0, 0);
|
String8 ptr_value_string = str8_from_u64(scratch.arena, ptr_data->value_eval.value.u64, ptr_data->value_eval.value.u64 != 0 ? 16 : 10, 0, 0);
|
||||||
if(params->flags & EV_StringFlag_ReadOnlyDisplayRules)
|
if(params->flags & EV_StringFlag_ReadOnlyDisplayRules && ptr_data->value_eval.value.u64 != 0 && !ptr_data->addr_is_good)
|
||||||
{
|
|
||||||
U8 byte = 0;
|
|
||||||
B32 addr_is_good = 0;
|
|
||||||
U64 byte_bad_flags = 0;
|
|
||||||
E_SpaceRangeInfo range_info = {.byte_bad_flags = &byte_bad_flags};
|
|
||||||
if(e_space_read(ptr_data->value_eval.space, &byte, &range_info, r1u64(ptr_data->value_eval.value.u64, ptr_data->value_eval.value.u64+1)))
|
|
||||||
{
|
|
||||||
addr_is_good = !(byte_bad_flags & 1);
|
|
||||||
}
|
|
||||||
if(!addr_is_good)
|
|
||||||
{
|
{
|
||||||
ptr_value_string = str8f(scratch.arena, "%S (unmapped)", ptr_value_string);
|
ptr_value_string = str8f(scratch.arena, "%S (unmapped)", ptr_value_string);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// NOTE(rjf): currently, we are not using the string-generation radix parameter when
|
// NOTE(rjf): currently, we are not using the string-generation radix parameter when
|
||||||
// generating a pointer value - it is weird to want to change pointer value visualization
|
// generating a pointer value - it is weird to want to change pointer value visualization
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
// [ ] external window focusing bugs
|
// [ ] external window focusing bugs
|
||||||
//
|
//
|
||||||
// [ ] PDB -> RDI conversion memory usage
|
// [ ] PDB -> RDI conversion memory usage
|
||||||
//
|
|
||||||
// [ ] more things should move to user data, but project-tagged - like
|
// [ ] more things should move to user data, but project-tagged - like
|
||||||
// recent files, watches?, etc.
|
// recent files, watches?, etc.
|
||||||
//
|
//
|
||||||
@@ -22,7 +21,6 @@
|
|||||||
//
|
//
|
||||||
// [ ] many threads hitting conditional breakpoints -> causes 0x8000003 exception!
|
// [ ] many threads hitting conditional breakpoints -> causes 0x8000003 exception!
|
||||||
// [ ] string conditional breakpoints -> size != 0 check seems to fail, can test w/ "rd_init" subprogram type gen in d2r2
|
// [ ] string conditional breakpoints -> size != 0 check seems to fail, can test w/ "rd_init" subprogram type gen in d2r2
|
||||||
// [ ] no selected thread -> causing evaluation failures, e.g. with go-to-definition
|
|
||||||
//
|
//
|
||||||
//- evaluation space coverage pass
|
//- evaluation space coverage pass
|
||||||
// [ ] need concrete ways of referring into a space at any offset - e.g. `process.memory + 0x1234`, `file:"foo".data + 0x1234`, `thread.regs + 0x80`, etc.
|
// [ ] need concrete ways of referring into a space at any offset - e.g. `process.memory + 0x1234`, `file:"foo".data + 0x1234`, `thread.regs + 0x80`, etc.
|
||||||
@@ -46,7 +44,6 @@
|
|||||||
//
|
//
|
||||||
//- jeff notes
|
//- jeff notes
|
||||||
// [ ] focus changing on f10/f11? may be related to auto_run/auto_step - look at a bin/jeffr
|
// [ ] focus changing on f10/f11? may be related to auto_run/auto_step - look at a bin/jeffr
|
||||||
// [ ] single-line viz for pointers w/ bad (unmapped) addresses
|
|
||||||
// [ ] option to prefer addresses first with string ptrs
|
// [ ] option to prefer addresses first with string ptrs
|
||||||
//
|
//
|
||||||
//- urgent fixes
|
//- urgent fixes
|
||||||
@@ -270,6 +267,8 @@
|
|||||||
// [x] memory view mutation controls
|
// [x] memory view mutation controls
|
||||||
// [x] step-over/step-into doesn't step successfully in many cases, just causes a continue
|
// [x] step-over/step-into doesn't step successfully in many cases, just causes a continue
|
||||||
// [x] eval space reads/writes -> needs staleness/badness info - replace ctrl layer, to apply to all spaces
|
// [x] eval space reads/writes -> needs staleness/badness info - replace ctrl layer, to apply to all spaces
|
||||||
|
// [x] no selected thread -> causing evaluation failures, e.g. with go-to-definition
|
||||||
|
// [x] single-line viz for pointers w/ bad (unmapped) addresses
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Build Options
|
//~ rjf: Build Options
|
||||||
|
|||||||
Reference in New Issue
Block a user