mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 22:08:41 +00:00
detect and error out on PDB linked with /DEBUG:FASTLINK
This commit is contained in:
+40
-24
@@ -74,34 +74,50 @@ pdb_info_from_data(Arena *arena, String8 data){
|
|||||||
// table layout: epilogue
|
// table layout: epilogue
|
||||||
U32 epilogue_base_off = deleted_words_array_off + num_deleted_words*sizeof(U32);
|
U32 epilogue_base_off = deleted_words_array_off + num_deleted_words*sizeof(U32);
|
||||||
|
|
||||||
// read table
|
if (epilogue_base_off <= data.size){
|
||||||
if (hash_table_count > 0 && epilogue_base_off <= data.size){
|
U64 record_off = epilogue_base_off;
|
||||||
PDB_InfoNode *first = 0;
|
|
||||||
PDB_InfoNode *last = 0;
|
// read table
|
||||||
|
if (hash_table_count > 0) {
|
||||||
U32 record_off = epilogue_base_off;
|
PDB_InfoNode *first = 0;
|
||||||
for (U32 i = 0; i < hash_table_count; i += 1, record_off += 8){
|
PDB_InfoNode *last = 0;
|
||||||
U32 *record = (U32*)(data.str + record_off);
|
|
||||||
U32 relative_name_off = record[0];
|
|
||||||
MSF_StreamNumber sn = (MSF_StreamNumber)record[1];
|
|
||||||
|
|
||||||
U32 name_off = names_base_off + relative_name_off;
|
for (U32 i = 0; i < hash_table_count; i += 1, record_off += 8){
|
||||||
String8 name = str8_cstring_capped((char*)(data.str + name_off),
|
U32 *record = (U32*)(data.str + record_off);
|
||||||
(char*)(data.str + names_base_opl));
|
U32 relative_name_off = record[0];
|
||||||
|
MSF_StreamNumber sn = (MSF_StreamNumber)record[1];
|
||||||
|
|
||||||
|
U32 name_off = names_base_off + relative_name_off;
|
||||||
|
String8 name = str8_cstring_capped((char*)(data.str + name_off),
|
||||||
|
(char*)(data.str + names_base_opl));
|
||||||
|
|
||||||
|
// push info node
|
||||||
|
PDB_InfoNode *node = push_array(arena, PDB_InfoNode, 1);
|
||||||
|
SLLQueuePush(first, last, node);
|
||||||
|
node->string = name;
|
||||||
|
node->sn = sn;
|
||||||
|
}
|
||||||
|
|
||||||
// push info node
|
result = push_array(arena, PDB_Info, 1);
|
||||||
PDB_InfoNode *node = push_array(arena, PDB_InfoNode, 1);
|
result->first = first;
|
||||||
SLLQueuePush(first, last, node);
|
result->last = last;
|
||||||
node->string = name;
|
result->auth_guid = *auth_guid;
|
||||||
node->sn = sn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result = push_array(arena, PDB_Info, 1);
|
// read PDB features
|
||||||
result->first = first;
|
PDB_FeatureFlags features = 0;
|
||||||
result->last = last;
|
for (; record_off + sizeof(PDB_FeatureSig) <= data.size; ) {
|
||||||
result->auth_guid = *auth_guid;
|
PDB_FeatureSig sig = 0;
|
||||||
|
record_off += str8_deserial_read_struct(data, record_off, &sig);
|
||||||
|
switch (sig) {
|
||||||
|
case PDB_FeatureSig_NULL: break;
|
||||||
|
case PDB_FeatureSig_VC140: features |= PDB_FeatureFlag_HAS_ID_STREAM; break;
|
||||||
|
case PDB_FeatureSig_NO_TYPE_MERGE: features |= PDB_FeatureFlag_NO_TYPE_MERGE; break;
|
||||||
|
case PDB_FeatureSig_MINIMAL_DEBUG_INFO: features |= PDB_FeatureFlag_MINIMAL_DBG_INFO; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result->features = features;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ typedef struct PDB_Info
|
|||||||
PDB_InfoNode *first;
|
PDB_InfoNode *first;
|
||||||
PDB_InfoNode *last;
|
PDB_InfoNode *last;
|
||||||
Guid auth_guid;
|
Guid auth_guid;
|
||||||
|
PDB_FeatureFlags features;
|
||||||
} PDB_Info;
|
} PDB_Info;
|
||||||
|
|
||||||
typedef struct PDB_InfoHeader
|
typedef struct PDB_InfoHeader
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
#include "coff/coff_parse.h"
|
#include "coff/coff_parse.h"
|
||||||
#include "codeview/codeview.h"
|
#include "codeview/codeview.h"
|
||||||
#include "codeview/codeview_parse.h"
|
#include "codeview/codeview_parse.h"
|
||||||
#include "codeview/codeview_enum.h"
|
|
||||||
#include "msf/msf.h"
|
#include "msf/msf.h"
|
||||||
#include "msf/msf_parse.h"
|
#include "msf/msf_parse.h"
|
||||||
#include "pdb/pdb.h"
|
#include "pdb/pdb.h"
|
||||||
@@ -44,7 +43,6 @@
|
|||||||
#include "coff/coff_parse.c"
|
#include "coff/coff_parse.c"
|
||||||
#include "codeview/codeview.c"
|
#include "codeview/codeview.c"
|
||||||
#include "codeview/codeview_parse.c"
|
#include "codeview/codeview_parse.c"
|
||||||
#include "codeview/codeview_enum.c"
|
|
||||||
#include "msf/msf.c"
|
#include "msf/msf.c"
|
||||||
#include "msf/msf_parse.c"
|
#include "msf/msf_parse.c"
|
||||||
#include "pdb/pdb.c"
|
#include "pdb/pdb.c"
|
||||||
@@ -225,7 +223,7 @@ entry_point(CmdLine *cmdline)
|
|||||||
{
|
{
|
||||||
convert2bake = p2r_convert(arena, user2convert);
|
convert2bake = p2r_convert(arena, user2convert);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- rjf: dump breakpad text
|
//- rjf: dump breakpad text
|
||||||
String8List dump = {0};
|
String8List dump = {0};
|
||||||
ProfScope("dump breakpad text")
|
ProfScope("dump breakpad text")
|
||||||
|
|||||||
@@ -2957,6 +2957,11 @@ p2r_convert(Arena *arena, P2R_User2Convert *in)
|
|||||||
named_streams = pdb_named_stream_table_from_info(arena, info);
|
named_streams = pdb_named_stream_table_from_info(arena, info);
|
||||||
MemoryCopyStruct(&auth_guid, &info->auth_guid);
|
MemoryCopyStruct(&auth_guid, &info->auth_guid);
|
||||||
scratch_end(scratch);
|
scratch_end(scratch);
|
||||||
|
|
||||||
|
if (info->features & PDB_FeatureFlag_MINIMAL_DBG_INFO) {
|
||||||
|
fprintf(stderr, "ERROR: PDB was linked with /DEBUG:FASTLINK (partial debug info is not supported). Please relink using /DEBUG:FULL.");
|
||||||
|
os_abort(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user