Commit 574f058b authored by Richard Cohen's avatar Richard Cohen Committed by Alexandre Julliard

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

likely to be wrong.
parent 387ca9ba
...@@ -225,7 +225,9 @@ DEBUG_AddSymbol( const char * name, const DBG_VALUE *value, ...@@ -225,7 +225,9 @@ DEBUG_AddSymbol( const char * name, const DBG_VALUE *value,
* - a second time with the correct address * - a second time with the correct address
* SYM_INVALID is set for the first pass, and cleared in the second * SYM_INVALID is set for the first pass, and cleared in the second
* the code below gets most of information for both passes * 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) if (nh->value.addr.seg == 0 && nh->value.addr.off == 0 && c != 0)
{ {
......
...@@ -980,16 +980,17 @@ enum DbgInfoLoad DEBUG_ParseStabs(char * addr, void *load_offset, ...@@ -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. * 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.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; new_value.cookie = DV_TARGET;
stab_strcpy(symname, sizeof(symname), ptr); stab_strcpy(symname, sizeof(symname), ptr);
#ifdef __ELF__ #ifdef __ELF__
new_value.addr.off = 0;
curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath, curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath,
SYM_WINE | SYM_DATA | SYM_INVALID ); SYM_WINE | SYM_DATA | SYM_INVALID );
#else #else
new_value.addr.off = (unsigned long)load_offset + stab_ptr->n_value;
curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath, curr_sym = DEBUG_AddSymbol( symname, &new_value, currpath,
SYM_WINE | SYM_DATA ); SYM_WINE | SYM_DATA );
#endif #endif
......
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