diff options
author | Yao Qi <yao@codesourcery.com> | 2012-11-27 08:11:59 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2012-11-27 08:11:59 +0000 |
commit | 8c2b9656fa3178519c007ed4c1a2a3da6b61bcaa (patch) | |
tree | 2babdacb1bb99e1ca27bc9590cee581e1033a5d5 /gdb/objfiles.c | |
parent | 5edf51feeade2be8b6ab6d49507a6023a6d9a176 (diff) | |
download | gdb-8c2b9656fa3178519c007ed4c1a2a3da6b61bcaa.zip gdb-8c2b9656fa3178519c007ed4c1a2a3da6b61bcaa.tar.gz gdb-8c2b9656fa3178519c007ed4c1a2a3da6b61bcaa.tar.bz2 |
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.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 4cc2fea..e5681fa 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -353,6 +353,23 @@ init_entry_point_info (struct objfile *objfile) /* Examination of non-executable.o files. Short-circuit this stuff. */ 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 @@ -361,26 +378,11 @@ init_entry_point_info (struct objfile *objfile) int 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) return 0; - gdbarch = get_objfile_arch (symfile_objfile); - - 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 = symfile_objfile->ei.entry_point; - *entry_p = entry_point; return 1; } |