summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* * elflink.c (_bfd_elf_merge_symbol): Revert last change. MoveAlan Modra2004-03-194-73/+42
| | | | | | | | | | | | | | type and size change code to where it was previously. Remove dt_needed param. Treat old weak syms as strong if new sym is from a shared lib, even when old sym is from another shared lib. Remove unnecessary tests of oldweak and newweak. Correct comments. (_bfd_elf_add_default_symbol): Remove dt_needed param. Update _bfd_elf_merge_symbol calls. * elflink.h (elf_link_add_object_symbols): Update calls. Remove dt_needed local var. Update comments. * elf-bfd.h (_bfd_elf_merge_symbol): Update prototype. (_bfd_elf_add_default_symbol): Likewise.
* *** empty log message ***gdbadmin2004-03-191-1/+1
|
* 2004-03-18 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-182-12/+3
| | | | | * stack.c (return_command): Delete code wrapped in #ifdef DEPRECATED_CALL_DUMMY_HAS_COMPLETED, macro no longer defined.
* * elflink.c (_bfd_elf_merge_symbol): Reinstate code to handleAlan Modra2004-03-182-0/+29
| | | | strong syms in one shared object overriding weak syms in another.
* daily updateAlan Modra2004-03-181-1/+1
|
* 2004-03-18 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-182-2/+23
| | | | * rs6000-tdep.c (skip_prologue): Record only the first LR save.
* 2004-03-18 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-182-91/+66
| | | | | * gdbint.texinfo (Coding): Update section on gdbarch_data, describe pre_init and post_init.
* 2004-03-18 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-1812-17/+32
| | | | | | | | | | | | | | | * config/mips/tm-nbsd.h: Replace IN_SIGTRAMP with DEPRECATED_IN_SIGTRAMP. * config/powerpc/tm-linux.h (DEPRECATED_IN_SIGTRAMP): Ditto. * config/mips/tm-linux.h (DEPRECATED_IN_SIGTRAMP) Ditto. * config/mips/tm-irix6.h (DEPRECATED_IN_SIGTRAMP): Ditto. * config/mips/tm-irix5.h (DEPRECATED_IN_SIGTRAMP): Ditto. * config/ia64/tm-linux.h (DEPRECATED_IN_SIGTRAMP): Ditto. * config/ia64/tm-aix.h (DEPRECATED_IN_SIGTRAMP): Ditto. * config/arm/tm-linux.h (DEPRECATED_IN_SIGTRAMP): Ditto. * config/arm/tm-embed.h (DEPRECATED_IN_SIGTRAMP): Ditto. * arch-utils.c (legacy_pc_in_sigtramp): Ditto. * arch-utils.h: Remove reference to IN_SIGTRAMP in comment.
* 2004-03-18 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-183-40/+41
| | | | | | | | | | | | | | * frame-base.c: Update copyright. Include "gdb_obstack.h". (struct frame_base_table_entry): Define. (struct frame_base_table): Re-implement as a linked list. (frame_base_init): Re-implement. (frame_base_table): Delete function. (append_predicate): Delete function. (frame_base_append_sniffer): Update. (frame_base_set_default): Update. (frame_base_find_by_frame): Update. (_initialize_frame_base): Use gdbarch_data_register_pre_init. * Makefile.in (frame-base.o): Update dependencies.
* bfd/Alan Modra2004-03-186-138/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field. Add dyn_lib_class field. Rearrange for better packing. (elf_dt_soname): Delete. (elf_dyn_lib_class): Define. * elf.c (bfd_elf_set_dt_needed_name): Update comment. (bfd_elf_set_dt_needed_soname): Delete. (bfd_elf_set_dyn_lib_class): New function. * elflink.h (add_dt_needed_tag): New function. Split out from.. (elf_link_add_object_symbols): ..here. Rename "name" to "soname". Use elf_dyn_lib_class to set dt_needed and add_needed. Move fallback initialization of soname. (elf_link_check_versioned_symbol): Test elf_dyn_lib_class instead of elf_dt_soname. * bfd-in.h (enum dynamic_lib_link_class): New. (bfd_elf_set_dt_needed_soname): Delete. (bfd_elf_set_dyn_lib_class): Declare. * bfd-in2.h: Regenerate. ld/ * ld.texinfo: Add --as-needed doco. * ldmain.c (as_needed): New global var. * ldmain.h (as_needed): Declare. * lexsup.c (option_values): Add OPTION_AS_NEEDED and OPTION_NO_AS_NEEDED. (ld_options): Likewise. (parse_args): Handle them. * ldlang.h (lang_input_statement_type): Add as_needed field. * ldlang.c (new_afile): Set p->as_needed. * emultempl/elf32.em (gld${EMULATION_NAME}_load_symbols): New function. (gld${EMULATION_NAME}_try_needed): Use bfd_elf_set_dyn_lib_class. (ld_${EMULATION_NAME}_emulation): Set LDEMUL_RECOGNIZED_FILE entry. * ldlang.c (open_input_bfds): Remove useless cast. (lang_do_assignments_1): Likewise. (lang_for_each_input_section): Delete.
* * elflink.c (_bfd_elf_merge_symbol): Rewrite weak symbol handling.Alan Modra2004-03-183-142/+54
| | | | | | (_bfd_elf_add_default_symbol): Remove indirect BFD_ASSERTs. * elflink.h (elf_link_add_object_symbols): Don't clear dt_needed in symbol loop. Instead use add_needed to flag tag as written.
* merge from gccDJ Delorie2004-03-183-17/+73
|
* merge from gccDJ Delorie2004-03-182-27/+35
|
* *** empty log message ***gdbadmin2004-03-181-1/+1
|
* 2004-03-17 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-172-1/+6
| | | | | * frame.c (legacy_get_prev_frame): Pass correct frame to frame_unwind_find_by_frame.
* daily updateAlan Modra2004-03-171-1/+1
|
* 2004-03-17 David Carlton <carlton@kealia.com>David Carlton2004-03-172-2/+7
| | | | | * gdb.cp/classes.exp (test_enums): Refer to PR c++/1588 instead of PR c++/826.
* 2004-03-17 Paolo Bonzini <bonzini@gnu.org>Nathanael Nerode2004-03-175-126/+40
| | | | | | | * configure.in: Remove symbolic link section. * configure: Regenerate. * Makefile.tpl (links): Remove. * Makefile.in: Regenerate.
* 2004-03-17 David Carlton <carlton@kealia.com>David Carlton2004-03-172-0/+16
| | | | * NEWS: Mention C++ nested types and namespaces
* * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): CorrectNathan Sidwell2004-03-172-4/+9
| | | | logic for null_input_bfd detection.
* 2004-03-16 Michael Chastain <mec.gnu@mindspring.com>Michael Chastain2004-03-172-5/+39
| | | | | | * PROBLEMS: Add section headers, "Regressions since gdb 6.0" and "Regressions since gdb 5.3.". Add known regressions since gdb 6.0.
* Switch sh-*-rtems* to ELF. Add sh-*-rtemscoff*.Alan Modra2004-03-172-2/+11
|
* Fix typo in ChangeLog entry.Mark Kettenis2004-03-171-2/+2
|
* *** empty log message ***gdbadmin2004-03-171-1/+1
|
* daily updateAlan Modra2004-03-161-1/+1
|
* 2004-03-16 David Carlton <carlton@kealia.com>David Carlton2004-03-162-17/+24
| | | | | * dwarf2read.c (process_structure_scope): Process children even when we're a declaration.
* 2004-03-15 Paolo Bonzini <bonzini@gnu.org>Nathanael Nerode2004-03-163-130/+140
| | | | | | | | | Nathanael Nerode <neroden@gcc.gnu.org> * configure.in (DEFAULT_YACC, DEFAULT_M4, DEFAULT_LEX): Set with AC_CHECK_PROGS. * configure.in: Fix comment typo from last patch. * configure: Regenerate.
* .Roland McGrath2004-03-161-161/+166
|
* 2004-03-16 Roland McGrath <roland@redhat.com>Roland McGrath2004-03-162-0/+245
| | | | | * gdb.base/auxv.exp: New file. * gdb.base/auxv.c: New file, copied verbatim from coremaker2.c.
* 2004-03-16 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-163-31/+27
| | | | | | | * symtab.h (find_pc_sect_partial_function): Delete declaration. * blockframe.c (find_pc_partial_function) (find_pc_sect_partial_function): Merge into a single find_pc_partial_function.
* * i386bsd-nat.c: s/regno/regnum/g.Mark Kettenis2004-03-162-35/+42
| | | | | | (fetch_inferior_registers): Use I386_ST0_REGNUM instead of FP0_REGNUM. (store_inferior_registers): Likewise.
* * i386bsd-nat.c (fill_fpregset): Call i387_collect_fsave insteadMark Kettenis2004-03-162-4/+12
| | | | | | | of i387_fill_fsave. (store_inferior_registers): Call i387_collect_fsave and i387_collect_fxsave instead of i387_fill_fsave and i387_fill_fxsave.
* * netbsd-core.c (netbsd_core_file_p) [CORE_FPU_OFFSET]: RemoveMark Kettenis2004-03-162-21/+6
| | | | code.
* Revert "lsdx", "lsdi", "stsdx", "stsdi", "lmd" and "stmd" insns.Alan Modra2004-03-162-14/+1
|
* copyright date.Alan Modra2004-03-162-3/+3
|
* * elflink.c (elf_link_read_relocs_from_section): Don't useAlan Modra2004-03-163-15/+16
| | | | | | NUM_SHDR_ENTRIES in end of reloc calc. Move NULL shdr check.. (_bfd_elf_link_read_relocs): ..to here. * elf32-ppc.c (ppc_elf_relax_section): Formatting.
* * configure.in (HOST_64BIT_TYPE, HOST_U_64BIT_TYPE): Don't overrideAlan Modra2004-03-163-52/+56
| | | | | | | | | | | values selected in configure.host. Require both to be defined before setting BFD_HOST_64_BIT_DEFINED. Protect assignment to corresponding BFD_HOST vars with quotes. <${host64}-${target64}-${want64} in *true*>: Don't exempt gcc; Always require BFD_HOST_64_BIT_DEFINED. <file_ptr type>: Find off_t size before emitting message. Combine off_t and ftello64 conditional. * configure: Regenerate.
* * elf32-m32r.c (m32r_elf_create_dynamic_sections): Fix pointerAlan Modra2004-03-162-144/+150
| | | | aliasing warning. Remove trailing whitespace throughout file.
* opcodes/Alan Modra2004-03-165-137/+173
| | | | | | | | | | | | | | | | | | | * ppc-dis.c (print_insn_powerpc): Don't print tabs. Handle PPC_OPERANDS_GPR_0. * ppc-opc.c (RA0): Define. (RAQ, RAL, RAM, RAS, RSQ, RTQ, RSO): Use PPC_OPERAND_GPR_0. (RAOPT): Rename from RAO. Update all uses. (powerpc_opcodes): Use RA0 as appropriate. Add "lsdx", "lsdi", "stsdx", "stsdi", "lmd" and "stmd" insns. include/opcode/ * ppc.h (PPC_OPERAND_GPR_0): Define. Bump other operand defines. gas/testsuite/ Update gas/ppc/. ld/testsuite/ Update ld-powerpc/.
* 2004-03-15 Nathanael Nerode <neroden@gcc.gnu.org>Nathanael Nerode2004-03-165-66/+709
| | | | | | | * Makefile.tpl: Introduce experimental top level bootstrap support. * Makefile.in: Regenerate. * configure.in: Introduce support for top level bootstrap. * configure: Regenerate.
* *** empty log message ***gdbadmin2004-03-161-1/+1
|
* 2004-03-15 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-153-30/+39
| | | | | | | | | | | | | | | * Makefile.in (frame-unwind.o): Update dependencies. * frame-unwind.c: Include "gdb_obstack.h". (frame_unwind_init): Replace "gdbarch" parameter with an "obstack" parameter. (append_predicate): Delete function. (struct frame_unwind_table_entry): New structure. (struct frame_unwind_table): Replace "sniffer" with "head" and "tail". (frame_unwind_append_sniffer): Update. (frame_unwind_find_by_frame): Update. (_initialize_frame_unwind): Registe frame_unwind_init using gdbarch_data_register_pre_init.
* * i386bsd-nat.c: Update copyright year.Mark Kettenis2004-03-152-5/+10
| | | | | (CANNOT_FETCH_REGISTER, CANNOT_STORE_REGISTER): Undefine and then define unconditionally.
* daily updateAlan Modra2004-03-151-1/+1
|
* * i387-tdep.h (i387_collect_fsave): New prototype.Mark Kettenis2004-03-153-5/+30
| | | | | | * i387-tdep.c (i387_collect_fsave): New function containing most of the code from i387_fill_fsave. (i387_fill_fsave): Call i387_fill_fsave.
* * i386-linux-tdep.c: Update copyright year.Mark Kettenis2004-03-152-46/+16
| | | | | | | (i386_linux_svr4_fetch_link_map_offsets): Remove function. (i386_linux_init_abi): Set solib_svr4_fetch_link_maop_offsets to svr4_ilp32_link_map_offsets instead of i386_linux_svr4_fetch_link_map_offsets.
* 2004-03-15 David Carlton <carlton@kealia.com>David Carlton2004-03-152-131/+107
| | | | | | | | | | Fix for PR c++/1553: * dwarf2read.c (read_structure_type): Determine type name by calling determine_class_name. (determine_class_name): New. (determine_prefix): Look at TYPE_TAG_NAME and call determine_class_name when appropriate. (determine_prefix_aux, class_name): Delete.
* * breakpoint.c (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT): DeleteKevin Buettner2004-03-152-5/+6
| | | | | unused macro definition. The definition in target.h (or perhaps elsewhere) takes precedence.
* 2004-03-15 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-154-64/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ppc-tdep.h: Update copyright. (ppc_linux_supply_gregset, ppc_linux_supply_fpregset): Change function signatures to match "regsets.h". * ppc-linux-tdep.c: Include "regset.h". (ELF_GREGSET_SIZE): Delete. (right_supply_register): New function. (ppc_linux_supply_fpregset, ppc_linux_supply_gregset): Rewrite using right_supply_register. (ppc32_linux_supply_gregset, ppc64_linux_supply_gregset): New functions. (ppc64_linux_gregset, ppc32_linux_gregset): Define. (ppc_linux_init_abi): Register ppc_linux_regset_from_core_section. (_initialize_ppc_linux_tdep): Do not register ppc_linux_regset_core_fns. (ppc_linux_regset_from_core_section): Replace fetch_core_registers. (ppc_linux_regset_core_fns): Delete. * ppc-linux-nat.c: (right_fill_reg): New function. (supply_gregset): Update call to ppc_linux_supply_gregset. (fill_gregset): Clear the register set, use right_fill_reg. (supply_fpregset): Update call to ppc_linux_supply_fpregset. (fill_fpregset): Use right_fill_reg, correctly compute FP offsets. Index: ppc-linux-nat.c =================================================================== RCS file: /cvs/src/src/gdb/ppc-linux-nat.c,v retrieving revision 1.28 diff -u -r1.28 ppc-linux-nat.c --- ppc-linux-nat.c 8 Mar 2004 01:45:02 -0000 1.28 +++ ppc-linux-nat.c 15 Mar 2004 21:28:31 -0000 @@ -507,7 +507,24 @@ void supply_gregset (gdb_gregset_t *gregsetp) { - ppc_linux_supply_gregset ((char *) gregsetp); + /* NOTE: cagney/2003-11-25: This is the word size used by the ptrace + interface, and not the wordsize of the program's ABI. */ + int wordsize = sizeof (PTRACE_XFER_TYPE); + ppc_linux_supply_gregset (current_regcache, -1, gregsetp, + sizeof (gdb_gregset_t), wordsize); +} + +static void +right_fill_reg (int regnum, void *reg) +{ + /* NOTE: cagney/2003-11-25: This is the word size used by the ptrace + interface, and not the wordsize of the program's ABI. */ + int wordsize = sizeof (PTRACE_XFER_TYPE); + /* Right fill the register. */ + regcache_raw_collect (current_regcache, regnum, + ((bfd_byte *) reg + + wordsize + - register_size (current_gdbarch, regnum))); } void @@ -516,36 +533,42 @@ int regi; elf_greg_t *regp = (elf_greg_t *) gregsetp; struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + const int elf_ngreg = 48; + + + /* Start with zeros. */ + memset (regp, 0, elf_ngreg * sizeof (*regp)); for (regi = 0; regi < 32; regi++) { if ((regno == -1) || regno == regi) - regcache_collect (regi, regp + PT_R0 + regi); + right_fill_reg (regi, (regp + PT_R0 + regi)); } if ((regno == -1) || regno == PC_REGNUM) - regcache_collect (PC_REGNUM, regp + PT_NIP); + right_fill_reg (PC_REGNUM, regp + PT_NIP); if ((regno == -1) || regno == tdep->ppc_lr_regnum) - regcache_collect (tdep->ppc_lr_regnum, regp + PT_LNK); + right_fill_reg (tdep->ppc_lr_regnum, regp + PT_LNK); if ((regno == -1) || regno == tdep->ppc_cr_regnum) regcache_collect (tdep->ppc_cr_regnum, regp + PT_CCR); if ((regno == -1) || regno == tdep->ppc_xer_regnum) regcache_collect (tdep->ppc_xer_regnum, regp + PT_XER); if ((regno == -1) || regno == tdep->ppc_ctr_regnum) - regcache_collect (tdep->ppc_ctr_regnum, regp + PT_CTR); + right_fill_reg (tdep->ppc_ctr_regnum, regp + PT_CTR); #ifdef PT_MQ if (((regno == -1) || regno == tdep->ppc_mq_regnum) && (tdep->ppc_mq_regnum != -1)) - regcache_collect (tdep->ppc_mq_regnum, regp + PT_MQ); + right_fill_reg (tdep->ppc_mq_regnum, regp + PT_MQ); #endif if ((regno == -1) || regno == tdep->ppc_ps_regnum) - regcache_collect (tdep->ppc_ps_regnum, regp + PT_MSR); + right_fill_reg (tdep->ppc_ps_regnum, regp + PT_MSR); } void supply_fpregset (gdb_fpregset_t * fpregsetp) { - ppc_linux_supply_fpregset ((char *) fpregsetp); + ppc_linux_supply_fpregset (NULL, current_regcache, -1, fpregsetp, + sizeof (gdb_fpregset_t)); } /* Given a pointer to a floating point register set in /proc format @@ -557,12 +580,13 @@ { int regi; struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + bfd_byte *fpp = (void *) fpregsetp; for (regi = 0; regi < 32; regi++) { if ((regno == -1) || (regno == FP0_REGNUM + regi)) - regcache_collect (FP0_REGNUM + regi, (char *) (*fpregsetp + regi)); + regcache_collect (FP0_REGNUM + regi, fpp + 8 * regi); } if ((regno == -1) || regno == tdep->ppc_fpscr_regnum) - regcache_collect (tdep->ppc_fpscr_regnum, (char *) (*fpregsetp + regi)); + right_fill_reg (tdep->ppc_fpscr_regnum, (fpp + 8 * 32)); } Index: ppc-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v retrieving revision 1.50 diff -u -r1.50 ppc-linux-tdep.c --- ppc-linux-tdep.c 16 Feb 2004 21:49:22 -0000 1.50 +++ ppc-linux-tdep.c 15 Mar 2004 21:28:31 -0000 @@ -32,7 +32,7 @@ #include "regcache.h" #include "value.h" #include "osabi.h" - +#include "regset.h" #include "solib-svr4.h" #include "ppc-tdep.h" @@ -959,81 +959,114 @@ }; enum { - ELF_GREGSET_SIZE = (ELF_NGREG * 4), ELF_FPREGSET_SIZE = (ELF_NFPREG * 8) }; +static void +right_supply_register (struct regcache *regcache, int wordsize, int regnum, + const bfd_byte *buf) +{ + regcache_raw_supply (regcache, regnum, + (buf + wordsize + - register_size (current_gdbarch, regnum))); +} + +/* Extract the register values found in the WORDSIZED ABI GREGSET, + storing their values in REGCACHE. Note that some are left-aligned, + while others are right aligned. */ + void -ppc_linux_supply_gregset (char *buf) +ppc_linux_supply_gregset (struct regcache *regcache, + int regnum, const void *gregs, size_t size, + int wordsize) { int regi; - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + struct gdbarch *regcache_arch = get_regcache_arch (regcache); + struct gdbarch_tdep *regcache_tdep = gdbarch_tdep (regcache_arch); + const bfd_byte *buf = gregs; for (regi = 0; regi < 32; regi++) - supply_register (regi, buf + 4 * regi); + right_supply_register (regcache, wordsize, regi, buf + wordsize * regi); + + right_supply_register (regcache, wordsize, gdbarch_pc_regnum (regcache_arch), + buf + wordsize * PPC_LINUX_PT_NIP); + right_supply_register (regcache, wordsize, regcache_tdep->ppc_lr_regnum, + buf + wordsize * PPC_LINUX_PT_LNK); + regcache_raw_supply (regcache, regcache_tdep->ppc_cr_regnum, + buf + wordsize * PPC_LINUX_PT_CCR); + regcache_raw_supply (regcache, regcache_tdep->ppc_xer_regnum, + buf + wordsize * PPC_LINUX_PT_XER); + regcache_raw_supply (regcache, regcache_tdep->ppc_ctr_regnum, + buf + wordsize * PPC_LINUX_PT_CTR); + if (regcache_tdep->ppc_mq_regnum != -1) + right_supply_register (regcache, wordsize, regcache_tdep->ppc_mq_regnum, + buf + wordsize * PPC_LINUX_PT_MQ); + right_supply_register (regcache, wordsize, regcache_tdep->ppc_ps_regnum, + buf + wordsize * PPC_LINUX_PT_MSR); +} - supply_register (PC_REGNUM, buf + 4 * PPC_LINUX_PT_NIP); - supply_register (tdep->ppc_lr_regnum, buf + 4 * PPC_LINUX_PT_LNK); - supply_register (tdep->ppc_cr_regnum, buf + 4 * PPC_LINUX_PT_CCR); - supply_register (tdep->ppc_xer_regnum, buf + 4 * PPC_LINUX_PT_XER); - supply_register (tdep->ppc_ctr_regnum, buf + 4 * PPC_LINUX_PT_CTR); - if (tdep->ppc_mq_regnum != -1) - supply_register (tdep->ppc_mq_regnum, buf + 4 * PPC_LINUX_PT_MQ); - supply_register (tdep->ppc_ps_regnum, buf + 4 * PPC_LINUX_PT_MSR); +static void +ppc32_linux_supply_gregset (const struct regset *regset, + struct regcache *regcache, + int regnum, const void *gregs, size_t size) +{ + ppc_linux_supply_gregset (regcache, regnum, gregs, size, 4); } +static struct regset ppc32_linux_gregset = { + NULL, ppc32_linux_supply_gregset +}; + +static void +ppc64_linux_supply_gregset (const struct regset *regset, + struct regcache * regcache, + int regnum, const void *gregs, size_t size) +{ + ppc_linux_supply_gregset (regcache, regnum, gregs, size, 8); +} + +static struct regset ppc64_linux_gregset = { + NULL, ppc64_linux_supply_gregset +}; + void -ppc_linux_supply_fpregset (char *buf) +ppc_linux_supply_fpregset (const struct regset *regset, + struct regcache * regcache, + int regnum, const void *fpset, size_t size) { int regi; - struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + struct gdbarch *regcache_arch = get_regcache_arch (regcache); + struct gdbarch_tdep *regcache_tdep = gdbarch_tdep (regcache_arch); + const bfd_byte *buf = fpset; for (regi = 0; regi < 32; regi++) - supply_register (FP0_REGNUM + regi, buf + 8 * regi); + regcache_raw_supply (regcache, FP0_REGNUM + regi, buf + 8 * regi); /* The FPSCR is stored in the low order word of the last doubleword in the fpregset. */ - supply_register (tdep->ppc_fpscr_regnum, buf + 8 * 32 + 4); + regcache_raw_supply (regcache, regcache_tdep->ppc_fpscr_regnum, + buf + 8 * 32 + 4); } -/* - Use a local version of this function to get the correct types for regsets. -*/ +static struct regset ppc_linux_fpregset = { NULL, ppc_linux_supply_fpregset }; -static void -fetch_core_registers (char *core_reg_sect, - unsigned core_reg_size, - int which, - CORE_ADDR reg_addr) +static const struct regset * +ppc_linux_regset_from_core_section (struct gdbarch *core_arch, + const char *sect_name, size_t sect_size) { - if (which == 0) + struct gdbarch_tdep *tdep = gdbarch_tdep (core_arch); + if (strcmp (sect_name, ".reg") == 0) { - if (core_reg_size == ELF_GREGSET_SIZE) - ppc_linux_supply_gregset (core_reg_sect); + if (tdep->wordsize == 4) + return &ppc32_linux_gregset; else - warning ("wrong size gregset struct in core file"); - } - else if (which == 2) - { - if (core_reg_size == ELF_FPREGSET_SIZE) - ppc_linux_supply_fpregset (core_reg_sect); - else - warning ("wrong size fpregset struct in core file"); + return &ppc64_linux_gregset; } + if (strcmp (sect_name, ".reg2") == 0) + return &ppc_linux_fpregset; + return NULL; } -/* Register that we are able to handle ELF file formats using standard - procfs "regset" structures. */ - -static struct core_fns ppc_linux_regset_core_fns = -{ - bfd_target_elf_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; - static void ppc_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -1086,6 +1119,7 @@ /* PPC64 malloc's entry-point is called ".malloc". */ set_gdbarch_name_of_malloc (gdbarch, ".malloc"); } + set_gdbarch_regset_from_core_section (gdbarch, ppc_linux_regset_from_core_section); } void @@ -1099,5 +1133,4 @@ ppc_linux_init_abi); gdbarch_register_osabi (bfd_arch_rs6000, bfd_mach_rs6k, GDB_OSABI_LINUX, ppc_linux_init_abi); - add_core_fns (&ppc_linux_regset_core_fns); } Index: ppc-tdep.h =================================================================== RCS file: /cvs/src/src/gdb/ppc-tdep.h,v retrieving revision 1.25 diff -u -r1.25 ppc-tdep.h --- ppc-tdep.h 10 Nov 2003 22:47:28 -0000 1.25 +++ ppc-tdep.h 15 Mar 2004 21:28:31 -0000 @@ -1,6 +1,7 @@ /* Target-dependent code for GDB, the GNU debugger. - Copyright 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. + + Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, + Inc. This file is part of GDB. @@ -62,8 +63,12 @@ CORE_ADDR bpaddr); int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache); struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void); -void ppc_linux_supply_gregset (char *buf); -void ppc_linux_supply_fpregset (char *buf); +void ppc_linux_supply_gregset (struct regcache *regcache, + int regnum, const void *gregs, size_t size, + int wordsize); +void ppc_linux_supply_fpregset (const struct regset *regset, + struct regcache *regcache, + int regnum, const void *gregs, size_t size); enum return_value_convention ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *valtype,
* 2004-03-15 Andrew Cagney <cagney@redhat.com>Andrew Cagney2004-03-152-2/+7
| | | | | * rs6000-tdep.c (rs6000_register_virtual_type): Make registers unsigned.