From: Mark Kettenis Date: Sun, 30 May 2004 18:29:10 +0000 (+0000) Subject: * fbsd-proc.c: Include "regcache.h", "regset.h" and X-Git-Tag: gdb_6_2-2004-07-10-gmt-branchpoint~375 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e781c2f1384e11d66ddc7dfdefad0938d1bc0198;p=pf3gnuchains%2Fpf3gnuchains4x.git * fbsd-proc.c: Include "regcache.h", "regset.h" and "gdb_assert.h". Con't include "gregset.h". (fbsd_make_corefile_notes): Use regset-based core file support instead off fill_gregset and fill_fpregset. * Makefile.in (fbsd-proc.o): Update dependencies. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2a7600e125..b6fce9f0f7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2004-05-30 Mark Kettenis + * fbsd-proc.c: Include "regcache.h", "regset.h" and + "gdb_assert.h". Con't include "gregset.h". + (fbsd_make_corefile_notes): Use regset-based core file support + instead off fill_gregset and fill_fpregset. + * Makefile.in (fbsd-proc.o): Update dependencies. + * m88k-tdep.c (m88k_analyze_prologue): Fix handling of branch instructions. (m88k_frame_prev_register): Simplify code a bit. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index b32499b08b..681e9bd2e6 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1760,7 +1760,8 @@ expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \ $(value_h) $(language_h) $(parser_defs_h) $(user_regs_h) $(target_h) \ $(gdb_string_h) $(block_h) fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_h) \ - $(gdb_string_h) $(elf_bfd_h) $(gregset_h) + $(regcache_h) $(regset_h) $(gdb_assert_h) $(gdb_string_h) \ + $(elf_bfd_h) f-exp.o: f-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(value_h) \ $(parser_defs_h) $(language_h) $(f_lang_h) $(bfd_h) $(symfile_h) \ $(objfiles_h) $(block_h) diff --git a/gdb/fbsd-proc.c b/gdb/fbsd-proc.c index 16813a9a1c..8eed4ccb2c 100644 --- a/gdb/fbsd-proc.c +++ b/gdb/fbsd-proc.c @@ -22,15 +22,16 @@ #include "defs.h" #include "gdbcore.h" #include "inferior.h" -#include "gdb_string.h" +#include "regcache.h" +#include "regset.h" +#include "gdb_assert.h" +#include "gdb_string.h" #include #include #include "elf-bfd.h" -#include "gregset.h" - char * child_pid_to_exec_file (int pid) { @@ -120,21 +121,35 @@ fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long, static char * fbsd_make_corefile_notes (bfd *obfd, int *note_size) { + struct gdbarch *gdbarch = current_gdbarch; + const struct regcache *regcache = current_regcache; gregset_t gregs; fpregset_t fpregs; char *note_data = NULL; Elf_Internal_Ehdr *i_ehdrp; + const struct regset *regset; + size_t size; /* Put a "FreeBSD" label in the ELF header. */ i_ehdrp = elf_elfheader (obfd); i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; - fill_gregset (&gregs, -1); + gdb_assert (gdbarch_regset_from_core_section_p (gdbarch)); + + size = sizeof gregs; + regset = gdbarch_regset_from_core_section (gdbarch, ".reg", size); + gdb_assert (regset && regset->collect_regset); + regset->collect_regset (regset, regcache, -1, &gregs, size); + note_data = elfcore_write_prstatus (obfd, note_data, note_size, ptid_get_pid (inferior_ptid), stop_signal, &gregs); - fill_fpregset (&fpregs, -1); + size = sizeof fpregs; + regset = gdbarch_regset_from_core_section (gdbarch, ".reg2", size); + gdb_assert (regset && regset->collect_regset); + regset->collect_regset (regset, regcache, -1, &fpregs, size); + note_data = elfcore_write_prfpreg (obfd, note_data, note_size, &fpregs, sizeof (fpregs));