mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 09:18:09 +00:00
fix eval commit rules for strings; do not treat inputs as textual data when committing to pointers unless contents are quoted - fixes inability to change string pointer values
This commit is contained in:
@@ -431,6 +431,7 @@ type_coverage_eval_tests(void)
|
||||
char data[4];
|
||||
};
|
||||
SomeDataStructured *some_data = (SomeDataStructured *)&some_data_with_a_string[0];
|
||||
char *string_ptr = &string[0];
|
||||
|
||||
const char *const_string = "Hello, World!";
|
||||
const char const_string_array[] = "Hello, World!";
|
||||
|
||||
+12
-10
@@ -1237,10 +1237,18 @@ rd_commit_eval_value_string(E_Eval dst_eval, String8 string)
|
||||
commit_data.size = Min(commit_data.size, e_type_byte_size_from_key(type_key));
|
||||
}
|
||||
|
||||
//- rjf: determine if commit string is quoted
|
||||
B32 is_quoted = 0;
|
||||
if(string.size >= 1 && string.str[0] == '"')
|
||||
{
|
||||
string = str8_skip(string, 1);
|
||||
is_quoted = 1;
|
||||
}
|
||||
|
||||
//- rjf: pointer or array to characters/integers? -> try to treat
|
||||
// new value string as textual data
|
||||
if(!got_commit_data &&
|
||||
((type_kind == E_TypeKind_Ptr || type_kind == E_TypeKind_Array) &&
|
||||
(((is_quoted && type_kind == E_TypeKind_Ptr) || type_kind == E_TypeKind_Array) &&
|
||||
(direct_type_kind == E_TypeKind_Char8 ||
|
||||
direct_type_kind == E_TypeKind_Char16 ||
|
||||
direct_type_kind == E_TypeKind_Char32 ||
|
||||
@@ -1250,12 +1258,6 @@ rd_commit_eval_value_string(E_Eval dst_eval, String8 string)
|
||||
e_type_kind_is_integer(direct_type_kind))))
|
||||
{
|
||||
got_commit_data = 1;
|
||||
B32 is_quoted = 0;
|
||||
if(string.size >= 1 && string.str[0] == '"')
|
||||
{
|
||||
string = str8_skip(string, 1);
|
||||
is_quoted = 1;
|
||||
}
|
||||
if(string.size >= 1 && string.str[string.size-1] == '"')
|
||||
{
|
||||
string = str8_chop(string, 1);
|
||||
@@ -1306,9 +1308,9 @@ rd_commit_eval_value_string(E_Eval dst_eval, String8 string)
|
||||
src_eval_value.irtree.mode == E_Mode_Value)
|
||||
{
|
||||
got_commit_data = 1;
|
||||
commit_data = push_str8_copy(scratch.arena, str8_struct(&src_eval.value));
|
||||
commit_data.size = Min(commit_data.size, e_type_byte_size_from_key(src_eval.irtree.type_key));
|
||||
commit_data.size = Min(commit_data.size, e_type_byte_size_from_key(type_key));
|
||||
commit_data = str8_copy(scratch.arena, str8_struct(&src_eval.value));
|
||||
commit_data.size = Max(commit_data.size, e_type_byte_size_from_key(src_eval.irtree.type_key));
|
||||
commit_data.size = Max(commit_data.size, e_type_byte_size_from_key(type_key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,21 +5,24 @@
|
||||
//~ rjf: post-0.9.20 TODO notes
|
||||
//
|
||||
//- fabian complaints / reports
|
||||
// [x] `foo, x` needs to correctly match `hex(foo)`, e.g. in application to expansions
|
||||
// [ ] broadly, need to complete memory view & fix issues
|
||||
// [ ] dumb panel click-through thing
|
||||
// [ ] correct type interpretations; togglable interpretations
|
||||
// [ ] make address editable; specialized version of the cursor address editor in tab right-click menu
|
||||
// [x] eval: pointer casts of register space should promote to process space
|
||||
// [ ] simplified default layout
|
||||
// [ ] signify empty watch window "expression" slot more as a text field?
|
||||
// [ ] ambiguous parsing cases - need to re-introduce identifier resolution into eval parse. (foo *)&bar
|
||||
// [ ] more control over string visualization; specifically, when *not* to do it, even when using e.g. char *s
|
||||
// [ ] broadly, view discoverability / docs
|
||||
// [ ] memory view deserves larger spot, in default layout
|
||||
// [ ] sign bits should not display on unsigned integers?
|
||||
// [ ] fix for-loop stepping oddities, likely single-line for-loop stepping
|
||||
// [x] `foo, x` needs to correctly match `hex(foo)`, e.g. in application to expansions
|
||||
// [x] eval: pointer casts of register space should promote to process space
|
||||
// [x] more control over string visualization; specifically, when *not* to do it, even when using e.g. char *s
|
||||
// [x] sign bits should not display on unsigned integers?
|
||||
// [ ] ambiguous parsing cases - need to re-introduce identifier resolution into eval parse. (foo *)&bar
|
||||
// [ ] broadly, view discoverability / docs
|
||||
// [ ] source/disasm ctx menu should include options for e.g. "go to selected thread"
|
||||
// [ ] signify empty watch window "expression" slot more as a text field?
|
||||
//
|
||||
//- jeff viz notes
|
||||
// [ ] single-line viz for pointers w/ bad (unmapped) addresses
|
||||
//
|
||||
//- namespace/locations/variables RDI pass
|
||||
// [ ] RDI_Local, RDI_GlobalVariable, RDI_ThreadVariable -> RDI_Variable
|
||||
|
||||
Reference in New Issue
Block a user