mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 13:28:40 +00:00
only decorate debug-info-table-generated expressions with `s when we can detect it is necessary (.s are now allowed); only generate simplified expression extension strings for expressions in watch windows if parent keys are present, otherwise just do the full expression
This commit is contained in:
@@ -1661,8 +1661,19 @@ E_TYPE_EXPAND_RANGE_FUNCTION_DEF(debug_info_table)
|
|||||||
// rjf: build a valid expression string given item string
|
// rjf: build a valid expression string given item string
|
||||||
String8 item_expr = item_string;
|
String8 item_expr = item_string;
|
||||||
{
|
{
|
||||||
E_TokenArray tokens = e_token_array_from_text(scratch.arena, item_expr);
|
B32 string_can_be_evalled = 1;
|
||||||
if(tokens.count != 1)
|
E_TokenArray tokens = e_token_array_from_text(scratch.arena, item_string);
|
||||||
|
for EachIndex(idx, tokens.count)
|
||||||
|
{
|
||||||
|
String8 token_string = str8_substr(item_string, tokens.v[idx].range);
|
||||||
|
if(tokens.v[idx].kind != E_TokenKind_Identifier &&
|
||||||
|
!str8_match(token_string, str8_lit("."), 0))
|
||||||
|
{
|
||||||
|
string_can_be_evalled = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!string_can_be_evalled)
|
||||||
{
|
{
|
||||||
item_expr = push_str8f(scratch.arena, "`%S`", item_string);
|
item_expr = push_str8f(scratch.arena, "`%S`", item_string);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1716,8 +1716,11 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla
|
|||||||
expr_string = cell->eval.string;
|
expr_string = cell->eval.string;
|
||||||
|
|
||||||
// rjf: try to form a simpler expression string out of the expression tree itself, *if* this
|
// rjf: try to form a simpler expression string out of the expression tree itself, *if* this
|
||||||
// is not an editable expression, and if this evaluation was successful
|
// is not an editable expression, and if this evaluation was successful, and if this evaluation
|
||||||
if(!(block_type->flags & E_TypeFlag_EditableChildren) && cell->eval.msgs.max_kind == E_MsgKind_Null)
|
// has a parent
|
||||||
|
if(!e_key_match(cell->eval.parent_key, e_key_zero()) &&
|
||||||
|
!(block_type->flags & E_TypeFlag_EditableChildren) &&
|
||||||
|
cell->eval.msgs.max_kind == E_MsgKind_Null)
|
||||||
{
|
{
|
||||||
// rjf: first, locate a notable expression - we special-case things like member accesses
|
// rjf: first, locate a notable expression - we special-case things like member accesses
|
||||||
// or array indices, so we should grab those if possible
|
// or array indices, so we should grab those if possible
|
||||||
@@ -1740,7 +1743,7 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rjf: generate expression string based on our notable expression
|
// rjf: generate expression extension string based on our notable expression
|
||||||
switch(notable_expr->kind)
|
switch(notable_expr->kind)
|
||||||
{
|
{
|
||||||
// rjf: default case -> just take whatever string was directly passed via the evaluation
|
// rjf: default case -> just take whatever string was directly passed via the evaluation
|
||||||
|
|||||||
Reference in New Issue
Block a user