summaryrefslogtreecommitdiff
path: root/gdb/corelow.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-01-10 16:30:34 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-01-10 16:30:34 +0000
commitd4166d7e5fcfd74010f3e548cf1bd50f0de8ac1e (patch)
tree7db8cc034d2704911562ea74adcd21de33a26c5b /gdb/corelow.c
parentbcd1f26d006587d538265966a022f780770bb873 (diff)
downloadgdb-d4166d7e5fcfd74010f3e548cf1bd50f0de8ac1e.tar.gz
gdb/
Fix duplicate .o files after omitting libbfd.a. * Makefile.in (ALL_TARGET_OBS): Remove corelow.o. (SFILES): Add corelow.c. (COMMON_OBS): Add corelow.o. (ALLDEPFILES): Remove corelow.c. * config/alpha/alpha-linux.mh (NATDEPFILES): Remove corelow.o. * config/alpha/alpha-osf3.mh: Likewise. * config/alpha/fbsd.mh: Likewise. * config/arm/nbsdaout.mh: Likewise. * config/arm/nbsdelf.mh: Likewise. * config/i386/i386gnu.mh: Likewise. * config/ia64/hpux.mh: Likewise. * config/ia64/linux.mh: Likewise. * config/m32r/linux.mh: Likewise. * config/m68k/linux.mh: Likewise. * config/mips/irix5.mh: Likewise. * config/mips/irix6.mh: Likewise. * config/pa/hpux.mh: Likewise. * config/pa/linux.mh: Likewise. * config/powerpc/aix.mh: Likewise. * config/sparc/linux.mh: Likewise. * config/sparc/linux64.mh: Likewise. * config/sparc/sol2.mh: Likewise. * config/vax/vax.mh: Likewise. * configure.tgt (alpha*-*-freebsd* alpha*-*-kfreebsd*-gnu) (alpha*-*-netbsd*, alpha*-*-knetbsd*-gnu, alpha*-*-openbsd*) (am33_2.0*-*-linux*, arm*-wince-pe, arm*-*-mingw32ce*, arm*-*-linux*) (arm*-*-openbsd*, cris*, frv-*-*, hppa*-*-hpux*, hppa*-*-netbsd*) (hppa*-*-openbsd*, i[34567]86-*-dicos*, i[34567]86-*-freebsd*) (i[34567]86-*-kfreebsd*-gnu, i[34567]86-*-netbsd*) (i[34567]86-*-knetbsd*-gnu, i[34567]86-*-openbsd*, i[34567]86-*-nto*) (i[34567]86-*-solaris2.1[0-9]*, x86_64-*-solaris2.1[0-9]*) (i[34567]86-*-solaris*, i[34567]86-*-linux*, i[34567]86-*-cygwin*) (i[34567]86-*-mingw32*, m68*-*-netbsd*, m68*-*-knetbsd*-gnu) (m68*-*-openbsd*, m88*-*-openbsd*, microblaze*-linux-*) (microblaze*-*-linux*, mips*-*-linux*, mips*-*-netbsd*) (mips*-*-knetbsd*-gnu, mips64*-*-openbsd*, powerpc-*-netbsd*) (powerpc-*-knetbsd*-gnu, powerpc-*-openbsd*, powerpc-*-linux*) (powerpc64-*-linux*, s390*-*-*, score-*-*, sh*-*-linux*) (sh*-*-netbsdelf*, sh*-*-knetbsd*-gnu, sh*-*-openbsd*) (sparc*-*-freebsd*, sparc*-*-kfreebsd*-gnu, sparc-*-netbsd*) (sparc-*-knetbsd*-gnu, sparc64-*-netbsd*, sparc64-*-knetbsd*-gnu) (sparc-*-openbsd*, sparc64-*-openbsd*, tic6x-*-*linux, vax-*-netbsd*) (vax-*-knetbsd*-gnu, vax-*-openbsd*, x86_64-*-dicos*, x86_64-*-linux*) (x86_64-*-freebsd*, x86_64-*-kfreebsd*-gnu, x86_64-*-netbsd*) (x86_64-*-knetbsd*-gnu, x86_64-*-openbsd*, xtensa*-*-linux*): Remove corelow.o from gdb_target_obs. * corefile.c (core_target): Update the comment on NULL value. (core_file_command): Replace error by gdb_assert on CORE_TARGET. * corelow.c (sniff_core_bfd): Call error instead of warning on zero MATCHES. Drop YUMMY set on NULL. (core_close): Do not call exit_inferior_silent on zero PID. Do not reclaim CORE_DATA if it is already NULL.
Diffstat (limited to 'gdb/corelow.c')
-rw-r--r--gdb/corelow.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/gdb/corelow.c b/gdb/corelow.c
index f98814a902b..3e0c7cd0f7d 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -129,8 +129,7 @@ default_core_sniffer (struct core_fns *our_fns, bfd *abfd)
}
/* Walk through the list of core functions to find a set that can
- handle the core file open on ABFD. Default to the first one in the
- list if nothing matches. Returns pointer to set that is
+ handle the core file open on ABFD. Returns pointer to set that is
selected. */
static struct core_fns *
@@ -159,15 +158,9 @@ sniff_core_bfd (bfd *abfd)
bfd_get_filename (abfd), matches);
}
else if (matches == 0)
- {
- warning (_("\"%s\": no core file handler "
- "recognizes format, using default"),
- bfd_get_filename (abfd));
- }
- if (yummy == NULL)
- {
- yummy = core_file_fns;
- }
+ error (_("\"%s\": no core file handler recognizes format"),
+ bfd_get_filename (abfd));
+
return (yummy);
}
@@ -211,15 +204,19 @@ core_close (int quitting)
int pid = ptid_get_pid (inferior_ptid);
inferior_ptid = null_ptid; /* Avoid confusion from thread
stuff. */
- exit_inferior_silent (pid);
+ if (pid != 0)
+ exit_inferior_silent (pid);
/* Clear out solib state while the bfd is still open. See
comments in clear_solib in solib.c. */
clear_solib ();
- xfree (core_data->sections);
- xfree (core_data);
- core_data = NULL;
+ if (core_data)
+ {
+ xfree (core_data->sections);
+ xfree (core_data);
+ core_data = NULL;
+ }
core_has_fake_pid = 0;
name = bfd_get_filename (core_bfd);