[PATCH 11/11] tools/winedump: fix public and data/proc ref definitions of Codeview records

Eric Pouech eric.pouech at gmail.com
Sat Aug 21 03:23:25 CDT 2021


Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/dbghelp/msc.c     |    2 +-
 include/wine/mscvpdb.h |   12 +++++++++++-
 tools/winedump/msc.c   |   22 +++++++++++++++-------
 3 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c
index ff7507c797c..380511d0b55 100644
--- a/dlls/dbghelp/msc.c
+++ b/dlls/dbghelp/msc.c
@@ -2077,7 +2077,7 @@ static BOOL codeview_snarf_public(const struct msc_debug_info* msc_dbg, const BY
             {
                 symt_new_public(msc_dbg->module, compiland,
                                 sym->public_v3.name,
-                                sym->public_v3.symtype == SYMTYPE_FUNCTION,
+                                sym->public_v3.pubsymflags == SYMTYPE_FUNCTION,
                                 codeview_get_address(msc_dbg, sym->public_v3.segment, sym->public_v3.offset), 1);
             }
             break;
diff --git a/include/wine/mscvpdb.h b/include/wine/mscvpdb.h
index 8623f8ed8a3..2ed9a9fe192 100644
--- a/include/wine/mscvpdb.h
+++ b/include/wine/mscvpdb.h
@@ -1386,7 +1386,7 @@ union codeview_symbol
     {
         unsigned short int      len;
         unsigned short int      id;
-        cv_typ_t                symtype;
+        unsigned int            pubsymflags;
         unsigned int            offset;
         unsigned short          segment;
         char                    name[1];
@@ -1679,6 +1679,16 @@ union codeview_symbol
         char                    name[1];
     } thread_v3;
 
+    struct
+    {
+        unsigned short int      len;
+        unsigned short int      id;
+        unsigned int            sumName;
+        unsigned int            ibSym;
+        unsigned short          imod;
+        char                    name[1];
+    } refsym2_v3;
+
     struct
     {
         unsigned short int      len;
diff --git a/tools/winedump/msc.c b/tools/winedump/msc.c
index d2cf7b36d80..7f93f3e7701 100644
--- a/tools/winedump/msc.c
+++ b/tools/winedump/msc.c
@@ -1142,15 +1142,23 @@ BOOL codeview_dump_symbols(const void* root, unsigned long size)
 	    break;
 
 	case S_PUB32:
-        /* not completely sure of those two anyway */
+            printf("\tS-Public V3 '%s' %04x:%08x flags%s%s%s%s\n",
+                   get_symbol_str(sym->public_v3.name),
+                   sym->public_v3.segment, sym->public_v3.offset,
+                   (sym->public_v3.pubsymflags & 1) ? "-code" : "",
+                   (sym->public_v3.pubsymflags & 2) ? "-func" : "",
+                   (sym->public_v3.pubsymflags & 4) ? "-manage" : "",
+                   (sym->public_v3.pubsymflags & 8) ? "-msil" : "");
+	    break;
+
+	case S_DATAREF:
 	case S_PROCREF:
 	case S_LPROCREF:
-            printf("\tS-Public%s V3 '%s' %04x:%08x type:%08x\n",
-                   sym->generic.id == S_PUB32 ? "" :
-                                      (sym->generic.id == S_PROCREF ? "<subkind1" : "<subkind2"),
-                   get_symbol_str(sym->public_v3.name),
-                   sym->public_v3.segment,
-                   sym->public_v3.offset, sym->public_v3.symtype);
+            printf("\tS-%sref V3 '%s' mod:%04x sym:%08x name:%08x\n",
+                   sym->generic.id == S_DATAREF ? "Data" :
+                                      (sym->generic.id == S_PROCREF ? "Proc" : "Lproc"),
+                   get_symbol_str(sym->refsym2_v3.name),
+                   sym->refsym2_v3.imod, sym->refsym2_v3.ibSym, sym->refsym2_v3.sumName);
 	    break;
 
         /*




More information about the wine-devel mailing list