Use the ELF sections for the addresses of globals, as the STABS are
likely to be wrong.
This commit is contained in:
parent
387ca9ba89
commit
574f058bae
|
@ -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,
|
||||||
*
|
*
|
||||||
* 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
|
||||||
|
|
Loading…
Reference in New Issue