2002-01-09 00:37:02 +00:00
|
|
|
/* Generate a core file for the inferior process.
|
2003-01-13 Andrew Cagney <ac131313@redhat.com>
* ax-gdb.c, c-valprint.c, charset.c, corefile.c: Update copyright.
* demangle.c, disasm.c, dwarf2cfi.c, dwarfread.c: Update copyright.
* elfread.c, eval.c, expprint.c, expression.h: Update copyright.
* f-typeprint.c, findvar.c, gcore.c, gdb_mbuild.sh: Update copyright.
* gdbtypes.h, gnu-v2-abi.c, inferior.h, inftarg.c: Update copyright.
* language.c, language.h, m32r-tdep.c: Update copyright.
* mn10200-tdep.c, scm-lang.c, scm-lang.h: Update copyright.
* somsolib.c, somsolib.h, symfile.c, symtab.h: Update copyright.
* thread-db.c, typeprint.c, utils.c, valarith.c: Update copyright.
* values.c, win32-nat.c, x86-64-linux-nat.c: Update copyright.
* x86-64-linux-tdep.c, z8k-tdep.c: Update copyright.
* cli/cli-decode.h, config/h8500/tm-h8500.h: Update copyright.
Index: mi/ChangeLog
2003-01-13 Andrew Cagney <ac131313@redhat.com>
* mi-cmd-env.c: Update copyright.
2003-01-14 00:49:06 +00:00
|
|
|
|
2011-01-01 15:34:07 +00:00
|
|
|
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
|
|
|
2011 Free Software Foundation, Inc.
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-23 18:08:50 +00:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-01-09 00:37:02 +00:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-23 18:08:50 +00:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
#include "defs.h"
|
2003-09-04 21:05:49 +00:00
|
|
|
#include "elf-bfd.h"
|
|
|
|
#include "infcall.h"
|
2002-01-09 00:37:02 +00:00
|
|
|
#include "inferior.h"
|
|
|
|
#include "gdbcore.h"
|
|
|
|
#include "objfiles.h"
|
2009-12-01 22:46:15 +00:00
|
|
|
#include "solib.h"
|
2003-09-04 21:05:49 +00:00
|
|
|
#include "symfile.h"
|
2009-10-22 19:36:06 +00:00
|
|
|
#include "arch-utils.h"
|
|
|
|
#include "completer.h"
|
|
|
|
#include "gcore.h"
|
2003-09-04 21:05:49 +00:00
|
|
|
#include "cli/cli-decode.h"
|
|
|
|
#include "gdb_assert.h"
|
2009-10-22 19:36:06 +00:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include "regcache.h"
|
|
|
|
#include "regset.h"
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2006-10-20 22:06:28 +00:00
|
|
|
/* The largest amount of memory to read from the target at once. We
|
|
|
|
must throttle it to limit the amount of memory used by GDB during
|
|
|
|
generate-core-file for programs with large resident data. */
|
|
|
|
#define MAX_COPY_BYTES (1024 * 1024)
|
|
|
|
|
2009-06-17 18:48:26 +00:00
|
|
|
static const char *default_gcore_target (void);
|
2003-09-04 21:05:49 +00:00
|
|
|
static enum bfd_architecture default_gcore_arch (void);
|
|
|
|
static unsigned long default_gcore_mach (void);
|
|
|
|
static int gcore_memory_sections (bfd *);
|
|
|
|
|
2009-10-22 19:36:06 +00:00
|
|
|
/* create_gcore_bfd -- helper for gcore_command (exported).
|
|
|
|
Open a new bfd core file for output, and return the handle. */
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2009-10-22 19:36:06 +00:00
|
|
|
bfd *
|
|
|
|
create_gcore_bfd (char *filename)
|
2002-01-09 00:37:02 +00:00
|
|
|
{
|
2009-10-22 19:36:06 +00:00
|
|
|
bfd *obfd = bfd_openw (filename, default_gcore_target ());
|
2010-05-14 20:17:37 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
if (!obfd)
|
2009-10-22 19:36:06 +00:00
|
|
|
error (_("Failed to open '%s' for output."), filename);
|
2002-01-09 00:37:02 +00:00
|
|
|
bfd_set_format (obfd, bfd_core);
|
|
|
|
bfd_set_arch_mach (obfd, default_gcore_arch (), default_gcore_mach ());
|
2009-10-22 19:36:06 +00:00
|
|
|
return obfd;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* write_gcore_file -- helper for gcore_command (exported).
|
|
|
|
Compose and write the corefile data to the core file. */
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
write_gcore_file (bfd *obfd)
|
|
|
|
{
|
|
|
|
void *note_data = NULL;
|
|
|
|
int note_size = 0;
|
|
|
|
asection *note_sec = NULL;
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* An external target method must build the notes section. */
|
|
|
|
note_data = target_make_corefile_notes (obfd, ¬e_size);
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Create the note section. */
|
2002-01-09 00:37:02 +00:00
|
|
|
if (note_data != NULL && note_size != 0)
|
|
|
|
{
|
2007-06-20 18:32:10 +00:00
|
|
|
note_sec = bfd_make_section_anyway_with_flags (obfd, "note0",
|
|
|
|
SEC_HAS_CONTENTS
|
|
|
|
| SEC_READONLY
|
|
|
|
| SEC_ALLOC);
|
2003-09-04 21:05:49 +00:00
|
|
|
if (note_sec == NULL)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("Failed to create 'note' section for corefile: %s"),
|
2002-01-09 00:37:02 +00:00
|
|
|
bfd_errmsg (bfd_get_error ()));
|
|
|
|
|
|
|
|
bfd_set_section_vma (obfd, note_sec, 0);
|
|
|
|
bfd_set_section_alignment (obfd, note_sec, 0);
|
|
|
|
bfd_set_section_size (obfd, note_sec, note_size);
|
|
|
|
}
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Now create the memory/load sections. */
|
2002-01-09 00:37:02 +00:00
|
|
|
if (gcore_memory_sections (obfd) == 0)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("gcore: failed to get corefile memory sections from target."));
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Write out the contents of the note section. */
|
2002-01-09 00:37:02 +00:00
|
|
|
if (note_data != NULL && note_size != 0)
|
|
|
|
{
|
|
|
|
if (!bfd_set_section_contents (obfd, note_sec, note_data, 0, note_size))
|
2009-10-22 19:36:06 +00:00
|
|
|
warning (_("writing note section (%s)"),
|
|
|
|
bfd_errmsg (bfd_get_error ()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-02-16 20:48:52 +00:00
|
|
|
static void
|
|
|
|
do_bfd_delete_cleanup (void *arg)
|
|
|
|
{
|
|
|
|
bfd *obfd = arg;
|
|
|
|
const char *filename = obfd->filename;
|
|
|
|
|
|
|
|
bfd_close (arg);
|
|
|
|
unlink (filename);
|
|
|
|
}
|
|
|
|
|
2009-10-22 19:36:06 +00:00
|
|
|
/* gcore_command -- implements the 'gcore' command.
|
|
|
|
Generate a core file from the inferior process. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gcore_command (char *args, int from_tty)
|
|
|
|
{
|
|
|
|
struct cleanup *old_chain;
|
|
|
|
char *corefilename, corefilename_buffer[40];
|
|
|
|
bfd *obfd;
|
|
|
|
|
|
|
|
/* No use generating a corefile without a target process. */
|
|
|
|
if (!target_has_execution)
|
|
|
|
noprocess ();
|
|
|
|
|
|
|
|
if (args && *args)
|
|
|
|
corefilename = args;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Default corefile name is "core.PID". */
|
|
|
|
sprintf (corefilename_buffer, "core.%d", PIDGET (inferior_ptid));
|
|
|
|
corefilename = corefilename_buffer;
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
2009-10-22 19:36:06 +00:00
|
|
|
if (info_verbose)
|
|
|
|
fprintf_filtered (gdb_stdout,
|
|
|
|
"Opening corefile '%s' for output.\n", corefilename);
|
|
|
|
|
|
|
|
/* Open the output file. */
|
|
|
|
obfd = create_gcore_bfd (corefilename);
|
|
|
|
|
2010-02-16 20:48:52 +00:00
|
|
|
/* Need a cleanup that will close and delete the file. */
|
|
|
|
old_chain = make_cleanup (do_bfd_delete_cleanup, obfd);
|
2009-10-22 19:36:06 +00:00
|
|
|
|
|
|
|
/* Call worker function. */
|
|
|
|
write_gcore_file (obfd);
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Succeeded. */
|
|
|
|
fprintf_filtered (gdb_stdout, "Saved corefile %s\n", corefilename);
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2010-02-16 20:48:52 +00:00
|
|
|
discard_cleanups (old_chain);
|
|
|
|
bfd_close (obfd);
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned long
|
|
|
|
default_gcore_mach (void)
|
|
|
|
{
|
2003-09-04 21:05:49 +00:00
|
|
|
#if 1 /* See if this even matters... */
|
2002-02-14 01:57:36 +00:00
|
|
|
return 0;
|
|
|
|
#else
|
2007-06-13 17:53:51 +00:00
|
|
|
|
2009-06-17 18:48:26 +00:00
|
|
|
const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (target_gdbarch);
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
if (bfdarch != NULL)
|
|
|
|
return bfdarch->mach;
|
|
|
|
if (exec_bfd == NULL)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("Can't find default bfd machine type (need execfile)."));
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
return bfd_get_mach (exec_bfd);
|
2002-02-14 01:57:36 +00:00
|
|
|
#endif /* 1 */
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static enum bfd_architecture
|
|
|
|
default_gcore_arch (void)
|
|
|
|
{
|
2009-06-17 18:48:26 +00:00
|
|
|
const struct bfd_arch_info *bfdarch = gdbarch_bfd_arch_info (target_gdbarch);
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
if (bfdarch != NULL)
|
|
|
|
return bfdarch->arch;
|
|
|
|
if (exec_bfd == NULL)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
error (_("Can't find bfd architecture for corefile (need execfile)."));
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
return bfd_get_arch (exec_bfd);
|
|
|
|
}
|
|
|
|
|
2009-06-17 18:48:26 +00:00
|
|
|
static const char *
|
2002-01-09 00:37:02 +00:00
|
|
|
default_gcore_target (void)
|
|
|
|
{
|
2009-06-17 18:48:26 +00:00
|
|
|
/* The gdbarch may define a target to use for core files. */
|
|
|
|
if (gdbarch_gcore_bfd_target_p (target_gdbarch))
|
|
|
|
return gdbarch_gcore_bfd_target (target_gdbarch);
|
|
|
|
|
|
|
|
/* Otherwise, try to fall back to the exec_bfd target. This will probably
|
|
|
|
not work for non-ELF targets. */
|
2002-01-09 00:37:02 +00:00
|
|
|
if (exec_bfd == NULL)
|
2002-02-14 01:57:36 +00:00
|
|
|
return NULL;
|
|
|
|
else
|
|
|
|
return bfd_get_target (exec_bfd);
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Derive a reasonable stack segment by unwinding the target stack,
|
|
|
|
and store its limits in *BOTTOM and *TOP. Return non-zero if
|
|
|
|
successful. */
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-10-11 01:56:53 +00:00
|
|
|
static int
|
2002-08-08 14:59:35 +00:00
|
|
|
derive_stack_segment (bfd_vma *bottom, bfd_vma *top)
|
2002-01-09 00:37:02 +00:00
|
|
|
{
|
|
|
|
struct frame_info *fi, *tmp_fi;
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
gdb_assert (bottom);
|
|
|
|
gdb_assert (top);
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Can't succeed without stack and registers. */
|
2002-01-09 00:37:02 +00:00
|
|
|
if (!target_has_stack || !target_has_registers)
|
2003-09-04 21:05:49 +00:00
|
|
|
return 0;
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Can't succeed without current frame. */
|
|
|
|
fi = get_current_frame ();
|
|
|
|
if (fi == NULL)
|
|
|
|
return 0;
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Save frame pointer of TOS frame. */
|
2003-01-08 22:47:46 +00:00
|
|
|
*top = get_frame_base (fi);
|
2003-09-04 21:05:49 +00:00
|
|
|
/* If current stack pointer is more "inner", use that instead. */
|
2007-11-16 Markus Deuling <deuling@de.ibm.com>
* m32r-rom.c (m32r_supply_register): Use get_regcache_arch to get at
the current architecture by regcache.
* ppcnbsd-nat.c (ppcnbsd_supply_pcb): Likewise.
* ppc-linux-nat.c (fetch_altivec_register, fetch_spe_register)
(fetch_register, supply_vrregset, fetch_ppc_registers)
(store_altivec_register, store_spe_register, store_register)
(fill_vrregset, store_ppc_registers): Likewise.
* ppcobsd-nat.c (ppcobsd_supply_pcb): Likewise.
* win32-nat.c (do_win32_fetch_inferior_registers)
(do_win32_store_inferior_registers): Likewise.
* procfs.c (procfs_fetch_registers, procfs_store_registers): Likewise.
* remote-m32r-sdi.c (m32r_fetch_registers)
(m32r_store_registers): Likewise.
* remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Likewise.
* trad-frame.c (trad_frame_alloc_saved_regs): Replace current_gdbarch by
gdbarch.
* user-regs.c (user_reg_map_name_to_regnum): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
(do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call)
(ppc64_sysv_abi_return_value): Likewise.
* m32c-tdep.c (m32c_register_reggroup_p): Likewise.
* m2-lang.c (build_m2_types): Likewise.
* ppc-linux-tdep.c (ppc_linux_sigtramp_cache
* ppcnbsd-tdep.c (ppcnbsd_sigtramp_cache_init): Likewise.
* ppcobsd-tdep.c (ppcobsd_sigtramp_frame_cache): Likewise.
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Use get_frame_arch to
get at the current architecture by frame_info.
* gcore.c (derive_stack_segment): Likewise.
* shnbsd-nat.c (GETREGS_SUPPLIES): Add gdbarch parameter.
(shnbsd_fetch_inferior_registers, shnbsd_store_inferior_registers): Add
gdbarch to GETREGS_SUPPLIES call.
2007-11-16 04:53:46 +00:00
|
|
|
if (gdbarch_inner_than (get_frame_arch (fi), get_frame_sp (fi), *top))
|
2007-05-13 12:27:30 +00:00
|
|
|
*top = get_frame_sp (fi);
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Find prev-most frame. */
|
2002-01-09 00:37:02 +00:00
|
|
|
while ((tmp_fi = get_prev_frame (fi)) != NULL)
|
|
|
|
fi = tmp_fi;
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Save frame pointer of prev-most frame. */
|
2003-01-08 22:47:46 +00:00
|
|
|
*bottom = get_frame_base (fi);
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Now canonicalize their order, so that BOTTOM is a lower address
|
|
|
|
(as opposed to a lower stack frame). */
|
2002-01-09 00:37:02 +00:00
|
|
|
if (*bottom > *top)
|
|
|
|
{
|
2003-09-04 21:05:49 +00:00
|
|
|
bfd_vma tmp_vma;
|
|
|
|
|
2002-01-09 00:37:02 +00:00
|
|
|
tmp_vma = *top;
|
|
|
|
*top = *bottom;
|
|
|
|
*bottom = tmp_vma;
|
|
|
|
}
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
return 1;
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
2009-10-22 19:36:06 +00:00
|
|
|
/* call_target_sbrk --
|
|
|
|
helper function for derive_heap_segment. */
|
|
|
|
|
|
|
|
static bfd_vma
|
|
|
|
call_target_sbrk (int sbrk_arg)
|
|
|
|
{
|
|
|
|
struct objfile *sbrk_objf;
|
|
|
|
struct gdbarch *gdbarch;
|
|
|
|
bfd_vma top_of_heap;
|
|
|
|
struct value *target_sbrk_arg;
|
|
|
|
struct value *sbrk_fn, *ret;
|
|
|
|
bfd_vma tmp;
|
|
|
|
|
|
|
|
if (lookup_minimal_symbol ("sbrk", NULL, NULL) != NULL)
|
|
|
|
{
|
|
|
|
sbrk_fn = find_function_in_inferior ("sbrk", &sbrk_objf);
|
|
|
|
if (sbrk_fn == NULL)
|
|
|
|
return (bfd_vma) 0;
|
|
|
|
}
|
|
|
|
else if (lookup_minimal_symbol ("_sbrk", NULL, NULL) != NULL)
|
|
|
|
{
|
|
|
|
sbrk_fn = find_function_in_inferior ("_sbrk", &sbrk_objf);
|
|
|
|
if (sbrk_fn == NULL)
|
|
|
|
return (bfd_vma) 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return (bfd_vma) 0;
|
|
|
|
|
|
|
|
gdbarch = get_objfile_arch (sbrk_objf);
|
|
|
|
target_sbrk_arg = value_from_longest (builtin_type (gdbarch)->builtin_int,
|
|
|
|
sbrk_arg);
|
|
|
|
gdb_assert (target_sbrk_arg);
|
|
|
|
ret = call_function_by_hand (sbrk_fn, 1, &target_sbrk_arg);
|
|
|
|
if (ret == NULL)
|
|
|
|
return (bfd_vma) 0;
|
|
|
|
|
|
|
|
tmp = value_as_long (ret);
|
|
|
|
if ((LONGEST) tmp <= 0 || (LONGEST) tmp == 0xffffffff)
|
|
|
|
return (bfd_vma) 0;
|
|
|
|
|
|
|
|
top_of_heap = tmp;
|
|
|
|
return top_of_heap;
|
|
|
|
}
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Derive a reasonable heap segment for ABFD by looking at sbrk and
|
|
|
|
the static data sections. Store its limits in *BOTTOM and *TOP.
|
|
|
|
Return non-zero if successful. */
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-10-11 01:56:53 +00:00
|
|
|
static int
|
2002-08-08 14:59:35 +00:00
|
|
|
derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
|
2002-01-09 00:37:02 +00:00
|
|
|
{
|
|
|
|
bfd_vma top_of_data_memory = 0;
|
|
|
|
bfd_vma top_of_heap = 0;
|
|
|
|
bfd_size_type sec_size;
|
|
|
|
bfd_vma sec_vaddr;
|
|
|
|
asection *sec;
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
gdb_assert (bottom);
|
|
|
|
gdb_assert (top);
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* This function depends on being able to call a function in the
|
|
|
|
inferior. */
|
2002-01-09 00:37:02 +00:00
|
|
|
if (!target_has_execution)
|
2003-09-04 21:05:49 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* The following code assumes that the link map is arranged as
|
|
|
|
follows (low to high addresses):
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
---------------------------------
|
|
|
|
| text sections |
|
|
|
|
---------------------------------
|
|
|
|
| data sections (including bss) |
|
|
|
|
---------------------------------
|
|
|
|
| heap |
|
|
|
|
--------------------------------- */
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
for (sec = abfd->sections; sec; sec = sec->next)
|
|
|
|
{
|
2003-09-04 21:05:49 +00:00
|
|
|
if (bfd_get_section_flags (abfd, sec) & SEC_DATA
|
|
|
|
|| strcmp (".bss", bfd_section_name (abfd, sec)) == 0)
|
2002-01-09 00:37:02 +00:00
|
|
|
{
|
|
|
|
sec_vaddr = bfd_get_section_vma (abfd, sec);
|
2004-06-15 01:04:20 +00:00
|
|
|
sec_size = bfd_get_section_size (sec);
|
2002-01-09 00:37:02 +00:00
|
|
|
if (sec_vaddr + sec_size > top_of_data_memory)
|
|
|
|
top_of_data_memory = sec_vaddr + sec_size;
|
|
|
|
}
|
|
|
|
}
|
2003-09-04 21:05:49 +00:00
|
|
|
|
2009-10-22 19:36:06 +00:00
|
|
|
top_of_heap = call_target_sbrk (0);
|
|
|
|
if (top_of_heap == (bfd_vma) 0)
|
2002-01-09 00:37:02 +00:00
|
|
|
return 0;
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Return results. */
|
2002-01-09 00:37:02 +00:00
|
|
|
if (top_of_heap > top_of_data_memory)
|
|
|
|
{
|
|
|
|
*bottom = top_of_data_memory;
|
|
|
|
*top = top_of_heap;
|
2003-09-04 21:05:49 +00:00
|
|
|
return 1;
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
2003-09-04 21:05:49 +00:00
|
|
|
|
|
|
|
/* No additional heap space needs to be saved. */
|
|
|
|
return 0;
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
make_output_phdrs (bfd *obfd, asection *osec, void *ignored)
|
|
|
|
{
|
|
|
|
int p_flags = 0;
|
2009-10-22 19:36:06 +00:00
|
|
|
int p_type = 0;
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
/* FIXME: these constants may only be applicable for ELF. */
|
2002-04-12 23:09:48 +00:00
|
|
|
if (strncmp (bfd_section_name (obfd, osec), "load", 4) == 0)
|
2002-01-09 00:37:02 +00:00
|
|
|
p_type = PT_LOAD;
|
2009-10-22 19:36:06 +00:00
|
|
|
else if (strncmp (bfd_section_name (obfd, osec), "note", 4) == 0)
|
2002-01-09 00:37:02 +00:00
|
|
|
p_type = PT_NOTE;
|
2009-10-22 19:36:06 +00:00
|
|
|
else
|
|
|
|
p_type = PT_NULL;
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
p_flags |= PF_R; /* Segment is readable. */
|
|
|
|
if (!(bfd_get_section_flags (obfd, osec) & SEC_READONLY))
|
|
|
|
p_flags |= PF_W; /* Segment is writable. */
|
|
|
|
if (bfd_get_section_flags (obfd, osec) & SEC_CODE)
|
|
|
|
p_flags |= PF_X; /* Segment is executable. */
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
bfd_record_phdr (obfd, p_type, 1, p_flags, 0, 0, 0, 0, 1, &osec);
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
2003-10-11 01:56:53 +00:00
|
|
|
static int
|
|
|
|
gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
|
|
|
|
int read, int write, int exec, void *data)
|
2002-01-09 00:37:02 +00:00
|
|
|
{
|
2003-10-11 01:56:53 +00:00
|
|
|
bfd *obfd = data;
|
2002-01-09 00:37:02 +00:00
|
|
|
asection *osec;
|
2003-10-11 01:56:53 +00:00
|
|
|
flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD;
|
|
|
|
|
2004-01-14 18:39:08 +00:00
|
|
|
/* If the memory segment has no permissions set, ignore it, otherwise
|
|
|
|
when we later try to access it for read/write, we'll get an error
|
|
|
|
or jam the kernel. */
|
|
|
|
if (read == 0 && write == 0 && exec == 0)
|
|
|
|
{
|
|
|
|
if (info_verbose)
|
|
|
|
{
|
* defs.h (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter.
* utils.c (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter, use it instead of current_gdbarch.
* ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter.
* ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter,
use it instead of current_gdbarch.
Update calls to ui_out_field_core_addr to pass architecture:
* ada-lang.c (print_one_exception): Update.
* breakpoint.c (print_one_breakpoint_location,
print_one_exception_catchpoint): Update.
* disasm.c (dump_insns): Update.
* darwin-nat-info.c (darwin_debug_regions_recurse): Update.
* mi/mi-main.c (mi_cmd_data_read_memory): Update.
* mi/mi-symbol-cmds.c: Include "objfiles.h".
(mi_cmd_symbol_list_lines): Update.
* stack.c (print_frame_info, print_frame): Update.
Update callers of paddress to pass architecture:
* ada-tasks.c (info_task): Update.
* ada-valprint.c (ada_val_print_1): Update.
* annotate.c (annotate_source, annotate_frame_begin): Update.
* breakpoint.c (insert_bp_location, describe_other_breakpoints,
mention): Update.
* cli/cli-cmds.c (edit_command, list_command, print_disassembly):
Update.
* corefile.c (memory_error): Update.
* c-valprint.c (print_function_pointer_address, c_val_print): Update.
* disasm.c (dis_asm_print_address): Update.
* exec.c (print_section_info): Update.
* f-valprint.c (f_val_print): Update.
* infcmd.c: Include "arch-utils.h".
(jump_command, program_info): Update.
* linux-fork.c: Include "arch-utils.h".
(info_forks_command): Update.
* m2-valprint.c (print_function_pointer_address,
print_unpacked_pointer, print_variable_at_address,
m2_val_print): Update.
* m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command):
Update.
* printcmd.c (print_address, print_address_demangle, address_info):
Update.
* p-valprint.c (pascal_val_print): Update.
* source.c: Include "arch-utils.h".
(line_info): Update.
* stack.c (frame_info, print_block_frame_labels): Update.
* symfile.c (add_symbol_file_command, list_overlays_command): Update.
* symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1,
print_symbol, print_partial_symbols, maintenance_info_psymtabs,
maintenance_check_symtabs): Update.
* symtab.c (find_pc_sect_symtab): Update.
* target.c (deprecated_debug_xfer_memory): Update.
* tracepoint.c (scope_info): Update.
* tui/tui-stack.c (tui_make_status_line): Update.
* valprint.c (val_print_string): Update.
Update callers of paddr_nz to use paddress instead (keeping
user-visible output identical):
* alpha-tdep.c (alpha_heuristic_proc_start): Update.
* amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn,
amd64_displaced_step_fixup): Update.
* arch-utils.c (simple_displaced_step_copy_insn): Update.
* auxv.c (fprint_target_auxv): Update.
* breakpoint.c (insert_single_step_breakpoint): Update.
* buildsym.c (finish_block): Update.
* cli/cli-dump.c (restore_section_callback): Update.
* fbsd-nat.c (fbsd_find_memory_regions): Update.
* frame.c (frame_unwind_register_value): Update.
* gcore.c (gcore_create_callback): Update.
* hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm,
i386_record_lea_modrm_addr, i386_record_lea_modrm,
i386_process_record): Update.
* ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id,
ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id,
ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update.
* infrun.c (displaced_step_prepare, displaced_step_fixup,
handle_inferior_event, insert_step_resume_breakpoint_at_sal,
insert_longjmp_resume_breakpoint): Update.
* linux-nat.c (linux_nat_find_memory_regions): Update.
* linux-record.c (record_linux_system_call): Update.
* mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call,
mips_n32n64_push_dummy_call, mips_o32_push_dummy_call,
mips_o64_push_dummy_call): Update.
* monitor.c (monitor_error, monitor_remove_breakpoint): Update.
* record.c (record_arch_list_add_mem, record_wait,
record_xfer_partial): Update.
* remote-mips.c (mips_fetch_word, mips_check_lsi_error,
mips_common_breakpoint): Update.
* remote-sim.c (gdbsim_xfer_inferior_memory): Update.
* rs6000-tdep.c (ppc_displaced_step_fixup): Update.
* solib-som.c (som_current_sos): Update.
* symfile.c (load_progress, generic_load): Update.
* symfile-mem.c (add_vsyscall_page): Update.
* valops.c (value_fetch_lazy): Update.
* windows-tdep.c (windows_xfer_shared_library): Update.
Update callers of paddr_nz to use paddress instead (changing
user-visible output to make it more correct):
* dwarf2loc.c (locexpr_describe_location): Update.
* ia64-tdep.c (ia64_memory_insert_breakpoint,
ia64_memory_remove_breakpoint): Update.
* jv-valprint.c (java_value_print): Update.
* m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
* monitor.c (monitor_read_memory): Update.
Update callers of paddr to use paddress instead (changing
user-visible output to make it more correct):
* arm-tdep.c (arm_push_dummy_call): Update.
* breakpoint.c (insert_bp_location, create_thread_event_breakpoint,
create_breakpoint): Update.
* darwin-nat-info.c (darwin_debug_regions): Update.
* dcache.c (dcache_info): Update.
* dsrec.c (load_srec, make_srec): Update.
* dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program,
dwarf2_frame_cache): Update.
* gcore.c (gcore_copy_callback): Update.
* gnu-nat.c (gnu_xfer_memory): Update.
* mips-linux-nat.c (mips_show_dr): Update.
* monitor.c (monitor_write_memory, monitor_insert_breakpoint,
monitor_remove_breakpoint): Update.
* remote.c (compare_sections_command): Update.
* remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint,
m32r_remove_breakpoint, m32r_insert_watchpoint,
m32r_remove_watchpoint): Update.
* sol-thread.c (info_cb): Update.
* symfile.c (load_progress): Update.
Update callers of paddress or paddr_nz to use hex_string instead
(changes output of internal/error/debug messages only):
* dwarf2read.c (dump_die_shallow): Update.
* frame.c (fprint_field, fprint_frame, frame_pc_unwind,
get_frame_func, create_new_frame): Update.
* hppa-tdep.c (find_unwind_entry, unwind_command): Update.
* ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x,
ia64_get_dyn_info_list): Update.
* maint.c (maintenance_translate_address): Update.
* mi/mi-cmd-var.c (mi_cmd_var_create): Update.
* target.c (target_flash_erase): Update.
Update callers of paddr/paddr_nz to use phex/phex_nz instead,
using an appropriate address size. Remove use of strlen_paddr.
* exec.c (exec_files_info): Update.
* i386-nat.c (i386_show_dr): Update.
* remote.c (remote_flash_erase): Update.
* m32r-rom.c (m32r_load_section): Update.
* monitor.c (monitor_vsprintf, monitor_store_register): Update.
* remote.c (remote_check_symbols, remote_search_memory): Update.
* remote-mips.c (mips_request, mips_common_breakpoint): Update.
* scm-valprint.c (scm_ipruk, scm_scmval_print): Update.
* sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update.
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs,
sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs,
sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs,
sh_dsp_show_regs): Update.
* xcoffsolib.c (sharedlibrary_command): Update.
* maint.c (maint_print_section_info): Add ADDR_SIZE parameter.
Use hex_string_custom instead of paddr.
(print_bfd_section_info): Pass address size.
(print_objfile_section_info): Likewise.
* annotate.h (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* annotate.c (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* source.c (identify_source_line): Update call to annotate_source.
* stack.c (print_frame_info, print_frame): Update call to
annotate_frame_begin.
* breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter.
(create_breakpoint, create_ada_exception_breakpoint): Update call.
* stack.c (print_block_frame_labels): Add GDBARCH parameter.
(print_frame_label_vars): Update call.
* symmisc.c (print_partial_symbols): Add GDBARCH parameter.
(dump_psymtab): Update call to print_partial_symbols.
(struct print_symbol_args): Add GDBARCH member.
(dump_symtab_1): Set print_symbol_args architecture member.
(print_symbol): Use it.
* windows-tdep.h (windows_xfer_shared_library): Add GDBARCH
parameter.
* windows-tdep.c (windows_xfer_shared_library): Likewise.
* i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member.
(core_process_module_section): Pass architecture from cpms_data to
windows_xfer_shared_library.
(windows_core_xfer_shared_libraries): Initialize cmps_data
architecture member.
* windows-nat.c (windows_xfer_shared_libraries): Pass architecture
to windows_xfer_shared_library.
* defs.h (print_address): Add GDBARCH parameter.
* printcmd.c (print_address): Add GDBARCH parameter.
(print_scalar_formatted, do_examine): Update call.
* findcmd.c (find_command): Update call.
* tracepoint.c: Include "arch-utils.h".
(trace_find_line_command): Update call.
* tui/tui-disasm.c (tui_disassemble): Update call.
* value.h (print_address_demangle): Add GDBARCH parameter.
* printcmd.c (print_address_demangle): Add GDBARCH parameter.
* c-valprint.c (print_function_pointer_address, c_val_print):
Update call.
* f-valprint.c (f_val_print): Update call.
* gnu-v3-abi.c (gnuv3_print_method_ptr): Update call.
* jv-valprint.c (java_val_print): Update call.
* m2-valprint.c (print_function_pointer_address, m2_val_print):
Update call.
* p-valprint.c (pascal_val_print): Update call.
* disasm.c (gdb_disassemble_info): Install architecture into
di.application_data field.
testsuite/ChangeLog:
* gdb.threads/tls-shared.exp: Update to locexpr_describe_location
change to prefix TLS offset in hex with 0x.
doc/ChangeLog:
* gdbint.texinfo (Item Output Functions): Update signature
for ui_out_field_core_addr.
2009-07-02 17:21:10 +00:00
|
|
|
fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at %s\n",
|
|
|
|
plongest (size), paddress (target_gdbarch, vaddr));
|
2004-01-14 18:39:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-12-01 22:46:15 +00:00
|
|
|
if (write == 0 && !solib_keep_data_in_core (vaddr, size))
|
2003-10-11 01:56:53 +00:00
|
|
|
{
|
|
|
|
/* See if this region of memory lies inside a known file on disk.
|
|
|
|
If so, we can avoid copying its contents by clearing SEC_LOAD. */
|
|
|
|
struct objfile *objfile;
|
|
|
|
struct obj_section *objsec;
|
|
|
|
|
|
|
|
ALL_OBJSECTIONS (objfile, objsec)
|
|
|
|
{
|
|
|
|
bfd *abfd = objfile->obfd;
|
|
|
|
asection *asec = objsec->the_bfd_section;
|
|
|
|
bfd_vma align = (bfd_vma) 1 << bfd_get_section_alignment (abfd,
|
|
|
|
asec);
|
2008-08-20 11:21:44 +00:00
|
|
|
bfd_vma start = obj_section_addr (objsec) & -align;
|
|
|
|
bfd_vma end = (obj_section_endaddr (objsec) + align - 1) & -align;
|
2010-05-14 20:17:37 +00:00
|
|
|
|
2003-10-11 01:56:53 +00:00
|
|
|
/* Match if either the entire memory region lies inside the
|
|
|
|
section (i.e. a mapping covering some pages of a large
|
|
|
|
segment) or the entire section lies inside the memory region
|
|
|
|
(i.e. a mapping covering multiple small sections).
|
|
|
|
|
|
|
|
This BFD was synthesized from reading target memory,
|
|
|
|
we don't want to omit that. */
|
|
|
|
if (((vaddr >= start && vaddr + size <= end)
|
|
|
|
|| (start >= vaddr && end <= vaddr + size))
|
|
|
|
&& !(bfd_get_file_flags (abfd) & BFD_IN_MEMORY))
|
|
|
|
{
|
2010-09-15 03:30:30 +00:00
|
|
|
flags &= ~(SEC_LOAD | SEC_HAS_CONTENTS);
|
2003-10-11 01:56:53 +00:00
|
|
|
goto keep; /* break out of two nested for loops */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
keep:
|
|
|
|
flags |= SEC_READONLY;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (exec)
|
|
|
|
flags |= SEC_CODE;
|
|
|
|
else
|
|
|
|
flags |= SEC_DATA;
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2007-06-20 18:32:10 +00:00
|
|
|
osec = bfd_make_section_anyway_with_flags (obfd, "load", flags);
|
2003-09-04 21:05:49 +00:00
|
|
|
if (osec == NULL)
|
2002-01-09 00:37:02 +00:00
|
|
|
{
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
|
|
|
warning (_("Couldn't make gcore segment: %s"),
|
2002-01-09 00:37:02 +00:00
|
|
|
bfd_errmsg (bfd_get_error ()));
|
2003-10-11 01:56:53 +00:00
|
|
|
return 1;
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (info_verbose)
|
|
|
|
{
|
* defs.h (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter.
* utils.c (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter, use it instead of current_gdbarch.
* ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter.
* ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter,
use it instead of current_gdbarch.
Update calls to ui_out_field_core_addr to pass architecture:
* ada-lang.c (print_one_exception): Update.
* breakpoint.c (print_one_breakpoint_location,
print_one_exception_catchpoint): Update.
* disasm.c (dump_insns): Update.
* darwin-nat-info.c (darwin_debug_regions_recurse): Update.
* mi/mi-main.c (mi_cmd_data_read_memory): Update.
* mi/mi-symbol-cmds.c: Include "objfiles.h".
(mi_cmd_symbol_list_lines): Update.
* stack.c (print_frame_info, print_frame): Update.
Update callers of paddress to pass architecture:
* ada-tasks.c (info_task): Update.
* ada-valprint.c (ada_val_print_1): Update.
* annotate.c (annotate_source, annotate_frame_begin): Update.
* breakpoint.c (insert_bp_location, describe_other_breakpoints,
mention): Update.
* cli/cli-cmds.c (edit_command, list_command, print_disassembly):
Update.
* corefile.c (memory_error): Update.
* c-valprint.c (print_function_pointer_address, c_val_print): Update.
* disasm.c (dis_asm_print_address): Update.
* exec.c (print_section_info): Update.
* f-valprint.c (f_val_print): Update.
* infcmd.c: Include "arch-utils.h".
(jump_command, program_info): Update.
* linux-fork.c: Include "arch-utils.h".
(info_forks_command): Update.
* m2-valprint.c (print_function_pointer_address,
print_unpacked_pointer, print_variable_at_address,
m2_val_print): Update.
* m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command):
Update.
* printcmd.c (print_address, print_address_demangle, address_info):
Update.
* p-valprint.c (pascal_val_print): Update.
* source.c: Include "arch-utils.h".
(line_info): Update.
* stack.c (frame_info, print_block_frame_labels): Update.
* symfile.c (add_symbol_file_command, list_overlays_command): Update.
* symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1,
print_symbol, print_partial_symbols, maintenance_info_psymtabs,
maintenance_check_symtabs): Update.
* symtab.c (find_pc_sect_symtab): Update.
* target.c (deprecated_debug_xfer_memory): Update.
* tracepoint.c (scope_info): Update.
* tui/tui-stack.c (tui_make_status_line): Update.
* valprint.c (val_print_string): Update.
Update callers of paddr_nz to use paddress instead (keeping
user-visible output identical):
* alpha-tdep.c (alpha_heuristic_proc_start): Update.
* amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn,
amd64_displaced_step_fixup): Update.
* arch-utils.c (simple_displaced_step_copy_insn): Update.
* auxv.c (fprint_target_auxv): Update.
* breakpoint.c (insert_single_step_breakpoint): Update.
* buildsym.c (finish_block): Update.
* cli/cli-dump.c (restore_section_callback): Update.
* fbsd-nat.c (fbsd_find_memory_regions): Update.
* frame.c (frame_unwind_register_value): Update.
* gcore.c (gcore_create_callback): Update.
* hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm,
i386_record_lea_modrm_addr, i386_record_lea_modrm,
i386_process_record): Update.
* ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id,
ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id,
ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update.
* infrun.c (displaced_step_prepare, displaced_step_fixup,
handle_inferior_event, insert_step_resume_breakpoint_at_sal,
insert_longjmp_resume_breakpoint): Update.
* linux-nat.c (linux_nat_find_memory_regions): Update.
* linux-record.c (record_linux_system_call): Update.
* mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call,
mips_n32n64_push_dummy_call, mips_o32_push_dummy_call,
mips_o64_push_dummy_call): Update.
* monitor.c (monitor_error, monitor_remove_breakpoint): Update.
* record.c (record_arch_list_add_mem, record_wait,
record_xfer_partial): Update.
* remote-mips.c (mips_fetch_word, mips_check_lsi_error,
mips_common_breakpoint): Update.
* remote-sim.c (gdbsim_xfer_inferior_memory): Update.
* rs6000-tdep.c (ppc_displaced_step_fixup): Update.
* solib-som.c (som_current_sos): Update.
* symfile.c (load_progress, generic_load): Update.
* symfile-mem.c (add_vsyscall_page): Update.
* valops.c (value_fetch_lazy): Update.
* windows-tdep.c (windows_xfer_shared_library): Update.
Update callers of paddr_nz to use paddress instead (changing
user-visible output to make it more correct):
* dwarf2loc.c (locexpr_describe_location): Update.
* ia64-tdep.c (ia64_memory_insert_breakpoint,
ia64_memory_remove_breakpoint): Update.
* jv-valprint.c (java_value_print): Update.
* m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
* monitor.c (monitor_read_memory): Update.
Update callers of paddr to use paddress instead (changing
user-visible output to make it more correct):
* arm-tdep.c (arm_push_dummy_call): Update.
* breakpoint.c (insert_bp_location, create_thread_event_breakpoint,
create_breakpoint): Update.
* darwin-nat-info.c (darwin_debug_regions): Update.
* dcache.c (dcache_info): Update.
* dsrec.c (load_srec, make_srec): Update.
* dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program,
dwarf2_frame_cache): Update.
* gcore.c (gcore_copy_callback): Update.
* gnu-nat.c (gnu_xfer_memory): Update.
* mips-linux-nat.c (mips_show_dr): Update.
* monitor.c (monitor_write_memory, monitor_insert_breakpoint,
monitor_remove_breakpoint): Update.
* remote.c (compare_sections_command): Update.
* remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint,
m32r_remove_breakpoint, m32r_insert_watchpoint,
m32r_remove_watchpoint): Update.
* sol-thread.c (info_cb): Update.
* symfile.c (load_progress): Update.
Update callers of paddress or paddr_nz to use hex_string instead
(changes output of internal/error/debug messages only):
* dwarf2read.c (dump_die_shallow): Update.
* frame.c (fprint_field, fprint_frame, frame_pc_unwind,
get_frame_func, create_new_frame): Update.
* hppa-tdep.c (find_unwind_entry, unwind_command): Update.
* ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x,
ia64_get_dyn_info_list): Update.
* maint.c (maintenance_translate_address): Update.
* mi/mi-cmd-var.c (mi_cmd_var_create): Update.
* target.c (target_flash_erase): Update.
Update callers of paddr/paddr_nz to use phex/phex_nz instead,
using an appropriate address size. Remove use of strlen_paddr.
* exec.c (exec_files_info): Update.
* i386-nat.c (i386_show_dr): Update.
* remote.c (remote_flash_erase): Update.
* m32r-rom.c (m32r_load_section): Update.
* monitor.c (monitor_vsprintf, monitor_store_register): Update.
* remote.c (remote_check_symbols, remote_search_memory): Update.
* remote-mips.c (mips_request, mips_common_breakpoint): Update.
* scm-valprint.c (scm_ipruk, scm_scmval_print): Update.
* sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update.
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs,
sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs,
sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs,
sh_dsp_show_regs): Update.
* xcoffsolib.c (sharedlibrary_command): Update.
* maint.c (maint_print_section_info): Add ADDR_SIZE parameter.
Use hex_string_custom instead of paddr.
(print_bfd_section_info): Pass address size.
(print_objfile_section_info): Likewise.
* annotate.h (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* annotate.c (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* source.c (identify_source_line): Update call to annotate_source.
* stack.c (print_frame_info, print_frame): Update call to
annotate_frame_begin.
* breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter.
(create_breakpoint, create_ada_exception_breakpoint): Update call.
* stack.c (print_block_frame_labels): Add GDBARCH parameter.
(print_frame_label_vars): Update call.
* symmisc.c (print_partial_symbols): Add GDBARCH parameter.
(dump_psymtab): Update call to print_partial_symbols.
(struct print_symbol_args): Add GDBARCH member.
(dump_symtab_1): Set print_symbol_args architecture member.
(print_symbol): Use it.
* windows-tdep.h (windows_xfer_shared_library): Add GDBARCH
parameter.
* windows-tdep.c (windows_xfer_shared_library): Likewise.
* i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member.
(core_process_module_section): Pass architecture from cpms_data to
windows_xfer_shared_library.
(windows_core_xfer_shared_libraries): Initialize cmps_data
architecture member.
* windows-nat.c (windows_xfer_shared_libraries): Pass architecture
to windows_xfer_shared_library.
* defs.h (print_address): Add GDBARCH parameter.
* printcmd.c (print_address): Add GDBARCH parameter.
(print_scalar_formatted, do_examine): Update call.
* findcmd.c (find_command): Update call.
* tracepoint.c: Include "arch-utils.h".
(trace_find_line_command): Update call.
* tui/tui-disasm.c (tui_disassemble): Update call.
* value.h (print_address_demangle): Add GDBARCH parameter.
* printcmd.c (print_address_demangle): Add GDBARCH parameter.
* c-valprint.c (print_function_pointer_address, c_val_print):
Update call.
* f-valprint.c (f_val_print): Update call.
* gnu-v3-abi.c (gnuv3_print_method_ptr): Update call.
* jv-valprint.c (java_val_print): Update call.
* m2-valprint.c (print_function_pointer_address, m2_val_print):
Update call.
* p-valprint.c (pascal_val_print): Update call.
* disasm.c (gdb_disassemble_info): Install architecture into
di.application_data field.
testsuite/ChangeLog:
* gdb.threads/tls-shared.exp: Update to locexpr_describe_location
change to prefix TLS offset in hex with 0x.
doc/ChangeLog:
* gdbint.texinfo (Item Output Functions): Update signature
for ui_out_field_core_addr.
2009-07-02 17:21:10 +00:00
|
|
|
fprintf_filtered (gdb_stdout, "Save segment, %s bytes at %s\n",
|
|
|
|
plongest (size), paddress (target_gdbarch, vaddr));
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bfd_set_section_size (obfd, osec, size);
|
2003-10-11 01:56:53 +00:00
|
|
|
bfd_set_section_vma (obfd, osec, vaddr);
|
2003-09-04 21:05:49 +00:00
|
|
|
bfd_section_lma (obfd, osec) = 0; /* ??? bfd_set_section_lma? */
|
2003-10-11 01:56:53 +00:00
|
|
|
return 0;
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2010-08-31 18:08:43 +00:00
|
|
|
objfile_find_memory_regions (find_memory_region_ftype func, void *obfd)
|
2002-01-09 00:37:02 +00:00
|
|
|
{
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Use objfile data to create memory sections. */
|
2002-01-09 00:37:02 +00:00
|
|
|
struct objfile *objfile;
|
|
|
|
struct obj_section *objsec;
|
|
|
|
bfd_vma temp_bottom, temp_top;
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Call callback function for each objfile section. */
|
2002-01-09 00:37:02 +00:00
|
|
|
ALL_OBJSECTIONS (objfile, objsec)
|
|
|
|
{
|
|
|
|
bfd *ibfd = objfile->obfd;
|
|
|
|
asection *isec = objsec->the_bfd_section;
|
|
|
|
flagword flags = bfd_get_section_flags (ibfd, isec);
|
|
|
|
|
|
|
|
if ((flags & SEC_ALLOC) || (flags & SEC_LOAD))
|
|
|
|
{
|
|
|
|
int size = bfd_section_size (ibfd, isec);
|
|
|
|
int ret;
|
|
|
|
|
2010-05-07 02:09:55 +00:00
|
|
|
ret = (*func) (obj_section_addr (objsec), size,
|
2003-09-04 21:05:49 +00:00
|
|
|
1, /* All sections will be readable. */
|
|
|
|
(flags & SEC_READONLY) == 0, /* Writable. */
|
|
|
|
(flags & SEC_CODE) != 0, /* Executable. */
|
|
|
|
obfd);
|
|
|
|
if (ret != 0)
|
2002-01-09 00:37:02 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Make a stack segment. */
|
2002-01-09 00:37:02 +00:00
|
|
|
if (derive_stack_segment (&temp_bottom, &temp_top))
|
2003-10-11 01:56:53 +00:00
|
|
|
(*func) (temp_bottom, temp_top - temp_bottom,
|
2003-09-04 21:05:49 +00:00
|
|
|
1, /* Stack section will be readable. */
|
|
|
|
1, /* Stack section will be writable. */
|
|
|
|
0, /* Stack section will not be executable. */
|
2002-01-09 00:37:02 +00:00
|
|
|
obfd);
|
|
|
|
|
|
|
|
/* Make a heap segment. */
|
|
|
|
if (derive_heap_segment (exec_bfd, &temp_bottom, &temp_top))
|
2003-09-04 21:05:49 +00:00
|
|
|
(*func) (temp_bottom, temp_top - temp_bottom,
|
|
|
|
1, /* Heap section will be readable. */
|
|
|
|
1, /* Heap section will be writable. */
|
|
|
|
0, /* Heap section will not be executable. */
|
2002-01-09 00:37:02 +00:00
|
|
|
obfd);
|
2003-09-04 21:05:49 +00:00
|
|
|
|
2002-01-09 00:37:02 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
|
|
|
|
{
|
2006-10-20 22:06:28 +00:00
|
|
|
bfd_size_type size, total_size = bfd_section_size (obfd, osec);
|
|
|
|
file_ptr offset = 0;
|
2002-01-09 00:37:02 +00:00
|
|
|
struct cleanup *old_chain = NULL;
|
|
|
|
void *memhunk;
|
|
|
|
|
2003-10-11 01:56:53 +00:00
|
|
|
/* Read-only sections are marked; we don't have to copy their contents. */
|
|
|
|
if ((bfd_get_section_flags (obfd, osec) & SEC_LOAD) == 0)
|
2003-09-04 21:05:49 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* Only interested in "load" sections. */
|
2002-04-12 23:09:48 +00:00
|
|
|
if (strncmp ("load", bfd_section_name (obfd, osec), 4) != 0)
|
2003-09-04 21:05:49 +00:00
|
|
|
return;
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2006-10-20 22:06:28 +00:00
|
|
|
size = min (total_size, MAX_COPY_BYTES);
|
2003-09-04 21:05:49 +00:00
|
|
|
memhunk = xmalloc (size);
|
2002-01-09 00:37:02 +00:00
|
|
|
old_chain = make_cleanup (xfree, memhunk);
|
|
|
|
|
2006-10-20 22:06:28 +00:00
|
|
|
while (total_size > 0)
|
|
|
|
{
|
|
|
|
if (size > total_size)
|
|
|
|
size = total_size;
|
|
|
|
|
|
|
|
if (target_read_memory (bfd_section_vma (obfd, osec) + offset,
|
|
|
|
memhunk, size) != 0)
|
|
|
|
{
|
* defs.h (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter.
* utils.c (strlen_paddr, paddr, paddr_nz): Remove.
(paddress): Add GDBARCH parameter, use it instead of current_gdbarch.
* ui-out.h (ui_out_field_core_addr): Add GDBARCH parameter.
* ui-out.c (ui_out_field_core_addr): Add GDBARCH parameter,
use it instead of current_gdbarch.
Update calls to ui_out_field_core_addr to pass architecture:
* ada-lang.c (print_one_exception): Update.
* breakpoint.c (print_one_breakpoint_location,
print_one_exception_catchpoint): Update.
* disasm.c (dump_insns): Update.
* darwin-nat-info.c (darwin_debug_regions_recurse): Update.
* mi/mi-main.c (mi_cmd_data_read_memory): Update.
* mi/mi-symbol-cmds.c: Include "objfiles.h".
(mi_cmd_symbol_list_lines): Update.
* stack.c (print_frame_info, print_frame): Update.
Update callers of paddress to pass architecture:
* ada-tasks.c (info_task): Update.
* ada-valprint.c (ada_val_print_1): Update.
* annotate.c (annotate_source, annotate_frame_begin): Update.
* breakpoint.c (insert_bp_location, describe_other_breakpoints,
mention): Update.
* cli/cli-cmds.c (edit_command, list_command, print_disassembly):
Update.
* corefile.c (memory_error): Update.
* c-valprint.c (print_function_pointer_address, c_val_print): Update.
* disasm.c (dis_asm_print_address): Update.
* exec.c (print_section_info): Update.
* f-valprint.c (f_val_print): Update.
* infcmd.c: Include "arch-utils.h".
(jump_command, program_info): Update.
* linux-fork.c: Include "arch-utils.h".
(info_forks_command): Update.
* m2-valprint.c (print_function_pointer_address,
print_unpacked_pointer, print_variable_at_address,
m2_val_print): Update.
* m32r-rom.c (m32r_load_section, m32r_load, m32r_upload_command):
Update.
* printcmd.c (print_address, print_address_demangle, address_info):
Update.
* p-valprint.c (pascal_val_print): Update.
* source.c: Include "arch-utils.h".
(line_info): Update.
* stack.c (frame_info, print_block_frame_labels): Update.
* symfile.c (add_symbol_file_command, list_overlays_command): Update.
* symmisc.c (dump_msymbols, dump_psymtab, dump_symtab_1,
print_symbol, print_partial_symbols, maintenance_info_psymtabs,
maintenance_check_symtabs): Update.
* symtab.c (find_pc_sect_symtab): Update.
* target.c (deprecated_debug_xfer_memory): Update.
* tracepoint.c (scope_info): Update.
* tui/tui-stack.c (tui_make_status_line): Update.
* valprint.c (val_print_string): Update.
Update callers of paddr_nz to use paddress instead (keeping
user-visible output identical):
* alpha-tdep.c (alpha_heuristic_proc_start): Update.
* amd64-tdep.c (fixup_riprel, amd64_displaced_step_copy_insn,
amd64_displaced_step_fixup): Update.
* arch-utils.c (simple_displaced_step_copy_insn): Update.
* auxv.c (fprint_target_auxv): Update.
* breakpoint.c (insert_single_step_breakpoint): Update.
* buildsym.c (finish_block): Update.
* cli/cli-dump.c (restore_section_callback): Update.
* fbsd-nat.c (fbsd_find_memory_regions): Update.
* frame.c (frame_unwind_register_value): Update.
* gcore.c (gcore_create_callback): Update.
* hppa-tdep.c (hppa_frame_cache, hppa_skip_trampoline_code): Update.
* i386-tdep.c (i386_displaced_step_fixup, i386_record_modrm,
i386_record_lea_modrm_addr, i386_record_lea_modrm,
i386_process_record): Update.
* ia64-tdep.c (ia64_frame_this_id, ia64_sigtramp_frame_this_id,
ia64_libunwind_frame_this_id, ia64_libunwind_sigtramp_frame_this_id,
ia64_dummy_id, ia64_access_reg, ia64_access_rse_reg): Update.
* infrun.c (displaced_step_prepare, displaced_step_fixup,
handle_inferior_event, insert_step_resume_breakpoint_at_sal,
insert_longjmp_resume_breakpoint): Update.
* linux-nat.c (linux_nat_find_memory_regions): Update.
* linux-record.c (record_linux_system_call): Update.
* mips-tdep.c (heuristic_proc_start, mips_eabi_push_dummy_call,
mips_n32n64_push_dummy_call, mips_o32_push_dummy_call,
mips_o64_push_dummy_call): Update.
* monitor.c (monitor_error, monitor_remove_breakpoint): Update.
* record.c (record_arch_list_add_mem, record_wait,
record_xfer_partial): Update.
* remote-mips.c (mips_fetch_word, mips_check_lsi_error,
mips_common_breakpoint): Update.
* remote-sim.c (gdbsim_xfer_inferior_memory): Update.
* rs6000-tdep.c (ppc_displaced_step_fixup): Update.
* solib-som.c (som_current_sos): Update.
* symfile.c (load_progress, generic_load): Update.
* symfile-mem.c (add_vsyscall_page): Update.
* valops.c (value_fetch_lazy): Update.
* windows-tdep.c (windows_xfer_shared_library): Update.
Update callers of paddr_nz to use paddress instead (changing
user-visible output to make it more correct):
* dwarf2loc.c (locexpr_describe_location): Update.
* ia64-tdep.c (ia64_memory_insert_breakpoint,
ia64_memory_remove_breakpoint): Update.
* jv-valprint.c (java_value_print): Update.
* m32c-tdep.c (m32c_m16c_address_to_pointer): Update.
* monitor.c (monitor_read_memory): Update.
Update callers of paddr to use paddress instead (changing
user-visible output to make it more correct):
* arm-tdep.c (arm_push_dummy_call): Update.
* breakpoint.c (insert_bp_location, create_thread_event_breakpoint,
create_breakpoint): Update.
* darwin-nat-info.c (darwin_debug_regions): Update.
* dcache.c (dcache_info): Update.
* dsrec.c (load_srec, make_srec): Update.
* dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program,
dwarf2_frame_cache): Update.
* gcore.c (gcore_copy_callback): Update.
* gnu-nat.c (gnu_xfer_memory): Update.
* mips-linux-nat.c (mips_show_dr): Update.
* monitor.c (monitor_write_memory, monitor_insert_breakpoint,
monitor_remove_breakpoint): Update.
* remote.c (compare_sections_command): Update.
* remote-m32r-sdi.c (m32r_xfer_memory, m32r_insert_breakpoint,
m32r_remove_breakpoint, m32r_insert_watchpoint,
m32r_remove_watchpoint): Update.
* sol-thread.c (info_cb): Update.
* symfile.c (load_progress): Update.
Update callers of paddress or paddr_nz to use hex_string instead
(changes output of internal/error/debug messages only):
* dwarf2read.c (dump_die_shallow): Update.
* frame.c (fprint_field, fprint_frame, frame_pc_unwind,
get_frame_func, create_new_frame): Update.
* hppa-tdep.c (find_unwind_entry, unwind_command): Update.
* ia64-tdep.c (get_kernel_table, ia64_find_proc_info_x,
ia64_get_dyn_info_list): Update.
* maint.c (maintenance_translate_address): Update.
* mi/mi-cmd-var.c (mi_cmd_var_create): Update.
* target.c (target_flash_erase): Update.
Update callers of paddr/paddr_nz to use phex/phex_nz instead,
using an appropriate address size. Remove use of strlen_paddr.
* exec.c (exec_files_info): Update.
* i386-nat.c (i386_show_dr): Update.
* remote.c (remote_flash_erase): Update.
* m32r-rom.c (m32r_load_section): Update.
* monitor.c (monitor_vsprintf, monitor_store_register): Update.
* remote.c (remote_check_symbols, remote_search_memory): Update.
* remote-mips.c (mips_request, mips_common_breakpoint): Update.
* scm-valprint.c (scm_ipruk, scm_scmval_print): Update.
* sh64-tdep.c (sh64_show_media_regs, sh64_show_compact_regs): Update.
* sh-tdep.c (sh_generic_show_regs, sh3_show_regs, sh2e_show_regs,
sh2a_show_regs, sh2a_nofpu_show_regs, sh3e_show_regs,
sh3_dsp_show_regs, sh4_show_regs, sh4_nofpu_show_regs,
sh_dsp_show_regs): Update.
* xcoffsolib.c (sharedlibrary_command): Update.
* maint.c (maint_print_section_info): Add ADDR_SIZE parameter.
Use hex_string_custom instead of paddr.
(print_bfd_section_info): Pass address size.
(print_objfile_section_info): Likewise.
* annotate.h (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* annotate.c (annotate_source): Add GDBARCH parameter.
(annotate_frame_begin): Likewise.
* source.c (identify_source_line): Update call to annotate_source.
* stack.c (print_frame_info, print_frame): Update call to
annotate_frame_begin.
* breakpoint.c (describe_other_breakpoints): Add GDBARCH parameter.
(create_breakpoint, create_ada_exception_breakpoint): Update call.
* stack.c (print_block_frame_labels): Add GDBARCH parameter.
(print_frame_label_vars): Update call.
* symmisc.c (print_partial_symbols): Add GDBARCH parameter.
(dump_psymtab): Update call to print_partial_symbols.
(struct print_symbol_args): Add GDBARCH member.
(dump_symtab_1): Set print_symbol_args architecture member.
(print_symbol): Use it.
* windows-tdep.h (windows_xfer_shared_library): Add GDBARCH
parameter.
* windows-tdep.c (windows_xfer_shared_library): Likewise.
* i386-cygwin-tdep.c (struct cpms_data): Add GDBARCH member.
(core_process_module_section): Pass architecture from cpms_data to
windows_xfer_shared_library.
(windows_core_xfer_shared_libraries): Initialize cmps_data
architecture member.
* windows-nat.c (windows_xfer_shared_libraries): Pass architecture
to windows_xfer_shared_library.
* defs.h (print_address): Add GDBARCH parameter.
* printcmd.c (print_address): Add GDBARCH parameter.
(print_scalar_formatted, do_examine): Update call.
* findcmd.c (find_command): Update call.
* tracepoint.c: Include "arch-utils.h".
(trace_find_line_command): Update call.
* tui/tui-disasm.c (tui_disassemble): Update call.
* value.h (print_address_demangle): Add GDBARCH parameter.
* printcmd.c (print_address_demangle): Add GDBARCH parameter.
* c-valprint.c (print_function_pointer_address, c_val_print):
Update call.
* f-valprint.c (f_val_print): Update call.
* gnu-v3-abi.c (gnuv3_print_method_ptr): Update call.
* jv-valprint.c (java_val_print): Update call.
* m2-valprint.c (print_function_pointer_address, m2_val_print):
Update call.
* p-valprint.c (pascal_val_print): Update call.
* disasm.c (gdb_disassemble_info): Install architecture into
di.application_data field.
testsuite/ChangeLog:
* gdb.threads/tls-shared.exp: Update to locexpr_describe_location
change to prefix TLS offset in hex with 0x.
doc/ChangeLog:
* gdbint.texinfo (Item Output Functions): Update signature
for ui_out_field_core_addr.
2009-07-02 17:21:10 +00:00
|
|
|
warning (_("Memory read failed for corefile section, %s bytes at %s."),
|
|
|
|
plongest (size),
|
|
|
|
paddress (target_gdbarch, bfd_section_vma (obfd, osec)));
|
2006-10-20 22:06:28 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!bfd_set_section_contents (obfd, osec, memhunk, offset, size))
|
|
|
|
{
|
|
|
|
warning (_("Failed to write corefile contents (%s)."),
|
|
|
|
bfd_errmsg (bfd_get_error ()));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
total_size -= size;
|
|
|
|
offset += size;
|
|
|
|
}
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
do_cleanups (old_chain); /* Frees MEMHUNK. */
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
gcore_memory_sections (bfd *obfd)
|
|
|
|
{
|
|
|
|
if (target_find_memory_regions (gcore_create_callback, obfd) != 0)
|
2003-09-04 21:05:49 +00:00
|
|
|
return 0; /* FIXME: error return/msg? */
|
2002-01-09 00:37:02 +00:00
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Record phdrs for section-to-segment mapping. */
|
2002-01-09 00:37:02 +00:00
|
|
|
bfd_map_over_sections (obfd, make_output_phdrs, NULL);
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
/* Copy memory region contents. */
|
2002-01-09 00:37:02 +00:00
|
|
|
bfd_map_over_sections (obfd, gcore_copy_callback, NULL);
|
|
|
|
|
2003-09-04 21:05:49 +00:00
|
|
|
return 1;
|
2002-01-09 00:37:02 +00:00
|
|
|
}
|
|
|
|
|
2008-02-21 Pedro Alves <pedro@codesorcery.com>
Silence a few -Wmissing-prototypes warnings.
PR build/9877:
* amd64-nat.c: Include "amd64-nat.h".
* fork-child.c (_initialize_fork_child): Ditto.
* gcore.c (_initialize_gcore): Ditto.
* inf-ptrace.c: Include "inf-ptrace.h".
(inf_ptrace_store_registers): Make it static.
* linux-nat.c (linux_nat_terminal_ours): Make it static.
(_initialize_linux_nat): Declare before definition.
* linux-tdep.c: Include "linux-tdep.h".
* linux-thread-db.c (_initialize_thread_db): Declare before
definition.
* proc-service.c (_initialize_proc_service): Ditto.
* remote.c (remote_send_printf): Make it static.
* solib.c: Include "solib.h".
* symfile-mem.c (_initialize_symfile_mem): Declare before
definition.
* ada-lang.c (ada_la_decode, ada_match_name)
(ada_suppress_symbol_printing, ada_is_array_type)
(ada_value_ptr_subscript, ada_array_length)
(ada_to_static_fixed_value): Make them static.
(_initialize_ada_language): Declare before definition.
* ada-tasks.c (ada_get_task_number, ada_get_environment_task)
(ada_task_list_changed, ada_new_objfile_observer): Make them
static.
(_initialize_tasks): Declare before definition.
* addrmap.c (_initialize_addrmap): Declare before definition.
* auxv.c (default_auxv_parse): Make it static.
* bfd-target.c (target_bfd_xfer_partial, target_bfd_xclose): Make
them static.
* breakpoint.c (remove_sal): Add line break.
(expand_line_sal_maybe): Make it static.
* cp-name-parser.y: Include "cp-support.h".
* cp-valprint.c (cp_find_class_member): Make it static.
* eval.c (value_f90_subarray): Ditto.
* exceptions.c (print_any_exception): Ditto.
* findcmd.c (_initialize_mem_search): Declare before definition.
* frame.c (frame_observer_target_changed): Make it static.
* gnu-v3-abi.c (gnuv3_find_method_in): Make it static.
* inf-child.c: Include "inf-child.h".
* inferior.h (valid_inferior_id): Rename to ...
(valid_gdb_inferior_id): ... this.
* infrun.c (infrun_thread_stop_requested, siginfo_make_value):
Make them static.
* jv-lang.c (java_language_arch_info): Make it static.
* m2-typeprint.c (m2_get_discrete_bounds): Ditto.
* osdata.c (info_osdata_command): Make it static.
* regcache.c (regcache_observer_target_changed): Make it static.
* reverse.c (_initialize_reverse): Declare before definition.
* stabsread.c (cleanup_undefined_types_noname)
(cleanup_undefined_types_1): Make them static.
* symfile.c (place_section): Make it static.
* symtab.c (find_pc_sect_psymtab_closer): Make it static.
* target-descriptions.c (_initialize_target_descriptions): Declare
before definition.
* target.c (default_get_ada_task_ptid, find_default_can_async_p)
(find_default_is_async_p, find_default_supports_non_stop): Make
them static.
(target_supports_non_stop): Add prototype.
(dummy_pid_to_str): Make it static.
* utils.c (_initialize_utils): Declare before definition.
* ada-exp.y (_initialize_ada_exp): Declare before definition.
* solib-svr4.c (HAS_LM_DYNAMIC_FROM_LINK_MAP): Add a prototype.
* target.h (struct target_ops): Add a prototype to the
to_can_execute_reverse callback.
* macroscope.c (_initialize_macroscope): Declare before definition.
* cp-namespace.c (_initialize_cp_namespace): Declare before definition.
* python/python.c (_initialize_python): Declare before definition.
* tui/tui-command.c: Include "tui/tui-command.h".
* tui/tui-data.c (init_content_element, init_win_info): Make them
static.
* tui/tui-disasm.c: Include "tui/tui-disasm.h".
* tui/tui-interp.c (_initialize_tui_interp): Declare before
definition.
* tui/tui-layout.c: Include "tui/tui-layout.h".
(_initialize_tui_layout): Declare before definition.
* tui/tui-regs.c: Include "tui/tui-regs.h".
(tui_display_reg_element_at_line): Make it static.
(_initialize_tui_regs): Declare before definition.
* tui/tui-stack.c (_initialize_tui_stack): Declare before
definition.
* tui/tui-win.c: Include "tui/tui-win.h".
(_initialize_tui_win): Declare before definition.
(tui_sigwinch_handler): Make it static. Wrap in ifdef SIGWINCH.
* tui/tui-win.h (tui_sigwinch_handler): Delete declaration.
(tui_get_cmd_list): Add a prototype.
* tui/tui-windata.c: Include tui-windata.h.
* tui/tui-wingeneral.c (box_win): Make it static.
* cli/cli-logging.c (show_logging_command): Make it static.
(_initialize_cli_logging): Declare before definition.
* mi/mi-common.c (_initialize_gdb_mi_common): Declare before
definition.
2009-02-21 16:14:50 +00:00
|
|
|
/* Provide a prototype to silence -Wmissing-prototypes. */
|
|
|
|
extern initialize_file_ftype _initialize_gcore;
|
|
|
|
|
2002-01-09 00:37:02 +00:00
|
|
|
void
|
|
|
|
_initialize_gcore (void)
|
|
|
|
{
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
|
|
|
add_com ("generate-core-file", class_files, gcore_command, _("\
|
2003-09-04 21:05:49 +00:00
|
|
|
Save a core file with the current state of the debugged process.\n\
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 15:49:28 +00:00
|
|
|
Argument is optional filename. Default filename is 'core.<process_id>'."));
|
2002-01-09 00:37:02 +00:00
|
|
|
|
|
|
|
add_com_alias ("gcore", "generate-core-file", class_files, 1);
|
|
|
|
exec_set_find_memory_regions (objfile_find_memory_regions);
|
|
|
|
}
|