diff options
author | Michael Snyder <msnyder@vmware.com> | 2002-02-14 01:57:36 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2002-02-14 01:57:36 +0000 |
commit | 6dbdc4a3629d75a46908c071d8caba9e66da03ab (patch) | |
tree | 5613ac9982b51135ed18ff75b44c8f277e261b88 /gdb/gcore.c | |
parent | 89d97283d3d7388b0d72ad67ceb3bd0ffc95dac7 (diff) | |
download | binutils-6dbdc4a3629d75a46908c071d8caba9e66da03ab.zip binutils-6dbdc4a3629d75a46908c071d8caba9e66da03ab.tar.gz binutils-6dbdc4a3629d75a46908c071d8caba9e66da03ab.tar.bz2 |
2002-02-13 Michael Snyder <msnyder@redhat.com>
* gcore.c (gcore_command): Use gcore_default_target instead of NULL.
(default_gcore_mach): Just return 0, work around a problem in bfd.
(default_gcore_target): OK to return NULL if exec_bfd is null.
(make_mem_sec): Use a cast, avoid a warning.
* procfs.c (find_memory_regions_callback): Use a cast instead of
calling host_pointer_to_address (which complains if
sizeof (host pointer) != sizeof (target pointer)).
(procfs_make_note_section): Avoid overflow in psargs string.
Diffstat (limited to 'gdb/gcore.c')
-rw-r--r-- | gdb/gcore.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gdb/gcore.c b/gdb/gcore.c index 56c1da4..494efad 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -63,7 +63,7 @@ gcore_command (char *args, int from_tty) "Opening corefile '%s' for output.\n", corefilename); /* Open the output file. */ - if (!(obfd = bfd_openw (corefilename, NULL /*default_gcore_target ()*/))) + if (!(obfd = bfd_openw (corefilename, default_gcore_target ()))) { error ("Failed to open '%s' for output.", corefilename); } @@ -117,16 +117,20 @@ gcore_command (char *args, int from_tty) static unsigned long default_gcore_mach (void) { +#if 1 /* See if this even matters... */ + return 0; +#else #ifdef TARGET_ARCHITECTURE const struct bfd_arch_info * bfdarch = TARGET_ARCHITECTURE; if (bfdarch != NULL) return bfdarch->mach; -#endif +#endif /* TARGET_ARCHITECTURE */ 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 @@ -149,9 +153,9 @@ default_gcore_target (void) { /* FIXME -- this may only work for ELF targets. */ if (exec_bfd == NULL) - error ("Can't find default bfd target for corefile (need execfile)."); - - return bfd_get_target (exec_bfd); + return NULL; + else + return bfd_get_target (exec_bfd); } /* @@ -344,8 +348,8 @@ make_mem_sec (bfd *obfd, if (info_verbose) { fprintf_filtered (gdb_stdout, - "Save segment, %ld bytes at 0x%s\n", - size, paddr_nz (addr)); + "Save segment, %lld bytes at 0x%s\n", + (long long) size, paddr_nz (addr)); } bfd_set_section_size (obfd, osec, size); |