[PATCH 02/14] tools/winedump: added support for dumping S_LOCAL symbol record

Eric Pouech eric.pouech at gmail.com
Tue Aug 24 04:11:31 CDT 2021


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

---
 include/wine/mscvpdb.h |    9 +++++++++
 tools/winedump/msc.c   |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/include/wine/mscvpdb.h b/include/wine/mscvpdb.h
index 9e544108bdd..4d4b8166473 100644
--- a/include/wine/mscvpdb.h
+++ b/include/wine/mscvpdb.h
@@ -1727,6 +1727,15 @@ union codeview_symbol
         unsigned short          inst_len;
         unsigned int            index;
     } heap_alloc_site;
+
+    struct
+    {
+        unsigned short int      len;
+        unsigned short int      id;
+        cv_typ_t                symtype;
+        unsigned short          varflags;
+        char                    name[1];
+    } local_v3;
 };
 
 #define S_COMPILE       0x0001
diff --git a/tools/winedump/msc.c b/tools/winedump/msc.c
index c7ca3eea77a..6d463c0ee1b 100644
--- a/tools/winedump/msc.c
+++ b/tools/winedump/msc.c
@@ -288,6 +288,33 @@ static const char* get_funcattr(unsigned attr)
     return tmp;
 }
 
+static const char* get_varflags(unsigned flags)
+{
+    static char tmp[1024];
+    unsigned    pos = 0;
+
+    if (!flags) return "none";
+#define X(s) {if (pos) tmp[pos++] = ';'; strcpy(tmp + pos, s); pos += strlen(s);}
+    if (flags & 0x0001) X("param");
+    if (flags & 0x0002) X("addr-taken");
+    if (flags & 0x0004) X("compiler-gen");
+    if (flags & 0x0008) X("aggregated");
+    if (flags & 0x0010) X("in-aggreate");
+    if (flags & 0x0020) X("aliased");
+    if (flags & 0x0040) X("alias");
+    if (flags & 0x0080) X("retval");
+    if (flags & 0x0100) X("optimized-out");
+    if (flags & 0x0200) X("enreg-global");
+    if (flags & 0x0400) X("enreg-static");
+    if (flags & 0xf800) pos += sprintf(tmp, "unk:%x", flags & 0xf800);
+#undef X
+
+    tmp[pos] = '\0';
+    assert(pos < sizeof(tmp));
+
+    return tmp;
+}
+
 static const char* get_machine(unsigned m)
 {
     const char*     machine;
@@ -1564,6 +1591,13 @@ BOOL codeview_dump_symbols(const void* root, unsigned long size)
                    sym->thread_v3.segment, sym->thread_v3.offset, sym->thread_v3.symtype);
             break;
 
+        case S_LOCAL:
+            printf("\tS-Local V3 '%s' type=%x flags=%s\n",
+                   sym->local_v3.name, sym->local_v3.symtype,
+                   get_varflags(sym->local_v3.varflags));
+
+            break;
+
         default:
             printf(">>> Unsupported symbol-id %x sz=%d\n", sym->generic.id, sym->generic.len + 2);
             dump_data((const void*)sym, sym->generic.len + 2, "  ");




More information about the wine-devel mailing list