mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 16:05:56 +08:00
Handle TLS variable lookups when using separate debug files.
Commit df22c1e5d53c38f38bce6072bb46de240f9e0e2b handled the case that a separate debug file was passed as the objfile for a shared library to svr4_fetch_objfile_link_map. However, a separate debug file can also be passed for TLS variables in the main executable. In addition, frv_fetch_objfile_link_map also expects to be passed the original objfile rather than a separate debug file, so pull the code to resolve a separate debug file to the main objfile up into target_translate_tls_address.
This commit is contained in:
@ -1453,11 +1453,6 @@ svr4_fetch_objfile_link_map (struct objfile *objfile)
|
||||
if (objfile == current_program_space->symfile_object_file)
|
||||
return info->main_lm_addr;
|
||||
|
||||
/* If OBJFILE is a separate debug object file, look for the
|
||||
original object file. */
|
||||
if (objfile->separate_debug_objfile_backlink != NULL)
|
||||
objfile = objfile->separate_debug_objfile_backlink;
|
||||
|
||||
/* The other link map addresses may be found by examining the list
|
||||
of shared libraries. */
|
||||
for (struct so_list *so : current_program_space->solibs ())
|
||||
|
@ -1296,6 +1296,11 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
|
||||
struct target_ops *target = current_inferior ()->top_target ();
|
||||
struct gdbarch *gdbarch = target_gdbarch ();
|
||||
|
||||
/* If OBJFILE is a separate debug object file, look for the
|
||||
original object file. */
|
||||
if (objfile->separate_debug_objfile_backlink != NULL)
|
||||
objfile = objfile->separate_debug_objfile_backlink;
|
||||
|
||||
if (gdbarch_fetch_tls_load_module_address_p (gdbarch))
|
||||
{
|
||||
ptid_t ptid = inferior_ptid;
|
||||
|
Reference in New Issue
Block a user