take out view rules from pins, since that is just in the expr itself now

This commit is contained in:
Ryan Fleury
2025-04-11 13:21:25 -07:00
parent abd33f7160
commit 83a31a5229
3 changed files with 37 additions and 41 deletions
+32 -29
View File
@@ -337,7 +337,7 @@ type_coverage_eval_tests(void)
raddbg_pin(basics);
raddbg_pin(fixed);
raddbg_pin(pointer);
raddbg_pin(dynamic, slice);
raddbg_pin(dynamic);
Struct_With_Embedded_Arrays swea = {0};
{
@@ -1668,9 +1668,9 @@ fancy_viz_eval_tests(void)
" return 0;\n"
"}\n\n");
int x1 = 0;
raddbg_pin(long_string, text);
raddbg_pin(code_string, text(lang=c));
raddbg_pin(fancy_viz_eval_tests, disasm);
raddbg_pin(text(long_string));
raddbg_pin(text(code_string, lang=c));
raddbg_pin(disasm(fancy_viz_eval_tests));
//- rjf: bitmaps
unsigned int background_color = 0x00000000;
@@ -1681,7 +1681,7 @@ fancy_viz_eval_tests(void)
unsigned int cl = mule_bswap_u32(main_color);
unsigned int sn = mule_bswap_u32(shine_color);
unsigned int sh = mule_bswap_u32(shadow_color);
unsigned int bitmap[] =
unsigned int pixels[] =
{
bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg,
bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg,
@@ -1702,38 +1702,38 @@ fancy_viz_eval_tests(void)
bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg,
bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg, bg,
};
raddbg_pin(bitmap, bitmap(18, 18));
for(int i = 0; i < sizeof(bitmap)/sizeof(bitmap[0]); i += 1)
raddbg_pin(bitmap(pixels, 18, 18));
for(int i = 0; i < sizeof(pixels)/sizeof(pixels[0]); i += 1)
{
unsigned int r = bitmap[i]&0x000000ff;
unsigned int a = bitmap[i]&0xff000000;
bitmap[i] = bitmap[i]>>8;
bitmap[i] &= ~0xffff0000;
bitmap[i] |= (r<<16);
bitmap[i] |= (a);
unsigned int r = pixels[i]&0x000000ff;
unsigned int a = pixels[i]&0xff000000;
pixels[i] = pixels[i]>>8;
pixels[i] &= ~0xffff0000;
pixels[i] |= (r<<16);
pixels[i] |= (a);
}
for(int i = 0; i < sizeof(bitmap)/sizeof(bitmap[0]); i += 1)
for(int i = 0; i < sizeof(pixels)/sizeof(pixels[0]); i += 1)
{
unsigned int r = bitmap[i]&0x000000ff;
unsigned int a = bitmap[i]&0xff000000;
bitmap[i] = bitmap[i]>>8;
bitmap[i] &= ~0xffff0000;
bitmap[i] |= (r<<16);
bitmap[i] |= (a);
unsigned int r = pixels[i]&0x000000ff;
unsigned int a = pixels[i]&0xff000000;
pixels[i] = pixels[i]>>8;
pixels[i] &= ~0xffff0000;
pixels[i] |= (r<<16);
pixels[i] |= (a);
}
for(int i = 0; i < sizeof(bitmap)/sizeof(bitmap[0]); i += 1)
for(int i = 0; i < sizeof(pixels)/sizeof(pixels[0]); i += 1)
{
unsigned int r = bitmap[i]&0x000000ff;
unsigned int a = bitmap[i]&0xff000000;
bitmap[i] = bitmap[i]>>8;
bitmap[i] &= ~0xffff0000;
bitmap[i] |= (r<<16);
bitmap[i] |= (a);
unsigned int r = pixels[i]&0x000000ff;
unsigned int a = pixels[i]&0xff000000;
pixels[i] = pixels[i]>>8;
pixels[i] &= ~0xffff0000;
pixels[i] |= (r<<16);
pixels[i] |= (a);
}
int x2 = 0;
//- rjf: auto-view-rule'd bitmaps
Bitmap foo = {(unsigned char *)&bitmap[0], 18, 18};
Bitmap foo = {(unsigned char *)&pixels[0], 18, 18};
raddbg_pin(foo);
//- rjf: 3D geometry
@@ -1923,7 +1923,10 @@ fancy_viz_eval_tests(void)
136, 137, 138, 138, 139, 136, 140, 141, 142, 142, 143, 140, 144, 145, 146, 146, 147, 144, 148, 149, 150, 150, 151, 148,
152, 153, 154, 154, 155, 152, 156, 157, 158, 158, 159, 156, 160, 161, 162, 162, 163, 160, 164, 165, 166, 166, 167, 164,
};
raddbg_pin(index_data, "geo3d(count = (sizeof index_data/4), vtx = (vertex_data), vtx_size = (sizeof vertex_data))");
int count = (sizeof index_data/4);
float *vtx = vertex_data;
int vtx_size = sizeof vertex_data;
raddbg_pin(geo3d(index_data, count = count, vtx = vtx, vtx_size = vtx_size));
int x3 = 0;
}
+5 -5
View File
@@ -73,11 +73,11 @@
// `raddbg_thread_color_hex(0xff0000ff)`: Sets the calling thread's color.
// - Also can be done with individual `[0, 1]` color components:
// `raddbg_thread_color_rgba(1.f, 0.f, 0.f, 1.f)`
// - `raddbg_pin(<expr>, <view_rule>)`, e.g.
// `raddbg_pin(dynamic_array, slice)`: Like watch pins, but defined in source
// code. This is used by the debugger UI, but does not show up anywhere
// other than the source code, so it can either be used as a macro (which
// expands to nothing), or in comments too.
// - `raddbg_pin(<expr>)`, e.g.
// `raddbg_pin(slice(dynamic_array))`: Like watch pins, but defined in
// source code. This is used by the debugger UI, but does not show up
// anywhere other than the source code, so it can either be used as a macro
// (which expands to nothing), or in comments too.
// - `raddbg_entry_point(name)`, e.g. `raddbg_entry_point(entry_point)`:
// declares the entry point for an executable, which the debugger will use
// when stepping into a program, rather than the defaults (e.g. `main`).
-7
View File
@@ -1933,15 +1933,10 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
// rjf: extract fixed arguments
String8 expr_string = {0};
String8 view_rule_string = {0};
if(args.first != 0)
{
expr_string = args.first->string;
}
if(args.first->next != 0)
{
view_rule_string = args.first->next->string;
}
// rjf: build immediate pin for this markup
if(expr_string.size != 0)
@@ -1949,9 +1944,7 @@ rd_code_slice(RD_CodeSliceParams *params, TxtPt *cursor, TxtPt *mark, S64 *prefe
RD_Cfg *immediate_root = rd_immediate_cfg_from_keyf("markup_pin_%I64x_%I64x", line_num, off);
RD_Cfg *pin = rd_cfg_child_from_string_or_alloc(immediate_root, str8_lit("watch_pin"));
RD_Cfg *expr = rd_cfg_child_from_string_or_alloc(pin, str8_lit("expression"));
RD_Cfg *view_rule = rd_cfg_child_from_string_or_alloc(pin, str8_lit("view_rule"));
rd_cfg_new_replace(expr, expr_string);
rd_cfg_new_replace(view_rule, view_rule_string);
rd_cfg_list_push(scratch.arena, &immediate_pins, pin);
}
}