From 784c859246ae2cf3ffa07376cfe8ec60e4526e57 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 29 Oct 2020 15:04:33 -0600 Subject: [PATCH] Remove commented-out code from gcore.c I found some code in gcore.c that has been commented out since d3420b2fce5e (Mark Kettenis 2003-09-04 166) #if 1 /* See if this even matters... */ This patch deletes this entire function, because the body was reduced to just "return 0". gdb/ChangeLog 2020-10-29 Tom Tromey * gcore.c (default_gcore_mach): Remove. (create_gcore_bfd): Update. --- gdb/ChangeLog | 5 +++++ gdb/gcore.c | 21 +-------------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d06ea476097..13d6e5693c4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-10-29 Tom Tromey + + * gcore.c (default_gcore_mach): Remove. + (create_gcore_bfd): Update. + 2020-10-29 Tom Tromey * progspace.c (program_space::exec_close): New method, from diff --git a/gdb/gcore.c b/gdb/gcore.c index 15721f8244d..54b43aa96e0 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -46,7 +46,6 @@ static const char *default_gcore_target (void); static enum bfd_architecture default_gcore_arch (void); -static unsigned long default_gcore_mach (void); static int gcore_memory_sections (bfd *); /* create_gcore_bfd -- helper for gcore_command (exported). @@ -60,7 +59,7 @@ create_gcore_bfd (const char *filename) if (obfd == NULL) error (_("Failed to open '%s' for output."), filename); bfd_set_format (obfd.get (), bfd_core); - bfd_set_arch_mach (obfd.get (), default_gcore_arch (), default_gcore_mach ()); + bfd_set_arch_mach (obfd.get (), default_gcore_arch (), 0); return obfd; } @@ -165,24 +164,6 @@ gcore_command (const char *args, int from_tty) fprintf_filtered (gdb_stdout, "Saved corefile %s\n", corefilename.get ()); } -static unsigned long -default_gcore_mach (void) -{ -#if 1 /* See if this even matters... */ - return 0; -#else - - const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (target_gdbarch ()); - - if (bfdarch != NULL) - return bfdarch->mach; - if (exec_bfd == NULL) - error (_("Can't find default bfd machine type (need execfile).")); - - return bfd_get_mach (exec_bfd); -#endif /* 1 */ -} - static enum bfd_architecture default_gcore_arch (void) { -- 2.30.2