|
40 | 40 | #include "trad-frame.h" |
41 | 41 | #include "frame-unwind.h" |
42 | 42 |
|
| 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 | + |
43 | 48 | /* If the kernel has to deliver a signal, it pushes a sigcontext |
44 | 49 | structure on the stack and then calls the signal handler, passing |
45 | 50 | the address of the sigcontext in an argument register. Usually |
@@ -449,6 +454,36 @@ rs6000_aix_iterate_over_regset_sections (struct gdbarch *gdbarch, |
449 | 454 |
|
450 | 455 | } |
451 | 456 |
|
| 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 | +} |
452 | 487 |
|
453 | 488 | /* Pass the arguments in either registers, or in the stack. In RS/6000, |
454 | 489 | 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) |
1347 | 1382 | (gdbarch, rs6000_aix_iterate_over_regset_sections); |
1348 | 1383 | set_gdbarch_core_xfer_shared_libraries_aix |
1349 | 1384 | (gdbarch, rs6000_aix_core_xfer_shared_libraries_aix); |
| 1385 | + set_gdbarch_core_read_description (gdbarch, ppc_aix_core_read_description); |
1350 | 1386 |
|
1351 | 1387 | if (tdep->wordsize == 8) |
1352 | 1388 | tdep->lr_frame_offset = 16; |
|
0 commit comments