[PATCH] [DbgHelp]: elf for wine and spec definitions

Eric Pouech eric.pouech at wanadoo.fr
Fri Jun 23 14:45:52 CDT 2006


- enhancement over previous fix (we don't need to insert
  NOTYPE symbols in our public symbol table, so drop them
  as early as possible)
This is used to identify Wine's inter-DLL trampoline code, hence
single stepping in Winedbg on inter'DLL calls was broken.
(Side note: this regression is more than one year old... I still
wonder how it got unnoticed)

A+
---

 dlls/dbghelp/elf_module.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c
index c1f8296..b2f584b 100644
--- a/dlls/dbghelp/elf_module.c
+++ b/dlls/dbghelp/elf_module.c
@@ -291,21 +291,25 @@ static void elf_hash_symtab(struct modul
 
         symname = strp + symp->st_name;
 
-        if (ELF32_ST_TYPE(symp->st_info) == STT_FILE)
+        /* handle some specific symtab (that we'll throw away when done) */
+        switch (ELF32_ST_TYPE(symp->st_info))
         {
+        case STT_FILE:
             compiland = symname ? symt_new_compiland(module, source_new(module, NULL, symname)) : NULL;
             continue;
-        }
-        for (j = 0; thunks[j].symname; j++)
-        {
-            if (!strcmp(symname, thunks[j].symname))
+        case STT_NOTYPE:
+            /* we are only interested in wine markers inserted by winebuild */
+            for (j = 0; thunks[j].symname; j++)
             {
-                thunks[j].rva_start = symp->st_value;
-                thunks[j].rva_end   = symp->st_value + symp->st_size;
-                break;
+                if (!strcmp(symname, thunks[j].symname))
+                {
+                    thunks[j].rva_start = symp->st_value;
+                    thunks[j].rva_end   = symp->st_value + symp->st_size;
+                    break;
+                }
             }
+            continue;
         }
-        if (thunks[j].symname) continue;
 
         /* FIXME: we don't need to handle them (GCC internals)
          * Moreover, they screw up our symbol lookup :-/
@@ -550,9 +554,6 @@ static int elf_new_wine_thunks(struct mo
                                              ELF32_ST_BIND(ste->symp->st_info) == STB_LOCAL,
                                              addr, ste->symp->st_size, NULL);
                     break;
-                case STT_NOTYPE:
-                    /* at least winebuild specific symbols */
-                    break;
                 default:
                     FIXME("Shouldn't happen\n");
                     break;
@@ -612,11 +613,10 @@ static int elf_new_public_symbols(struct
     hash_table_iter_init(symtab, &hti, NULL);
     while ((ste = hash_table_iter_up(&hti)))
     {
-        if (ELF32_ST_TYPE(ste->symp->st_info) != STT_NOTYPE)
-            symt_new_public(module, ste->compiland, ste->ht_elt.name,
-                            module->elf_info->elf_addr + ste->symp->st_value,
-                            ste->symp->st_size, TRUE /* FIXME */, 
-                            ELF32_ST_TYPE(ste->symp->st_info) == STT_FUNC);
+        symt_new_public(module, ste->compiland, ste->ht_elt.name,
+                        module->elf_info->elf_addr + ste->symp->st_value,
+                        ste->symp->st_size, TRUE /* FIXME */, 
+                        ELF32_ST_TYPE(ste->symp->st_info) == STT_FUNC);
     }
     return TRUE;
 }



More information about the wine-patches mailing list