diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-08-21 22:56:02 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-08-21 22:56:02 +0000 |
commit | 5bf1c6772ca8927f688e01411a57a7cefc606a30 (patch) | |
tree | 204865656b6fff1da02136aa31d78b0c65ea4b85 | |
parent | 18f8152171f99de62076ca888f2903e70796b474 (diff) | |
download | gdb-5bf1c6772ca8927f688e01411a57a7cefc606a30.zip gdb-5bf1c6772ca8927f688e01411a57a7cefc606a30.tar.gz gdb-5bf1c6772ca8927f688e01411a57a7cefc606a30.tar.bz2 |
2002-08-21 Elena Zannoni <ezannoni@redhat.com>
* rs6000-tdep.c (rs6000_gdbarch_init): Figure out whether we have
an e500 executable.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/rs6000-tdep.c | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a2c78b9..c010aeb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-08-21 Elena Zannoni <ezannoni@redhat.com> + + * rs6000-tdep.c (rs6000_gdbarch_init): Figure out whether we have + an e500 executable. + 2002-08-21 Michael Snyder <msnyder@redhat.com> * mips-tdep.c (MSYMBOL_IS_SPECIAL): Replace macro with function. diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 864ac64..1878bcb 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2426,6 +2426,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) bfd abfd; int sysv_abi; enum gdb_osabi osabi = GDB_OSABI_UNKNOWN; + asection *sect; from_xcoff_exec = info.abfd && info.abfd->format == bfd_object && bfd_get_flavour (info.abfd) == bfd_target_xcoff_flavour; @@ -2499,6 +2500,27 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep = xmalloc (sizeof (struct gdbarch_tdep)); tdep->wordsize = wordsize; tdep->osabi = osabi; + + /* For e500 executables, the apuinfo section is of help here. Such + section contains the identifier and revision number of each + Application-specific Processing Unit that is present on the + chip. The content of the section is determined by the assembler + which looks at each instruction and determines which unit (and + which version of it) can execute it. In our case we just look for + the existance of the section. */ + + if (info.abfd) + { + sect = bfd_get_section_by_name (info.abfd, ".PPC.EMB.apuinfo"); + if (sect) + { + arch = info.bfd_arch_info->arch; + mach = bfd_mach_ppc_e500; + bfd_default_set_arch_mach (&abfd, arch, mach); + info.bfd_arch_info = bfd_get_arch_info (&abfd); + } + } + gdbarch = gdbarch_alloc (&info, tdep); power = arch == bfd_arch_rs6000; |