gdb: Make use of 'add_info' to create info sub-commands.
[deliverable/binutils-gdb.git] / gdb / fbsd-tdep.c
index a60fbc24f8f1e54057fdf38b0b8cd7a46fd9e22b..d7a59838f183992eb66647c55192f904eaa03525 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for FreeBSD, architecture-independent.
 
-   Copyright (C) 2002-2014 Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,9 +24,6 @@
 #include "regset.h"
 #include "gdbthread.h"
 
-#include "gdb_assert.h"
-#include <string.h>
-
 #include "elf-bfd.h"
 #include "fbsd-tdep.h"
 
@@ -67,11 +64,12 @@ fbsd_collect_regset_section_cb (const char *sect_name, int size,
                                const char *human_name, void *cb_data)
 {
   char *buf;
-  struct fbsd_collect_regset_section_cb_data *data = cb_data;
+  struct fbsd_collect_regset_section_cb_data *data
+    = (struct fbsd_collect_regset_section_cb_data *) cb_data;
 
   gdb_assert (regset->collect_regset);
 
-  buf = xmalloc (size);
+  buf = (char *) xmalloc (size);
   regset->collect_regset (regset, data->regcache, -1, buf, size);
 
   /* PRSTATUS still needs to be treated specially.  */
@@ -92,7 +90,7 @@ fbsd_collect_regset_section_cb (const char *sect_name, int size,
 static char *
 fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
 {
-  const struct regcache *regcache = get_current_regcache ();
+  struct regcache *regcache = get_current_regcache ();
   char *note_data;
   Elf_Internal_Ehdr *i_ehdrp;
   struct fbsd_collect_regset_section_cb_data data;
@@ -107,6 +105,7 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
   data.obfd = obfd;
   data.note_data = NULL;
   data.note_size = note_size;
+  target_fetch_registers (regcache, -1);
   gdbarch_iterate_over_regset_sections (gdbarch,
                                        fbsd_collect_regset_section_cb,
                                        &data, regcache);
This page took 0.025931 seconds and 4 git commands to generate.