further raddbgi -> rdi naming pass

This commit is contained in:
Ryan Fleury
2024-02-13 15:56:30 -08:00
parent b9f010dff6
commit 816f94ef71
17 changed files with 597 additions and 597 deletions
+12 -12
View File
@@ -22,28 +22,28 @@ int main(int argument_count, char **arguments)
uint8_t *data = (uint8_t *)MapViewOfFile(map, FILE_MAP_READ, 0, 0, data_size);
// parse raw data as raddbg
RDI_Parsed rdbg = {0};
RDI_ParseStatus parse_status = rdi_parse(data, data_size, &rdbg);
RDI_Parsed rdi = {0};
RDI_ParseStatus parse_status = rdi_parse(data, data_size, &rdi);
// usage example: print out all procedure symbol names
#if 1
for(uint64_t procedure_idx = 0; procedure_idx < rdbg.procedure_count; procedure_idx += 1)
for(uint64_t procedure_idx = 0; procedure_idx < rdi.procedure_count; procedure_idx += 1)
{
RDI_Procedure *procedure = &rdbg.procedures[procedure_idx];
RDI_Procedure *procedure = &rdi.procedures[procedure_idx];
uint64_t name_size = 0;
uint8_t *name = rdi_string_from_idx(&rdbg, procedure->name_string_idx, &name_size);
uint8_t *name = rdi_string_from_idx(&rdi, procedure->name_string_idx, &name_size);
printf("[%I64u] %.*s\n", procedure_idx, (int)name_size, name);
}
#endif
// usage example: print out all user-defined-type names
#if 0
for(uint64_t udt_idx = 0; udt_idx < rdbg.udt_count; udt_idx += 1)
for(uint64_t udt_idx = 0; udt_idx < rdi.udt_count; udt_idx += 1)
{
RDI_UDT *udt = &rdbg.udts[udt_idx];
RDI_TypeNode *type = &rdbg.type_nodes[udt->self_type_idx];
RDI_UDT *udt = &rdi.udts[udt_idx];
RDI_TypeNode *type = &rdi.type_nodes[udt->self_type_idx];
uint64_t name_size = 0;
uint8_t *name = rdi_string_from_idx(&rdbg, type->user_defined.name_string_idx, &name_size);
uint8_t *name = rdi_string_from_idx(&rdi, type->user_defined.name_string_idx, &name_size);
printf("[%I64u] %.*s\n", udt_idx, (int)name_size, name);
}
#endif
@@ -51,9 +51,9 @@ int main(int argument_count, char **arguments)
// for getting more info, look at the `RDI_Parsed` structure. all data is
// represented as a bunch of flat plain-old-data tables. data which must
// reference other data uses indices into that other data's table. for
// example, given a `type_idx`, I will index into `rdbg.type_nodes`. given a
// `udt_idx`, I will index into `rdbg.udts`. given a `scope_idx`, I will
// index into `rdbg.scopes`. and so on.
// example, given a `type_idx`, I will index into `rdi.type_nodes`. given a
// `udt_idx`, I will index into `rdi.udts`. given a `scope_idx`, I will
// index into `rdi.scopes`. and so on.
return 0;
}