Eric Pouech : dbghelp: Always set the size to public symbols to 1 when we don't know the size

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 14 07:28:44 CST 2006


Module: wine
Branch: refs/heads/master
Commit: c9de37d71c3953be159e453da4252c1a9ac5e554
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=c9de37d71c3953be159e453da4252c1a9ac5e554

Author: Eric Pouech <eric.pouech at wanadoo.fr>
Date:   Tue Feb 14 14:04:16 2006 +0100

dbghelp: Always set the size to public symbols to 1 when we don't know the size
so that they can only be search on their start address

---

 dlls/dbghelp/msc.c       |    8 ++++----
 dlls/dbghelp/pe_module.c |   10 +++++-----
 dlls/dbghelp/symbol.c    |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c
index 93f0474..66b07b5 100644
--- a/dlls/dbghelp/msc.c
+++ b/dlls/dbghelp/msc.c
@@ -1206,7 +1206,7 @@ static int codeview_snarf(const struct m
                 symt_new_public(msc_dbg->module, flt ? flt->compiland : NULL,
                                 terminate_string(&sym->data_v1.p_name), 
                                 codeview_get_address(msc_dbg, sym->data_v1.segment, sym->data_v1.offset),
-                                0, TRUE /* FIXME */, TRUE /* FIXME */);
+                                1, TRUE /* FIXME */, TRUE /* FIXME */);
             }
             break;
 	case S_PUB_V2: /* FIXME is this really a 'data_v2' structure ?? */
@@ -1216,7 +1216,7 @@ static int codeview_snarf(const struct m
                 symt_new_public(msc_dbg->module, flt ? flt->compiland : NULL,
                                 terminate_string(&sym->data_v2.p_name), 
                                 codeview_get_address(msc_dbg, sym->data_v2.segment, sym->data_v2.offset),
-                                0, TRUE /* FIXME */, TRUE /* FIXME */);
+                                1, TRUE /* FIXME */, TRUE /* FIXME */);
             }
 	    break;
 
@@ -1515,7 +1515,7 @@ static int codeview_snarf(const struct m
                                 flt ? flt->compiland : NULL,
                                 sym->data_v3.name, 
                                 codeview_get_address(msc_dbg, sym->data_v3.segment, sym->data_v3.offset),
-                                0, FALSE /* FIXME */, FALSE);
+                                1, FALSE /* FIXME */, FALSE);
             }
             break;
         case S_PUB_FUNC1_V3:
@@ -1527,7 +1527,7 @@ static int codeview_snarf(const struct m
                                 flt ? flt->compiland : NULL,
                                 sym->data_v3.name, 
                                 codeview_get_address(msc_dbg, sym->data_v3.segment, sym->data_v3.offset),
-                                0, TRUE /* FIXME */, TRUE);
+                                1, TRUE /* FIXME */, TRUE);
             }
             break;
 
diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c
index 0e69124..417aadb 100644
--- a/dlls/dbghelp/pe_module.c
+++ b/dlls/dbghelp/pe_module.c
@@ -214,13 +214,13 @@ static BOOL pe_load_export_debug_info(co
 #if 0
     /* Add start of DLL (better use the (yet unimplemented) Exe SymTag for this) */
     /* FIXME: module.ModuleName isn't correctly set yet if it's passed in SymLoadModule */
-    symt_new_public(module, NULL, module->module.ModuleName, base, 0,
+    symt_new_public(module, NULL, module->module.ModuleName, base, 1,
                     TRUE /* FIXME */, TRUE /* FIXME */);
 #endif
     
     /* Add entry point */
     symt_new_public(module, NULL, "EntryPoint", 
-                    base + nth->OptionalHeader.AddressOfEntryPoint, 0,
+                    base + nth->OptionalHeader.AddressOfEntryPoint, 1,
                     TRUE, TRUE);
 #if 0
     /* FIXME: we'd better store addresses linked to sections rather than 
@@ -233,7 +233,7 @@ static BOOL pe_load_export_debug_info(co
     {
 	symt_new_public(module, NULL, section->Name, 
                         RtlImageRvaToVa(nth, (void*)mapping, section->VirtualAddress, NULL), 
-                        0, TRUE /* FIXME */, TRUE /* FIXME */);
+                        1, TRUE /* FIXME */, TRUE /* FIXME */);
     }
 #endif
 
@@ -257,7 +257,7 @@ static BOOL pe_load_export_debug_info(co
             symt_new_public(module, NULL, 
                             RtlImageRvaToVa(nth, (void*)mapping, names[i], NULL),
                             base + functions[ordinals[i]], 
-                            0, TRUE /* FIXME */, TRUE /* FIXME */);
+                            1, TRUE /* FIXME */, TRUE /* FIXME */);
         }
 	    
         for (i = 0; i < exports->NumberOfFunctions; i++) 
@@ -268,7 +268,7 @@ static BOOL pe_load_export_debug_info(co
                 if ((ordinals[j] == i) && names[j]) break;
             if (j < exports->NumberOfNames) continue;
             snprintf(buffer, sizeof(buffer), "%ld", i + exports->Base);
-            symt_new_public(module, NULL, buffer, base + (DWORD)functions[i], 0,
+            symt_new_public(module, NULL, buffer, base + (DWORD)functions[i], 1,
                             TRUE /* FIXME */, TRUE /* FIXME */);
         }
     }
diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c
index 016e14f..6458a6e 100644
--- a/dlls/dbghelp/symbol.c
+++ b/dlls/dbghelp/symbol.c
@@ -639,7 +639,7 @@ int symt_find_nearest(struct module* mod
     if (high)
     {
         symt_get_info(&module->addr_sorttab[high - 1]->symt, TI_GET_ADDRESS, &ref_addr);
-        if (!symt_get_info(&module->addr_sorttab[high - 1]->symt,  TI_GET_LENGTH, &ref_size) || !ref_size)
+        if (!symt_get_info(&module->addr_sorttab[high - 1]->symt, TI_GET_LENGTH, &ref_size) || !ref_size)
             ref_size = 0x1000; /* arbitrary value */
         if (addr >= ref_addr + ref_size) return -1;
     }




More information about the wine-cvs mailing list