Skip to content

Commit a8ea150

Browse files
KamathForAIXuweigand
authored andcommitted
Enable vector register visibility in core for AIX.
This patch enables AIX folks to see vector register contents while they analyse the core file.
1 parent 5d47e20 commit a8ea150

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

gdb/rs6000-aix-tdep.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
#include "trad-frame.h"
4141
#include "frame-unwind.h"
4242

43+
#include "features/rs6000/powerpc-altivec32.c"
44+
#include "features/rs6000/powerpc-vsx32.c"
45+
#include "features/rs6000/powerpc-altivec64.c"
46+
#include "features/rs6000/powerpc-vsx64.c"
47+
4348
/* If the kernel has to deliver a signal, it pushes a sigcontext
4449
structure on the stack and then calls the signal handler, passing
4550
the address of the sigcontext in an argument register. Usually
@@ -449,6 +454,36 @@ rs6000_aix_iterate_over_regset_sections (struct gdbarch *gdbarch,
449454

450455
}
451456

457+
/* Read core file description for AIX. */
458+
459+
static const struct target_desc *
460+
ppc_aix_core_read_description (struct gdbarch *gdbarch,
461+
struct target_ops *target,
462+
bfd *abfd)
463+
{
464+
asection *altivec = bfd_get_section_by_name (abfd, ".aix-vmx");
465+
asection *vsx = bfd_get_section_by_name (abfd, ".aix-vsx");
466+
asection *section = bfd_get_section_by_name (abfd, ".reg");
467+
ppc_gdbarch_tdep *tdep = gdbarch_tdep<ppc_gdbarch_tdep> (gdbarch);
468+
469+
if (!section)
470+
return NULL;
471+
472+
int arch64 = 0;
473+
if (tdep->wordsize == 8)
474+
arch64 = 1;
475+
476+
if (vsx && arch64)
477+
return tdesc_powerpc_vsx64;
478+
else if (vsx && !arch64)
479+
return tdesc_powerpc_vsx32;
480+
else if (altivec && arch64)
481+
return tdesc_powerpc_altivec64;
482+
else if (altivec && !arch64)
483+
return tdesc_powerpc_altivec32;
484+
485+
return NULL;
486+
}
452487

453488
/* Pass the arguments in either registers, or in the stack. In RS/6000,
454489
the first eight words of the argument list (that might be less than
@@ -1347,6 +1382,7 @@ rs6000_aix_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
13471382
(gdbarch, rs6000_aix_iterate_over_regset_sections);
13481383
set_gdbarch_core_xfer_shared_libraries_aix
13491384
(gdbarch, rs6000_aix_core_xfer_shared_libraries_aix);
1385+
set_gdbarch_core_read_description (gdbarch, ppc_aix_core_read_description);
13501386

13511387
if (tdep->wordsize == 8)
13521388
tdep->lr_frame_offset = 16;

0 commit comments

Comments
 (0)