Commit 721452df authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Added offset for relocating symbols in symbolfile command.

parent d0c87253
......@@ -145,7 +145,8 @@ command:
| tUNDISPLAY tEOL { DEBUG_DelDisplay( -1 ); }
| tCOND tNUM tEOL { DEBUG_AddBPCondition($2, NULL); }
| tCOND tNUM expr tEOL { DEBUG_AddBPCondition($2, $3); }
| tSYMBOLFILE pathname tEOL { DEBUG_ReadSymbolTable($2); }
| tSYMBOLFILE pathname tEOL { DEBUG_ReadSymbolTable($2, 0); }
| tSYMBOLFILE pathname tNUM tEOL { DEBUG_ReadSymbolTable($2, $3); }
| tWHATIS expr_addr tEOL { DEBUG_PrintType(&$2); DEBUG_FreeExprMem(); }
| tATTACH tNUM tEOL { DEBUG_Attach($2, FALSE); }
| tDETACH tEOL { return DEBUG_Detach(); /* FIXME: we shouldn't return, but since we cannot simply clean the symbol table, exit debugger for now */ }
......
......@@ -358,7 +358,7 @@ extern const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag,
struct name_hash ** rtn,
unsigned int ebp,
struct list_id * source);
extern void DEBUG_ReadSymbolTable( const char * filename );
extern void DEBUG_ReadSymbolTable( const char * filename, unsigned long offset );
extern void DEBUG_AddLineNumber( struct name_hash * func, int line_num,
unsigned long offset );
extern struct wine_locals *
......
......@@ -797,7 +797,7 @@ const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag,
*
* Read a symbol file into the hash table.
*/
void DEBUG_ReadSymbolTable( const char* filename )
void DEBUG_ReadSymbolTable( const char* filename, unsigned long offset )
{
FILE * symbolfile;
DBG_VALUE value;
......@@ -839,7 +839,12 @@ void DEBUG_ReadSymbolTable( const char* filename )
if (!(*cpnt) || *cpnt == '\n') continue;
if (sscanf(buffer, "%lx %c %s", &value.addr.off, &type, name) == 3)
{
if (value.addr.off + offset < value.addr.off)
DEBUG_Printf( DBG_CHN_WARN, "Address wrap around\n");
value.addr.off += offset;
DEBUG_AddSymbol( name, &value, NULL, SYM_WINE );
}
}
fclose(symbolfile);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment