breakpad dumping: include pdb name if missing exe name, include pdb guid if no exe hash

This commit is contained in:
Ryan Fleury
2025-09-26 11:37:07 -07:00
parent 9ad7361cb9
commit cd7e2d3f89
6 changed files with 75 additions and 9 deletions
+2
View File
@@ -26,6 +26,7 @@ ac_init(void)
internal AC_Artifact
ac_artifact_from_key_(Access *access, String8 key, AC_ArtifactParams *params, U64 endt_us)
{
ProfBeginFunction();
AC_RequestBatch *req_batch = &ac_shared->req_batches[params->flags & AC_Flag_HighPriority ? 0 : 1];
//- rjf: create function -> cache
@@ -193,6 +194,7 @@ ac_artifact_from_key_(Access *access, String8 key, AC_ArtifactParams *params, U6
params->stale_out[0] = artifact_is_stale;
}
ProfEnd();
return artifact;
}
+21
View File
@@ -7822,3 +7822,24 @@ ctrl_call_stack_from_thread_new(Access *access, CTRL_Handle thread_handle, B32 h
}
return result;
}
////////////////////////////////
//~ rjf: Call Stack Tree Artifact Cache Hooks / Lookups
internal AC_Artifact
ctrl_call_stack_tree_artifact_create(String8 key, U64 gen, U64 *requested_gen, B32 *retry_out)
{
}
internal void
ctrl_call_stack_tree_artifact_destroy(AC_Artifact artifact)
{
}
internal CTRL_CallStackTree
ctrl_call_stack_tree_new(Access *access, U64 endt_us)
{
}
+7
View File
@@ -1264,4 +1264,11 @@ internal AC_Artifact ctrl_call_stack_artifact_create(String8 key, U64 gen, U64 *
internal void ctrl_call_stack_artifact_destroy(AC_Artifact artifact);
internal CTRL_CallStack ctrl_call_stack_from_thread_new(Access *access, CTRL_Handle thread_handle, B32 high_priority, U64 endt_us);
////////////////////////////////
//~ rjf: Call Stack Tree Artifact Cache Hooks / Lookups
internal AC_Artifact ctrl_call_stack_tree_artifact_create(String8 key, U64 gen, U64 *requested_gen, B32 *retry_out);
internal void ctrl_call_stack_tree_artifact_destroy(AC_Artifact artifact);
internal CTRL_CallStackTree ctrl_call_stack_tree_new(Access *access, U64 endt_us);
#endif // CTRL_CORE_H
+8 -4
View File
@@ -133,11 +133,15 @@ struct {RDI_U8 *str; RDI_U64 size;} rdi_eval_conversion_kind_message_string_tabl
RDI_PROC RDI_U64
rdi_hash(RDI_U8 *ptr, RDI_U64 size)
{
RDI_U64 result = 5381;
RDI_U8 *opl = ptr + size;
for(;ptr < opl; ptr += 1)
RDI_U64 result = 0;
if(size != 0)
{
result = ((result << 5) + result) + *ptr;
result = 5381;
RDI_U8 *opl = ptr + size;
for(;ptr < opl; ptr += 1)
{
result = ((result << 5) + result) + *ptr;
}
}
return result;
}
+29 -1
View File
@@ -807,7 +807,35 @@ rb_thread_entry_point(void *p)
//- rjf: dump MODULE record
if(lane_idx() == 0)
{
str8_list_pushf(arena, &p2b_shared->dump, "MODULE windows x86_64 %I64x %S\n", bake_params.top_level_info.exe_hash, bake_params.top_level_info.exe_name);
// rjf: pick name to identify module
String8 module_name_string = bake_params.top_level_info.exe_name;
if(module_name_string.size == 0 && input_files.first != 0)
{
module_name_string = input_files.first->v->path;
}
// rjf: pick string for unique code
String8 unique_identifier_string = {0};
if(unique_identifier_string.size == 0 && bake_params.top_level_info.exe_hash != 0)
{
unique_identifier_string = str8f(arena, "%I64x", bake_params.top_level_info.exe_hash);
}
if(unique_identifier_string.size == 0 && input_files.first != 0 && input_files.first->v->format == RB_FileFormat_PDB)
{
Temp scratch = scratch_begin(&arena, 1);
String8 msf_data = input_files.first->v->data;
MSF_RawStreamTable *st = msf_raw_stream_table_from_data(scratch.arena, msf_data);
String8 info_data = msf_data_from_stream_number(scratch.arena, msf_data, st, PDB_FixedStream_Info);
PDB_Info *info = pdb_info_from_data(scratch.arena, info_data);
if(info != 0)
{
unique_identifier_string = string_from_guid(arena, info->auth_guid);
}
scratch_end(scratch);
}
// rjf: push record
str8_list_pushf(arena, &p2b_shared->dump, "MODULE windows x86_64 %S %S\n", unique_identifier_string, module_name_string);
}
//- rjf: dump FILE records
+8 -4
View File
@@ -1492,11 +1492,15 @@ RDI_PROC RDI_U8 *rdi_explanation_string_from_eval_conversion_kind(RDI_EvalConver
RDI_PROC RDI_U64
rdi_hash(RDI_U8 *ptr, RDI_U64 size)
{
RDI_U64 result = 5381;
RDI_U8 *opl = ptr + size;
for(;ptr < opl; ptr += 1)
RDI_U64 result = 0;
if(size != 0)
{
result = ((result << 5) + result) + *ptr;
result = 5381;
RDI_U8 *opl = ptr + size;
for(;ptr < opl; ptr += 1)
{
result = ((result << 5) + result) + *ptr;
}
}
return result;
}