winedbg: Fixed listing source of function in file.

Dylan Smith dylan.ah.smith at gmail.com
Sat Aug 22 00:57:37 CDT 2009


The problem can easily be seen from the error message shown from listing
the source for DllMain for one of the dlls using the c source file
that contains it.

First of all the function and file parameters were swapped.

Secondly the filename was not being compared to the filename for the
current symbol, which would cause an exception if there are any matching
symbols.
---
 programs/winedbg/dbg.y    |    2 +-
 programs/winedbg/symbol.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
-------------- next part --------------
diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y
index 30ecdde..c1dcfd1 100644
--- a/programs/winedbg/dbg.y
+++ b/programs/winedbg/dbg.y
@@ -181,7 +181,7 @@ list_arg:
       tNUM		        { $$.FileName = NULL; $$.LineNumber = $1; }
     | pathname ':' tNUM	        { $$.FileName = $1; $$.LineNumber = $3; }
     | identifier	        { symbol_get_line(NULL, $1, &$$); }
-    | pathname ':' identifier   { symbol_get_line($3, $1, &$$); }
+    | pathname ':' identifier   { symbol_get_line($1, $3, &$$); }
     | '*' expr_lvalue	        { DWORD disp; $$.SizeOfStruct = sizeof($$);
                                   SymGetLineFromAddr(dbg_curr_process->handle, (unsigned long)memory_to_linear_addr(& $2.addr), &disp, & $$); }
     ;
diff --git a/programs/winedbg/symbol.c b/programs/winedbg/symbol.c
index 3a34e61..e0553e7 100644
--- a/programs/winedbg/symbol.c
+++ b/programs/winedbg/symbol.c
@@ -606,7 +606,7 @@ BOOL symbol_get_line(const char* filename, const char* name, IMAGEHLP_LINE* line
         il.SizeOfStruct = sizeof(il);
         if (!SymGetLineFromAddr(dbg_curr_process->handle, linear, &disp, &il))
             continue;
-        if (filename && strcmp(line->FileName, filename)) continue;
+        if (filename && strcmp(il.FileName, filename)) continue;
         if (found)
         {
             WINE_FIXME("Several found, returning first (may not be what you want)...\n");


More information about the wine-patches mailing list