forked from Imagelibrary/binutils-gdb
gdb/
2012-11-27 Daniel Jacobowitz <dan@codesourcery.com> Kazu Hirata <kazu@codesourcery.com> Yao Qi <yao@codesourcery.com> * objfiles.c (init_entry_point_info): Call gdbarch_convert_from_func_ptr_addr and gdbarch_addr_bits_remove here ... (entry_point_address_query): ... instead of here. * solib-svr4.c (exec_entry_point): Call gdbarch_addr_bits_remove. * symfile.c (generic_load): Call gdbarch_addr_bits_remove on the entry address.
This commit is contained in:
@@ -1,3 +1,16 @@
|
|||||||
|
2012-11-27 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
Kazu Hirata <kazu@codesourcery.com>
|
||||||
|
Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
|
* objfiles.c (init_entry_point_info): Call
|
||||||
|
gdbarch_convert_from_func_ptr_addr and
|
||||||
|
gdbarch_addr_bits_remove here ...
|
||||||
|
(entry_point_address_query): ... instead of here.
|
||||||
|
* solib-svr4.c (exec_entry_point): Call
|
||||||
|
gdbarch_addr_bits_remove.
|
||||||
|
* symfile.c (generic_load): Call gdbarch_addr_bits_remove on
|
||||||
|
the entry address.
|
||||||
|
|
||||||
2012-11-27 Daniel Jacobowitz <dan@codesourcery.com>
|
2012-11-27 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
Yao Qi <yao@codesourcery.com>
|
Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
|
|||||||
@@ -353,6 +353,23 @@ init_entry_point_info (struct objfile *objfile)
|
|||||||
/* Examination of non-executable.o files. Short-circuit this stuff. */
|
/* Examination of non-executable.o files. Short-circuit this stuff. */
|
||||||
objfile->ei.entry_point_p = 0;
|
objfile->ei.entry_point_p = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (objfile->ei.entry_point_p)
|
||||||
|
{
|
||||||
|
CORE_ADDR entry_point = objfile->ei.entry_point;
|
||||||
|
|
||||||
|
/* Make certain that the address points at real code, and not a
|
||||||
|
function descriptor. */
|
||||||
|
entry_point
|
||||||
|
= gdbarch_convert_from_func_ptr_addr (objfile->gdbarch,
|
||||||
|
entry_point,
|
||||||
|
¤t_target);
|
||||||
|
|
||||||
|
/* Remove any ISA markers, so that this matches entries in the
|
||||||
|
symbol table. */
|
||||||
|
objfile->ei.entry_point
|
||||||
|
= gdbarch_addr_bits_remove (objfile->gdbarch, entry_point);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If there is a valid and known entry point, function fills *ENTRY_P with it
|
/* If there is a valid and known entry point, function fills *ENTRY_P with it
|
||||||
@@ -361,26 +378,11 @@ init_entry_point_info (struct objfile *objfile)
|
|||||||
int
|
int
|
||||||
entry_point_address_query (CORE_ADDR *entry_p)
|
entry_point_address_query (CORE_ADDR *entry_p)
|
||||||
{
|
{
|
||||||
struct gdbarch *gdbarch;
|
|
||||||
CORE_ADDR entry_point;
|
|
||||||
|
|
||||||
if (symfile_objfile == NULL || !symfile_objfile->ei.entry_point_p)
|
if (symfile_objfile == NULL || !symfile_objfile->ei.entry_point_p)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
gdbarch = get_objfile_arch (symfile_objfile);
|
*entry_p = symfile_objfile->ei.entry_point;
|
||||||
|
|
||||||
entry_point = symfile_objfile->ei.entry_point;
|
|
||||||
|
|
||||||
/* Make certain that the address points at real code, and not a
|
|
||||||
function descriptor. */
|
|
||||||
entry_point = gdbarch_convert_from_func_ptr_addr (gdbarch, entry_point,
|
|
||||||
¤t_target);
|
|
||||||
|
|
||||||
/* Remove any ISA markers, so that this matches entries in the
|
|
||||||
symbol table. */
|
|
||||||
entry_point = gdbarch_addr_bits_remove (gdbarch, entry_point);
|
|
||||||
|
|
||||||
*entry_p = entry_point;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1388,6 +1388,8 @@ svr4_in_dynsym_resolve_code (CORE_ADDR pc)
|
|||||||
static CORE_ADDR
|
static CORE_ADDR
|
||||||
exec_entry_point (struct bfd *abfd, struct target_ops *targ)
|
exec_entry_point (struct bfd *abfd, struct target_ops *targ)
|
||||||
{
|
{
|
||||||
|
CORE_ADDR addr;
|
||||||
|
|
||||||
/* KevinB wrote ... for most targets, the address returned by
|
/* KevinB wrote ... for most targets, the address returned by
|
||||||
bfd_get_start_address() is the entry point for the start
|
bfd_get_start_address() is the entry point for the start
|
||||||
function. But, for some targets, bfd_get_start_address() returns
|
function. But, for some targets, bfd_get_start_address() returns
|
||||||
@@ -1396,9 +1398,10 @@ exec_entry_point (struct bfd *abfd, struct target_ops *targ)
|
|||||||
gdbarch_convert_from_func_ptr_addr(). The method
|
gdbarch_convert_from_func_ptr_addr(). The method
|
||||||
gdbarch_convert_from_func_ptr_addr() is the merely the identify
|
gdbarch_convert_from_func_ptr_addr() is the merely the identify
|
||||||
function for targets which don't use function descriptors. */
|
function for targets which don't use function descriptors. */
|
||||||
return gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
|
addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
|
||||||
bfd_get_start_address (abfd),
|
bfd_get_start_address (abfd),
|
||||||
targ);
|
targ);
|
||||||
|
return gdbarch_addr_bits_remove (target_gdbarch (), addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Helper function for gdb_bfd_lookup_symbol. */
|
/* Helper function for gdb_bfd_lookup_symbol. */
|
||||||
|
|||||||
@@ -2150,6 +2150,7 @@ generic_load (char *args, int from_tty)
|
|||||||
gettimeofday (&end_time, NULL);
|
gettimeofday (&end_time, NULL);
|
||||||
|
|
||||||
entry = bfd_get_start_address (loadfile_bfd);
|
entry = bfd_get_start_address (loadfile_bfd);
|
||||||
|
entry = gdbarch_addr_bits_remove (target_gdbarch (), entry);
|
||||||
ui_out_text (uiout, "Start address ");
|
ui_out_text (uiout, "Start address ");
|
||||||
ui_out_field_fmt (uiout, "address", "%s", paddress (target_gdbarch (), entry));
|
ui_out_field_fmt (uiout, "address", "%s", paddress (target_gdbarch (), entry));
|
||||||
ui_out_text (uiout, ", load size ");
|
ui_out_text (uiout, ", load size ");
|
||||||
|
|||||||
Reference in New Issue
Block a user