adjust memory reads from cfg spaces to evaluating the cfg strings, rather than directly interpreting them as leaves

This commit is contained in:
Ryan Fleury
2025-04-14 14:52:46 -07:00
parent cbc44cd9e4
commit 8e13f8162a
5 changed files with 15 additions and 11 deletions
+3 -2
View File
@@ -4,7 +4,7 @@
//- GENERATED CODE
C_LINKAGE_BEGIN
RD_VocabInfo rd_vocab_info_table[314] =
RD_VocabInfo rd_vocab_info_table[315] =
{
{str8_lit_comp("auto_view_rule"), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rule"), str8_lit_comp("Auto View Rules"), RD_IconKind_Binoculars},
{str8_lit_comp("file_path_map"), str8_lit_comp("file_path_maps"), str8_lit_comp("File Path Map"), str8_lit_comp("File Path Maps"), RD_IconKind_FileOutline},
@@ -97,6 +97,7 @@ RD_VocabInfo rd_vocab_info_table[314] =
{str8_lit_comp("show_line_numbers"), str8_lit_comp(""), str8_lit_comp("Show Line Numbers"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("syntax"), str8_lit_comp("syntaxes"), str8_lit_comp("Syntax"), str8_lit_comp("Syntaxes"), RD_IconKind_Null},
{str8_lit_comp("num_columns"), str8_lit_comp(""), str8_lit_comp("Number of Columns"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("bytes_per_cell"), str8_lit_comp(""), str8_lit_comp("Bytes Per Cell"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("bitmap"), str8_lit_comp("bitmaps"), str8_lit_comp("Bitmap"), str8_lit_comp("Bitmaps"), RD_IconKind_Bitmap},
{str8_lit_comp("geo3d"), str8_lit_comp(""), str8_lit_comp("Geometry (3D)"), str8_lit_comp(""), RD_IconKind_Cube},
{str8_lit_comp("address_range_size"), str8_lit_comp("address_range_sizes"), str8_lit_comp("Address Range Size"), str8_lit_comp("Address Range Sizes"), RD_IconKind_Null},
@@ -327,7 +328,7 @@ RD_NameSchemaInfo rd_name_schema_info_table[17] =
{str8_lit_comp("settings"), str8_lit_comp("x:\n{\n @default(1) 'hover_animations': bool,\n @default(1) 'press_animations': bool,\n @default(0) 'focus_animations': bool,\n @default(1) 'tooltip_animations': bool,\n @default(1) 'menu_animations': bool,\n @default(1) 'scrolling_animations': bool,\n @default(1) 'background_blur': bool,\n @default(1) 'thread_lines': bool,\n @default(1) 'breakpoint_lines': bool,\n @default(1) 'thread_glow': bool,\n @default(1) 'breakpoint_glow': bool,\n @default(0) 'opaque_backgrounds': bool,\n @default(1) 'smooth_main_text': bool,\n @default(0) 'smooth_code_text': bool,\n @default(1) 'hint_main_text': bool,\n @default(1) 'hint_code_text': bool,\n @default(2) 'tab_width': @range[1, 32] u64,\n @can_be_per_window 'main_font_size': @range[6, 72] u64,\n @can_be_per_window 'code_font_size': @range[1, 32] u64,\n}\n")},
{str8_lit_comp("text"), str8_lit_comp("x:\n{\n 'lang':lang,\n 'size':code_string,\n @default(1) 'show_line_numbers':bool,\n}\n")},
{str8_lit_comp("disasm"), str8_lit_comp("x:\n{\n 'arch': arch,\n 'syntax': dasm_syntax,\n 'size': code_string,\n @default(1) 'show_addresses': bool,\n @default(0) 'show_code_bytes': bool,\n @default(1) 'show_source_lines': bool,\n @default(1) 'show_symbol_names': bool,\n @default(1) 'show_line_numbers': bool,\n}\n")},
{str8_lit_comp("memory"), str8_lit_comp("x:\n{\n 'size': code_string,\n @default(16) 'num_columns': @range[1, 256] u64,\n}\n")},
{str8_lit_comp("memory"), str8_lit_comp("x:\n{\n 'size': code_string,\n @default(16) 'num_columns': @range[1, 256] u64,\n @default(1) 'bytes_per_cell': @range[1, 16] u64,\n}\n")},
{str8_lit_comp("bitmap"), str8_lit_comp("x:\n{\n @order(0) 'w': u64,\n @order(1) 'h': u64,\n 'fmt': tex2dformat,\n}\n")},
{str8_lit_comp("geo3d"), str8_lit_comp("x:\n{\n 'count': code_string,\n 'vtx': code_string,\n 'vtx_size': code_string,\n 'yaw': @range[0, 1] f32,\n 'pitch': @range[-0.5, 0] f32,\n 'zoom': @range[0, 100] f32,\n}\n")},
{str8_lit_comp("target"), str8_lit_comp("@commands(enable_cfg, launch_and_run, launch_and_step_into, remove_cfg)\n@collection_commands(add_target)\nx:\n{\n 'label': code_string,\n 'executable': path,\n 'arguments': string,\n 'working_directory': path,\n 'entry_point': code_string,\n 'stdout_path': path,\n 'stderr_path': path,\n 'stdin_path': path,\n 'environment': query,\n 'debug_subprocesses': bool,\n @no_expand @default(0) 'enabled': bool,\n}\n")},
+1 -1
View File
@@ -644,7 +644,7 @@ RD_Query query;
.os_event = rd_regs()->os_event,\
C_LINKAGE_BEGIN
extern RD_VocabInfo rd_vocab_info_table[314];
extern RD_VocabInfo rd_vocab_info_table[315];
extern RD_NameSchemaInfo rd_name_schema_info_table[17];
extern Rng1U64 rd_reg_slot_range_table[42];
extern String8 rd_binding_version_remap_old_name_table[8];
+3 -1
View File
@@ -110,6 +110,7 @@ RD_VocabTable:
{show_line_numbers "" "Show Line Numbers" "" Null }
{syntax syntaxes "Syntax" "Syntaxes" Null }
{num_columns "" "Number of Columns" "" Null }
{bytes_per_cell "" "Bytes Per Cell" "" Null }
{bitmap _ "Bitmap" _ Bitmap }
{geo3d "" "Geometry (3D)" "" Cube }
{address_range_size _ "Address Range Size" _ Null }
@@ -203,8 +204,9 @@ RD_VocabTable:
```
x:
{
'size': code_string,
'size': code_string,
@default(16) 'num_columns': @range[1, 256] u64,
@default(1) 'bytes_per_cell': @range[1, 16] u64,
}
```
}
+8 -5
View File
@@ -1634,7 +1634,8 @@ rd_eval_space_read(void *u, E_Space space, void *out, Rng1U64 range)
{
value_string = md_tag_from_string(child_schema, str8_lit("default"), 0)->first->string;
}
B32 value = str8_match(value_string, str8_lit("1"), 0);
String8 value_string_casted = push_str8f(scratch.arena, "(bool)(%S)", value_string);
B32 value = !!e_value_from_string(value_string_casted).u64;
read_data = push_str8_copy(scratch.arena, str8_struct(&value));
}
else if(str8_match(child_type_name, str8_lit("u64"), 0))
@@ -1644,8 +1645,8 @@ rd_eval_space_read(void *u, E_Space space, void *out, Rng1U64 range)
{
value_string = md_tag_from_string(child_schema, str8_lit("default"), 0)->first->string;
}
U64 value = 0;
try_u64_from_str8_c_rules(value_string, &value);
String8 value_string_casted = push_str8f(scratch.arena, "(uint64)(%S)", value_string);
U64 value = e_value_from_string(value_string_casted).u64;
read_data = push_str8_copy(scratch.arena, str8_struct(&value));
}
else if(str8_match(child_type_name, str8_lit("f32"), 0))
@@ -1655,7 +1656,8 @@ rd_eval_space_read(void *u, E_Space space, void *out, Rng1U64 range)
{
value_string = md_tag_from_string(child_schema, str8_lit("default"), 0)->first->string;
}
F32 value = (F32)f64_from_str8(value_string);
String8 value_string_casted = push_str8f(scratch.arena, "(float32)(%S)", value_string);
F32 value = e_value_from_string(value_string_casted).f32;
read_data = push_str8_copy(scratch.arena, str8_struct(&value));
}
}
@@ -4368,7 +4370,8 @@ rd_view_ui(Rng2F32 rect)
}
// rjf: dragging -> drag/drop
if(ui_dragging(sig) && !contains_2f32(sig.box->rect, ui_mouse()))
if(ui_dragging(sig) && !contains_2f32(sig.box->rect, ui_mouse()) &&
(!cell_selected || !ewv->text_editing))
{
if(cell_info.eval.space.kind == E_SpaceKind_FileSystem)
{
-2
View File
@@ -2960,8 +2960,6 @@ RD_VIEW_UI_FUNCTION_DEF(memory)
//
rd_store_view_param_u64(str8_lit("cursor_vaddr"), cursor);
rd_store_view_param_u64(str8_lit("mark_vaddr"), mark);
rd_store_view_param_u64(str8_lit("bytes_per_cell"), bytes_per_cell);
rd_store_view_param_u64(str8_lit("num_columns"), num_columns);
rd_store_view_scroll_pos(scroll_pos);
hs_scope_close(hs_scope);