mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-09 11:01:37 -07:00
fix treatment of 0-terminator in raddbg data section, fix encoding of auto view rules in raddbg data section
This commit is contained in:
@@ -23,7 +23,13 @@
|
||||
#define raddbg_watch(fmt, ...) raddbg_watch__impl((fmt), __VA_ARGS__)
|
||||
#define raddbg_pin(expr, ...) /* NOTE(rjf): inspected by debugger ui - does not change program execution */
|
||||
#define raddbg_log(fmt, ...) raddbg_log__impl((fmt), __VA_ARGS__)
|
||||
#define raddbg_auto_view_rule(type, ...) raddbg_exe_data static char raddbg_auto_view_rule_data__##__COUNTER__[] = ("auto_view_rule: {type:" #type ", view_rule: " #__VA_ARGS__ "}")
|
||||
#define raddbg_auto_view_rule(type, ...) raddbg_exe_data static char raddbg_glue(raddbg_auto_view_rule_data__, __COUNTER__)[] = ("auto_view_rule: {type: \"" #type "\", view_rule: \"" #__VA_ARGS__ "\"}")
|
||||
|
||||
////////////////////////////////
|
||||
//~ Helpers
|
||||
|
||||
#define raddbg_glue_(a, b) a##b
|
||||
#define raddbg_glue(a, b) raddbg_glue_(a, b)
|
||||
|
||||
////////////////////////////////
|
||||
//~ Win32 Implementations
|
||||
|
||||
+22
-9
@@ -1602,6 +1602,15 @@ basic_inline_tests(void)
|
||||
////////////////////////////////
|
||||
//~ rjf: Fancy Visualization Eval Tests
|
||||
|
||||
struct Bitmap
|
||||
{
|
||||
unsigned char *base;
|
||||
int width;
|
||||
int height;
|
||||
};
|
||||
// raddbg_auto_view_rule(Bitmap, wrap(base) bitmap(width, height));
|
||||
raddbg_auto_view_rule(Bitmap, wrap($expr.base));
|
||||
|
||||
static unsigned int
|
||||
mule_bswap_u32(unsigned int x)
|
||||
{
|
||||
@@ -1708,6 +1717,10 @@ fancy_viz_eval_tests(void)
|
||||
}
|
||||
int x2 = 0;
|
||||
|
||||
//- rjf: auto-view-rule'd bitmaps
|
||||
Bitmap foo = {(unsigned char *)&bitmap[0], 18, 18};
|
||||
raddbg_pin(foo);
|
||||
|
||||
//- rjf: 3D geometry
|
||||
float vertex_data[] = // pos.x, pos.y, pos.z, nor.x, nor.y, nor.z, tex.u, tex.v, col.r, col.g, col.b, ...
|
||||
{
|
||||
@@ -2365,12 +2378,12 @@ debug_string_tests(void)
|
||||
OutputDebugStringA("Hello, World!\n");
|
||||
}
|
||||
char message[65409+1];
|
||||
memset(&message[0], '=', sizeof(message));
|
||||
for(int i = 1; i < sizeof(message); i += 128)
|
||||
{
|
||||
message[i] = '\n';
|
||||
}
|
||||
message[sizeof(message) - 1] = 0;
|
||||
memset(&message[0], '=', sizeof(message));
|
||||
for(int i = 1; i < sizeof(message); i += 128)
|
||||
{
|
||||
message[i] = '\n';
|
||||
}
|
||||
message[sizeof(message) - 1] = 0;
|
||||
OutputDebugStringA(message);
|
||||
#endif
|
||||
}
|
||||
@@ -2643,13 +2656,13 @@ static void
|
||||
dynamic_step_test(void){
|
||||
#if _WIN32
|
||||
#if defined(_x86_64) || defined( __x86_64__ ) || defined( _M_X64 ) || defined( _M_AMD64 )
|
||||
void *page = VirtualAlloc(0, 4096, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||
void *page = VirtualAlloc(0, 4096, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||
char *ptr = (char*)page;
|
||||
*ptr++ = 0x51; // push rcx
|
||||
*ptr++ = 0x59; // pop rcx
|
||||
*ptr++ = 0xC3; // ret
|
||||
callback_t cb = (callback_t)page;
|
||||
cb(1);
|
||||
callback_t cb = (callback_t)page;
|
||||
cb(1);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -13906,12 +13906,18 @@ rd_frame(void)
|
||||
for(CTRL_EntityNode *n = modules.first; n != 0; n = n->next)
|
||||
{
|
||||
String8 raddbg_data = ctrl_raddbg_data_from_module(scratch.arena, n->v->handle);
|
||||
RD_CfgList cfgs = rd_cfg_tree_list_from_string(scratch.arena, raddbg_data);
|
||||
RD_Cfg *immediate_root = rd_immediate_cfg_from_keyf("module_%S_cfgs", ctrl_string_from_handle(scratch.arena, n->v->handle));
|
||||
for(RD_CfgNode *n = cfgs.first; n != 0; n = n->next)
|
||||
U8 split_char = 0;
|
||||
String8List raddbg_data_text_parts = str8_split(scratch.arena, raddbg_data, &split_char, 1, 0);
|
||||
for(String8Node *text_n = raddbg_data_text_parts.first; text_n != 0; text_n = text_n->next)
|
||||
{
|
||||
rd_cfg_insert_child(immediate_root, immediate_root->last, n->v);
|
||||
rd_cfg_list_push(scratch.arena, &immediate_auto_view_rules, n->v);
|
||||
String8 text = text_n->string;
|
||||
RD_CfgList cfgs = rd_cfg_tree_list_from_string(scratch.arena, text);
|
||||
RD_Cfg *immediate_root = rd_immediate_cfg_from_keyf("module_%S_cfgs", ctrl_string_from_handle(scratch.arena, n->v->handle));
|
||||
for(RD_CfgNode *n = cfgs.first; n != 0; n = n->next)
|
||||
{
|
||||
rd_cfg_insert_child(immediate_root, immediate_root->last, n->v);
|
||||
rd_cfg_list_push(scratch.arena, &immediate_auto_view_rules, n->v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user