Eric Pouech : dbghelp: Return the stored name for a compiland.

Alexandre Julliard julliard at winehq.org
Mon Aug 30 15:53:52 CDT 2021


Module: wine
Branch: master
Commit: 2325962e74c6afd537cb4dcd933f6420078dcec2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2325962e74c6afd537cb4dcd933f6420078dcec2

Author: Eric Pouech <eric.pouech at gmail.com>
Date:   Mon Aug 30 09:24:35 2021 +0200

dbghelp: Return the stored name for a compiland.

Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dbghelp/dbghelp_private.h | 1 +
 dlls/dbghelp/symbol.c          | 7 ++++---
 dlls/dbghelp/type.c            | 2 ++
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index 763d04a16a3..0e5c1826108 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -170,6 +170,7 @@ struct symt_module /* in fact any of .exe, .dll... */
 struct symt_compiland
 {
     struct symt                 symt;
+    struct symt_module*         container;      /* symt_module */
     ULONG_PTR                   address;
     unsigned                    source;
     struct vector               vchildren;      /* global variables & functions */
diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c
index 286dc17310c..9863a736299 100644
--- a/dlls/dbghelp/symbol.c
+++ b/dlls/dbghelp/symbol.c
@@ -205,9 +205,10 @@ struct symt_compiland* symt_new_compiland(struct module* module,
                          debugstr_w(module->module.ModuleName), source_get(module, src_idx));
     if ((sym = pool_alloc(&module->pool, sizeof(*sym))))
     {
-        sym->symt.tag = SymTagCompiland;
-        sym->address  = address;
-        sym->source   = src_idx;
+        sym->symt.tag  = SymTagCompiland;
+        sym->container = module->top;
+        sym->address   = address;
+        sym->source    = src_idx;
         vector_init(&sym->vchildren, sizeof(struct symt*), 32);
     }
     return sym;
diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c
index 10a2ff7a718..ad88ac629df 100644
--- a/dlls/dbghelp/type.c
+++ b/dlls/dbghelp/type.c
@@ -91,6 +91,8 @@ const char* symt_get_name(const struct symt* sym)
     case SymTagEnum:            return ((const struct symt_enum*)sym)->name;
     case SymTagTypedef:         return ((const struct symt_typedef*)sym)->hash_elt.name;
     case SymTagUDT:             return ((const struct symt_udt*)sym)->hash_elt.name;
+    case SymTagCompiland:       return source_get(((const struct symt_compiland*)sym)->container->module,
+                                                  ((const struct symt_compiland*)sym)->source);
     default:
         FIXME("Unsupported sym-tag %s\n", symt_get_tag_str(sym->tag));
         /* fall through */




More information about the wine-cvs mailing list