@@ -54,6 +54,7 @@ typedef struct {
5454 gint32 signature ;
5555 guint8 guid [16 ];
5656 gint32 age ;
57+ char path [];
5758} CodeviewDebugDirectory ;
5859
5960typedef struct {
@@ -63,7 +64,7 @@ typedef struct {
6364} PdbStreamHeader ;
6465
6566static gboolean
66- get_pe_debug_guid (MonoImage * image , guint8 * out_guid , gint32 * out_age , gint32 * out_timestamp )
67+ get_pe_debug_guid (MonoImage * image , const char * * out_path , guint8 * out_guid , gint32 * out_age , gint32 * out_timestamp )
6768{
6869 MonoPEDirEntry * debug_dir_entry ;
6970 ImageDebugDirectory * debug_dir ;
@@ -82,6 +83,11 @@ get_pe_debug_guid (MonoImage *image, guint8 *out_guid, gint32 *out_age, gint32 *
8283 memcpy (out_guid , dir -> guid , 16 );
8384 * out_age = dir -> age ;
8485 * out_timestamp = debug_dir -> time_date_stamp ;
86+
87+ if (out_path != NULL ) {
88+ * out_path = g_strdup (dir -> path );
89+ }
90+
8591 return TRUE;
8692 }
8793 }
@@ -109,6 +115,12 @@ create_ppdb_file (MonoImage *ppdb_image)
109115 return ppdb ;
110116}
111117
118+ gboolean
119+ mono_ppdb_get_signature (MonoImage * image , const char * * out_path , guint8 * out_guid , gint32 * out_age , gint32 * out_timestamp )
120+ {
121+ return get_pe_debug_guid (image , out_path , out_guid , out_age , out_timestamp );
122+ }
123+
112124MonoPPDBFile *
113125mono_ppdb_load_file (MonoImage * image , const guint8 * raw_contents , int size )
114126{
@@ -126,7 +138,7 @@ mono_ppdb_load_file (MonoImage *image, const guint8 *raw_contents, int size)
126138 return create_ppdb_file (image );
127139 }
128140
129- if (!get_pe_debug_guid (image , pe_guid , & pe_age , & pe_timestamp )) {
141+ if (!get_pe_debug_guid (image , NULL , pe_guid , & pe_age , & pe_timestamp )) {
130142 mono_trace (G_LOG_LEVEL_DEBUG , MONO_TRACE_ASSEMBLY , "Image '%s' has no debug directory." , image -> name );
131143 return NULL ;
132144 }
0 commit comments