X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gdb%2Fi386-cygwin-tdep.c;h=ed75ea37419906c65001fbddb13f85cfed3bbfeb;hb=7170dadf5950e1444ab09cdfc4e07dd2698fc275;hp=a23f80e973be880c0ac1fd05e11ed12abe223e14;hpb=ecc37a5acc8ff504d62487149f61955343d35fcf;p=binutils-gdb.git diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c index a23f80e973b..ed75ea37419 100644 --- a/gdb/i386-cygwin-tdep.c +++ b/gdb/i386-cygwin-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for Cygwin running on i386's, for GDB. - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. This file is part of GDB. @@ -19,7 +19,6 @@ #include "defs.h" #include "osabi.h" -#include #include "i386-tdep.h" #include "windows-tdep.h" #include "regset.h" @@ -89,20 +88,6 @@ static int i386_windows_gregset_reg_offset[] = #define I386_WINDOWS_SIZEOF_GREGSET 716 -/* Return the appropriate register set for the core section identified - by SECT_NAME and SECT_SIZE. */ - -static const struct regset * -i386_windows_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, size_t sect_size) -{ - if (strcmp (sect_name, ".reg") == 0 - && sect_size == I386_WINDOWS_SIZEOF_GREGSET) - return &i386_gregset; - - return NULL; -} - struct cpms_data { struct gdbarch *gdbarch; @@ -113,7 +98,7 @@ struct cpms_data static void core_process_module_section (bfd *abfd, asection *sect, void *obj) { - struct cpms_data *data = obj; + struct cpms_data *data = (struct cpms_data *) obj; enum bfd_endian byte_order = gdbarch_byte_order (data->gdbarch); char *module_name; @@ -122,10 +107,10 @@ core_process_module_section (bfd *abfd, asection *sect, void *obj) gdb_byte *buf = NULL; - if (strncmp (sect->name, ".module", 7) != 0) + if (!startswith (sect->name, ".module")) return; - buf = xmalloc (bfd_get_section_size (sect) + 1); + buf = (gdb_byte *) xmalloc (bfd_get_section_size (sect) + 1); if (!buf) { printf_unfiltered ("memory allocation failed for %s\n", sect->name); @@ -178,7 +163,7 @@ windows_core_xfer_shared_libraries (struct gdbarch *gdbarch, &data); obstack_grow_str0 (&obstack, "\n"); - buf = obstack_finish (&obstack); + buf = (const char *) obstack_finish (&obstack); len_avail = strlen (buf); if (offset >= len_avail) return 0; @@ -193,14 +178,14 @@ windows_core_xfer_shared_libraries (struct gdbarch *gdbarch, /* This is how we want PTIDs from core files to be printed. */ -static char * +static const char * i386_windows_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid) { static char buf[80]; - if (ptid_get_lwp (ptid) != 0) + if (ptid.lwp () != 0) { - snprintf (buf, sizeof (buf), "Thread 0x%lx", ptid_get_lwp (ptid)); + snprintf (buf, sizeof (buf), "Thread 0x%lx", ptid.lwp ()); return buf; } @@ -236,9 +221,9 @@ i386_cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->gregset_num_regs = ARRAY_SIZE (i386_windows_gregset_reg_offset); tdep->sizeof_gregset = I386_WINDOWS_SIZEOF_GREGSET; + tdep->sizeof_fpregset = 0; + /* Core file support. */ - set_gdbarch_regset_from_core_section - (gdbarch, i386_windows_regset_from_core_section); set_gdbarch_core_xfer_shared_libraries (gdbarch, windows_core_xfer_shared_libraries); set_gdbarch_core_pid_to_str (gdbarch, i386_windows_core_pid_to_str); @@ -267,9 +252,6 @@ i386_cygwin_osabi_sniffer (bfd *abfd) return GDB_OSABI_UNKNOWN; } -/* Provide a prototype to silence -Wmissing-prototypes. */ -void _initialize_i386_cygwin_tdep (void); - void _initialize_i386_cygwin_tdep (void) {