Use the ELF sections for the addresses of globals, as the STABS are

likely to be wrong.
oldstable
Richard Cohen 2003-08-07 02:56:55 +00:00 committed by Alexandre Julliard
parent 387ca9ba89
commit 574f058bae
2 changed files with 6 additions and 3 deletions

View File

@ -225,7 +225,9 @@ DEBUG_AddSymbol( const char * name, const DBG_VALUE *value,
* - a second time with the correct address
* SYM_INVALID is set for the first pass, and cleared in the second
* the code below gets most of information for both passes
* latest GCC version seem to provide correct address in first pass,
*
* some GCC versions may provide the correct address in the first pass
* but it does not seem to be sensible to rely on that.
*/
if (nh->value.addr.seg == 0 && nh->value.addr.off == 0 && c != 0)
{

View File

@ -980,16 +980,17 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, void *load_offset,
*
* With a.out or mingw, they actually do make some amount of sense.
*/
new_value.addr.seg = 0;
new_value.type = DEBUG_ParseStabType(ptr);
new_value.addr.off = (unsigned long)load_offset + stab_ptr->n_value;
new_value.addr.seg = 0;
new_value.cookie = DV_TARGET;
stab_strcpy(symname, sizeof(symname), ptr);
#ifdef __ELF__
new_value.addr.off = 0;
curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath,
SYM_WINE | SYM_DATA | SYM_INVALID );
#else
new_value.addr.off = (unsigned long)load_offset + stab_ptr->n_value;
curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath,
SYM_WINE | SYM_DATA );
#endif