aboutsummaryrefslogtreecommitdiff
path: root/gdb/maint.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1993-09-22 15:23:53 +0000
committerStu Grossman <grossman@cygnus>1993-09-22 15:23:53 +0000
commitb1eaba9ac4cd19372b06a7abba451eb8738be0bb (patch)
treefbdd3cd19d2958a8a413833957646a7f990718ca /gdb/maint.c
parentbdb45162af47446ac76ee0d5db2ceecb1a9058a7 (diff)
downloadgdb-b1eaba9ac4cd19372b06a7abba451eb8738be0bb.zip
gdb-b1eaba9ac4cd19372b06a7abba451eb8738be0bb.tar.gz
gdb-b1eaba9ac4cd19372b06a7abba451eb8738be0bb.tar.bz2
* Makefile.in: Add i386lynx-tdep to the right places.
(TARDIRS): Add gdbserver. * exec.c (print_section_info): Print entry point. * i386lynx-nat.c (i386lynx_saved_pc_after_call): Move into i386lynx-tdep.c. Add core file support. * i386lynx-tdep.c: New module for Lynx/386 target dependant code. * maint.c: Add `maint info sections' command to print info about all sections that BFD knows about for exec and core files. * sparc-tdep.c (sparc_push_dummy_frame): Update stack pointer before putting frame on the stack. Consolidate writes to reduce traffic for remote debugging. * config/i386/i386lynx.mh (NATDEPFILES): Remove exec.o. * config/i386/i386lynx.mt (TDEPFILES): Add exec.o, i386lynx-tdep.o. * config/i386/nm-i386lynx.h: Add target_pid_to_str(). * config/i386/tm-i386lynx.h: Remove target_pid_to_str(). * sparclite/Makefile.in: Add deps to keep Sun make happy.
Diffstat (limited to 'gdb/maint.c')
-rw-r--r--gdb/maint.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/gdb/maint.c b/gdb/maint.c
index 9a37fe0..bc73bdc 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -29,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "symtab.h"
#include "gdbtypes.h"
#include "demangle.h"
+#include "gdbcore.h"
static void
maintenance_command PARAMS ((char *, int));
@@ -124,6 +125,79 @@ maintenance_info_command (arg, from_tty)
help_list (maintenanceinfolist, "maintenance info ", -1, stdout);
}
+static void
+print_section_table (abfd, asect, ignore)
+ bfd *abfd;
+ asection *asect;
+ PTR ignore;
+{
+ flagword flags;
+
+ flags = bfd_get_section_flags (abfd, asect);
+
+ printf_filtered (" %s",
+ local_hex_string_custom (bfd_section_vma (abfd, asect),
+ "08"));
+ printf_filtered ("->%s",
+ local_hex_string_custom ((bfd_section_vma (abfd, asect)
+ + bfd_section_size (abfd, asect)),
+ "08"));
+ printf_filtered (" at %s", local_hex_string_custom (asect->filepos, "08"));
+ printf_filtered (": %s", bfd_section_name (abfd, asect));
+
+ if (flags & SEC_ALLOC)
+ printf_filtered (" ALLOC");
+ if (flags & SEC_LOAD)
+ printf_filtered (" LOAD");
+ if (flags & SEC_RELOC)
+ printf_filtered (" RELOC");
+ if (flags & SEC_READONLY)
+ printf_filtered (" READONLY");
+ if (flags & SEC_CODE)
+ printf_filtered (" CODE");
+ if (flags & SEC_DATA)
+ printf_filtered (" DATA");
+ if (flags & SEC_ROM)
+ printf_filtered (" ROM");
+ if (flags & SEC_CONSTRUCTOR)
+ printf_filtered (" CONSTRUCTOR");
+ if (flags & SEC_HAS_CONTENTS)
+ printf_filtered (" HAS_CONTENTS");
+ if (flags & SEC_NEVER_LOAD)
+ printf_filtered (" NEVER_LOAD");
+ if (flags & SEC_SHARED_LIBRARY)
+ printf_filtered (" SHARED_LIBRARY");
+ if (flags & SEC_IS_COMMON)
+ printf_filtered (" IS_COMMON");
+
+ printf_filtered ("\n");
+}
+
+/* ARGSUSED */
+static void
+maintenance_info_sections (arg, from_tty)
+ char *arg;
+ int from_tty;
+{
+ if (exec_bfd)
+ {
+ printf_filtered ("Exec file:\n");
+ printf_filtered (" `%s', ", bfd_get_filename(exec_bfd));
+ wrap_here (" ");
+ printf_filtered ("file type %s.\n", bfd_get_target(exec_bfd));
+ bfd_map_over_sections(exec_bfd, print_section_table, 0);
+ }
+
+ if (core_bfd)
+ {
+ printf_filtered ("Core file:\n");
+ printf_filtered (" `%s', ", bfd_get_filename(core_bfd));
+ wrap_here (" ");
+ printf_filtered ("file type %s.\n", bfd_get_target(core_bfd));
+ bfd_map_over_sections(core_bfd, print_section_table, 0);
+ }
+}
+
/* The "maintenance print" command is defined as a prefix, with allow_unknown
0. Therefore, its own definition is called only for "maintenance print"
with no args. */
@@ -174,6 +248,10 @@ to test internal functions such as the C++ demangler, etc.",
&maintenanceinfolist, "maintenance info ", 0,
&maintenancelist);
+ add_cmd ("sections", class_maintenance, maintenance_info_sections,
+ "List the BFD sections of the exec and core files.",
+ &maintenanceinfolist);
+
add_prefix_cmd ("print", class_maintenance, maintenance_print_command,
"Maintenance command for printing GDB internal state.",
&maintenanceprintlist, "maintenance print ", 0,