This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] implements MI "-file-list-exec-sections"
- From: Stefan Weyergraf <stefan at weyergraf dot de>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 22 Mar 2004 19:28:47 +0100
- Subject: [PATCH] implements MI "-file-list-exec-sections"
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm not quite sure this is the way to go:
- - Add ui_out parameter to target_ops.to_files_info + followups.
- - Converted print_section_info (exec.c) to use ui_out system.
- - Made mi/mi-cmds use target_info(...) (target.c)
Help anyone?
Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAXzB5EP9tKMRlxN8RAp0KAJ90guBtj36KdAAGnxqhCVGc00Ac+wCfTBTo
AbLRkw6tx6U8IY9cgooOdVA=
=Q2qd
-----END PGP SIGNATURE-----
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.36
diff -u -3 -p -r1.36 corelow.c
--- corelow.c 28 Feb 2004 18:04:36 -0000 1.36
+++ corelow.c 22 Mar 2004 18:15:27 -0000
@@ -66,7 +66,7 @@ static struct core_fns *core_vec = NULL;
struct gdbarch *core_gdbarch = NULL;
-static void core_files_info (struct target_ops *);
+static void core_files_info (struct target_ops *, struct ui_out *);
#ifdef SOLIB_ADD
static int solib_add_stub (void *);
@@ -511,9 +511,9 @@ get_core_registers (int regno)
}
static void
-core_files_info (struct target_ops *t)
+core_files_info (struct target_ops *t, struct ui_out *uiout)
{
- print_section_info (t, core_bfd);
+ print_section_info (t, core_bfd, uiout);
}
static LONGEST
Index: exec.c
===================================================================
RCS file: /cvs/src/src/gdb/exec.c,v
retrieving revision 1.36
diff -u -3 -p -r1.36 exec.c
--- exec.c 28 Feb 2004 18:04:37 -0000 1.36
+++ exec.c 22 Mar 2004 18:15:27 -0000
@@ -63,7 +63,7 @@ static void file_command (char *, int);
static void set_section_command (char *, int);
-static void exec_files_info (struct target_ops *);
+static void exec_files_info (struct target_ops *, struct ui_out *);
static int ignore (CORE_ADDR, char *);
@@ -521,8 +521,9 @@ xfer_memory (CORE_ADDR memaddr, char *my
void
-print_section_info (struct target_ops *t, bfd *abfd)
+print_section_info (struct target_ops *t, bfd *abfd, struct ui_out *uiout)
{
+#if 0
struct section_table *p;
/* FIXME: "016l" is not wide enough when TARGET_ADDR_BIT > 64. */
char *fmt = TARGET_ADDR_BIT <= 32 ? "08l" : "016l";
@@ -556,12 +557,52 @@ print_section_info (struct target_ops *t
}
printf_filtered ("\n");
}
+#else
+ struct section_table *p;
+ ui_out_text(uiout, "Short: ");
+ ui_out_field_string (uiout, "short-target-type", t->to_shortname);
+ ui_out_text(uiout, "\n");
+// printf_filtered ("\t`%s', ", bfd_get_filename (abfd));
+
+ ui_out_text(uiout, "\t`");
+ ui_out_field_string (uiout, "filename", bfd_get_filename (abfd));
+ ui_out_text(uiout, "', ");
+
+// wrap_here (" ");
+ ui_out_wrap_hint(uiout, " ");
+
+// printf_filtered ("file type %s.\n", bfd_get_target (abfd));
+ ui_out_text(uiout, "file type ");
+ ui_out_field_string (uiout, "file-type", bfd_get_target (abfd));
+ ui_out_text(uiout, "\n");
+
+ if (abfd == exec_bfd)
+ {
+ ui_out_text(uiout, "\tEntry point: ");
+ ui_out_field_core_addr (uiout, "target-entrypoint", bfd_get_start_address (abfd));
+ ui_out_text(uiout, "\n");
+ }
+ ui_out_begin (uiout, ui_out_type_list, "sections");
+ for (p = t->to_sections; p < t->to_sections_end; p++)
+ {
+ ui_out_begin (uiout, ui_out_type_tuple, NULL);
+ ui_out_text(uiout, "\t");
+ ui_out_field_core_addr (uiout, "start-address", p->addr);
+ ui_out_text(uiout, " - ");
+ ui_out_field_core_addr (uiout, "end-address", p->endaddr);
+ ui_out_text(uiout, " in ");
+ ui_out_field_string (uiout, "section-name", bfd_section_name (p->bfd, p->the_bfd_section));
+ ui_out_text(uiout, "\n");
+ ui_out_end (uiout, ui_out_type_tuple);
+ }
+ ui_out_end (uiout, ui_out_type_list);
+#endif
}
static void
-exec_files_info (struct target_ops *t)
+exec_files_info (struct target_ops *t, struct ui_out *uiout)
{
- print_section_info (t, exec_bfd);
+ print_section_info (t, exec_bfd, uiout);
if (vmap)
{
@@ -653,7 +694,7 @@ set_section_command (char *args, int fro
p->addr += offset;
p->endaddr += offset;
if (from_tty)
- exec_files_info (&exec_ops);
+ exec_files_info (&exec_ops, uiout);
return;
}
}
Index: go32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/go32-nat.c,v
retrieving revision 1.37
diff -u -3 -p -r1.37 go32-nat.c
--- go32-nat.c 29 Dec 2003 07:42:43 -0000 1.37
+++ go32-nat.c 22 Mar 2004 18:15:28 -0000
@@ -180,7 +180,7 @@ static int go32_xfer_memory (CORE_ADDR m
int write,
struct mem_attrib *attrib,
struct target_ops *target);
-static void go32_files_info (struct target_ops *target);
+static void go32_files_info (struct target_ops *target, struct ui_out *);
static void go32_stop (void);
static void go32_kill_inferior (void);
static void go32_create_inferior (char *exec_file, char *args, char **env);
@@ -550,7 +550,7 @@ go32_xfer_memory (CORE_ADDR memaddr, cha
static cmdline_t child_cmd; /* parsed child's command line kept here */
static void
-go32_files_info (struct target_ops *target)
+go32_files_info (struct target_ops *target, struct ui_out *uiout)
{
printf_unfiltered ("You are running a DJGPP V2 program.\n");
}
Index: hpux-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpux-thread.c,v
retrieving revision 1.21
diff -u -3 -p -r1.21 hpux-thread.c
--- hpux-thread.c 2 Oct 2003 20:28:29 -0000 1.21
+++ hpux-thread.c 22 Mar 2004 18:15:28 -0000
@@ -411,9 +411,9 @@ hpux_thread_xfer_memory (CORE_ADDR memad
/* Print status information about what we're accessing. */
static void
-hpux_thread_files_info (struct target_ops *ignore)
+hpux_thread_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
- child_ops.to_files_info (ignore);
+ child_ops.to_files_info (ignore, uiout);
}
static void
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.105
diff -u -3 -p -r1.105 infcmd.c
--- infcmd.c 14 Feb 2004 17:26:35 -0000 1.105
+++ infcmd.c 22 Mar 2004 18:15:28 -0000
@@ -1308,7 +1308,7 @@ program_info (char *args, int from_tty)
return;
}
- target_files_info ();
+ target_files_info (uiout);
printf_filtered ("Program stopped at %s.\n",
local_hex_string ((unsigned long) stop_pc));
if (stop_step)
Index: inftarg.c
===================================================================
RCS file: /cvs/src/src/gdb/inftarg.c,v
retrieving revision 1.23
diff -u -3 -p -r1.23 inftarg.c
--- inftarg.c 4 Feb 2004 21:49:55 -0000 1.23
+++ inftarg.c 22 Mar 2004 18:15:28 -0000
@@ -59,7 +59,7 @@ void child_post_wait (ptid_t, int);
static void child_open (char *, int);
-static void child_files_info (struct target_ops *);
+static void child_files_info (struct target_ops *, struct ui_out *);
static void child_detach (char *, int);
@@ -300,7 +300,7 @@ child_prepare_to_store (void)
/* Print status information about what we're accessing. */
static void
-child_files_info (struct target_ops *ignore)
+child_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
printf_unfiltered ("\tUsing the running image of %s %s.\n",
attach_flag ? "attached" : "child", target_pid_to_str (inferior_ptid));
Index: monitor.c
===================================================================
RCS file: /cvs/src/src/gdb/monitor.c,v
retrieving revision 1.46
diff -u -3 -p -r1.46 monitor.c
--- monitor.c 21 Jan 2004 15:37:11 -0000 1.46
+++ monitor.c 22 Mar 2004 18:15:28 -0000
@@ -83,7 +83,7 @@ static int monitor_xfer_memory (CORE_ADD
int write,
struct mem_attrib *attrib,
struct target_ops *target);
-static void monitor_files_info (struct target_ops *ops);
+static void monitor_files_info (struct target_ops *ops, struct ui_out *uiout);
static int monitor_insert_breakpoint (CORE_ADDR addr, char *shadow);
static int monitor_remove_breakpoint (CORE_ADDR addr, char *shadow);
static void monitor_kill (void);
@@ -1408,7 +1408,7 @@ monitor_prepare_to_store (void)
}
static void
-monitor_files_info (struct target_ops *ops)
+monitor_files_info (struct target_ops *ops, struct ui_out *uiout)
{
printf_unfiltered ("\tAttached to %s at %d baud.\n", dev_name, baud_rate);
}
Index: nto-procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/nto-procfs.c,v
retrieving revision 1.3
diff -u -3 -p -r1.3 nto-procfs.c
--- nto-procfs.c 18 Jul 2003 17:15:33 -0000 1.3
+++ nto-procfs.c 22 Mar 2004 18:15:28 -0000
@@ -485,7 +485,7 @@ procfs_meminfo (char *args, int from_tty
/* Print status information about what we're accessing. */
static void
-procfs_files_info (struct target_ops *ignore)
+procfs_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
printf_unfiltered ("\tUsing the running image of %s %s via %s.\n",
attach_flag ? "attached" : "child",
Index: ocd.c
===================================================================
RCS file: /cvs/src/src/gdb/ocd.c,v
retrieving revision 1.28
diff -u -3 -p -r1.28 ocd.c
--- ocd.c 18 Jan 2004 19:26:51 -0000 1.28
+++ ocd.c 22 Mar 2004 18:15:28 -0000
@@ -723,7 +723,7 @@ ocd_xfer_memory (CORE_ADDR memaddr, char
}
void
-ocd_files_info (struct target_ops *ignore)
+ocd_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
puts_filtered ("Debugging a target over a serial line.\n");
}
Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.53
diff -u -3 -p -r1.53 procfs.c
--- procfs.c 15 Feb 2004 22:38:40 -0000 1.53
+++ procfs.c 22 Mar 2004 18:15:29 -0000
@@ -117,7 +117,7 @@ static void procfs_detach (char *, int);
static void procfs_resume (ptid_t, int, enum target_signal);
static int procfs_can_run (void);
static void procfs_stop (void);
-static void procfs_files_info (struct target_ops *);
+static void procfs_files_info (struct target_ops *, struct ui_out *);
static void procfs_fetch_registers (int);
static void procfs_store_registers (int);
static void procfs_notice_signals (ptid_t);
@@ -4587,13 +4587,13 @@ procfs_notice_signals (ptid_t ptid)
}
/*
- * Function: target_files_info
+ * Function: procfs_files_info
*
* Print status information about the child process.
*/
static void
-procfs_files_info (struct target_ops *ignore)
+procfs_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
printf_filtered ("\tUsing the running image of %s %s via /proc.\n",
attach_flag? "attached": "child",
Index: remote-e7000.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-e7000.c,v
retrieving revision 1.39
diff -u -3 -p -r1.39 remote-e7000.c
--- remote-e7000.c 11 Dec 2003 06:21:12 -0000 1.39
+++ remote-e7000.c 22 Mar 2004 18:15:29 -0000
@@ -1051,7 +1051,7 @@ e7000_prepare_to_store (void)
}
static void
-e7000_files_info (struct target_ops *ops)
+e7000_files_info (struct target_ops *ops, struct ui_out *uiout)
{
printf_unfiltered ("\tAttached to %s at %d baud.\n", dev_name, baudrate);
}
Index: remote-m32r-sdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-m32r-sdi.c,v
retrieving revision 1.2
diff -u -3 -p -r1.2 remote-m32r-sdi.c
--- remote-m32r-sdi.c 10 Mar 2004 00:18:44 -0000 1.2
+++ remote-m32r-sdi.c 22 Mar 2004 18:15:29 -0000
@@ -1058,7 +1058,7 @@ m32r_prepare_to_store (void)
}
static void
-m32r_files_info (struct target_ops *target)
+m32r_files_info (struct target_ops *target, struct ui_out *uiout)
{
char *file = "nothing";
Index: remote-mips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-mips.c,v
retrieving revision 1.44
diff -u -3 -p -r1.44 remote-mips.c
--- remote-mips.c 21 Jan 2004 15:37:11 -0000 1.44
+++ remote-mips.c 22 Mar 2004 18:15:30 -0000
@@ -112,7 +112,7 @@ static int mips_xfer_memory (CORE_ADDR m
struct mem_attrib *attrib,
struct target_ops *target);
-static void mips_files_info (struct target_ops *ignore);
+static void mips_files_info (struct target_ops *ignore, struct ui_out *uiout);
static void mips_create_inferior (char *execfile, char *args, char **env);
@@ -2114,7 +2114,7 @@ mips_xfer_memory (CORE_ADDR memaddr, cha
/* Print info on this target. */
static void
-mips_files_info (struct target_ops *ignore)
+mips_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
printf_unfiltered ("Debugging a MIPS board over a serial line.\n");
}
Index: remote-rdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-rdi.c,v
retrieving revision 1.31
diff -u -3 -p -r1.31 remote-rdi.c
--- remote-rdi.c 12 Feb 2004 18:43:09 -0000 1.31
+++ remote-rdi.c 22 Mar 2004 18:15:30 -0000
@@ -52,7 +52,7 @@ extern int isascii (int);
/* Prototypes for local functions */
-static void arm_rdi_files_info (struct target_ops *ignore);
+static void arm_rdi_files_info (struct target_ops *ignore, struct ui_out *uiout);
static int arm_rdi_xfer_memory (CORE_ADDR memaddr, char *myaddr,
int len, int should_write,
@@ -609,7 +609,7 @@ arm_rdi_xfer_memory (CORE_ADDR memaddr,
/* Display random info collected from the target. */
static void
-arm_rdi_files_info (struct target_ops *ignore)
+arm_rdi_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
char *file = "nothing";
int rslt;
Index: remote-rdp.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-rdp.c,v
retrieving revision 1.35
diff -u -3 -p -r1.35 remote-rdp.c
--- remote-rdp.c 22 Nov 2003 15:48:30 -0000 1.35
+++ remote-rdp.c 22 Mar 2004 18:15:30 -0000
@@ -1341,7 +1341,7 @@ dump_bits (struct yn *t, int info)
}
static void
-remote_rdp_files_info (struct target_ops *target)
+remote_rdp_files_info (struct target_ops *target, struct ui_out *uiout)
{
printf_filtered ("Target capabilities:\n");
dump_bits (stepinfo, ds.step_info);
Index: remote-sds.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sds.c,v
retrieving revision 1.28
diff -u -3 -p -r1.28 remote-sds.c
--- remote-sds.c 19 Jan 2004 01:20:11 -0000 1.28
+++ remote-sds.c 22 Mar 2004 18:15:30 -0000
@@ -55,7 +55,7 @@ static int sds_write_bytes (CORE_ADDR, c
static int sds_read_bytes (CORE_ADDR, char *, int);
-static void sds_files_info (struct target_ops *ignore);
+static void sds_files_info (struct target_ops *ignore, struct ui_out *uiout);
static int sds_xfer_memory (CORE_ADDR, char *, int, int,
struct mem_attrib *, struct target_ops *);
@@ -658,7 +658,7 @@ sds_xfer_memory (CORE_ADDR memaddr, char
static void
-sds_files_info (struct target_ops *ignore)
+sds_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
puts_filtered ("Debugging over a serial connection, using SDS protocol.\n");
}
Index: remote-sim.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sim.c,v
retrieving revision 1.35
diff -u -3 -p -r1.35 remote-sim.c
--- remote-sim.c 2 Feb 2004 16:14:36 -0000 1.35
+++ remote-sim.c 22 Mar 2004 18:15:30 -0000
@@ -102,7 +102,7 @@ static int gdbsim_xfer_inferior_memory (
struct mem_attrib *attrib,
struct target_ops *target);
-static void gdbsim_files_info (struct target_ops *target);
+static void gdbsim_files_info (struct target_ops *target, struct ui_out *uiout);
static void gdbsim_mourn_inferior (void);
@@ -778,7 +778,7 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m
}
static void
-gdbsim_files_info (struct target_ops *target)
+gdbsim_files_info (struct target_ops *target, struct ui_out *uiout)
{
char *file = "nothing";
Index: remote-st.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-st.c,v
retrieving revision 1.19
diff -u -3 -p -r1.19 remote-st.c
--- remote-st.c 18 Sep 2003 22:39:21 -0000 1.19
+++ remote-st.c 22 Mar 2004 18:15:30 -0000
@@ -481,7 +481,7 @@ st2000_prepare_to_store (void)
}
static void
-st2000_files_info (void)
+st2000_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
printf ("\tAttached to %s at %d baud.\n",
dev_name, baudrate);
Index: remote-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-utils.c,v
retrieving revision 1.13
diff -u -3 -p -r1.13 remote-utils.c
--- remote-utils.c 23 Mar 2002 17:38:12 -0000 1.13
+++ remote-utils.c 22 Mar 2004 18:15:30 -0000
@@ -430,7 +430,7 @@ gr_detach (char *args, int from_tty)
}
void
-gr_files_info (struct target_ops *ops)
+gr_files_info (struct target_ops *ops, struct ui_out *uiout)
{
#ifdef __GO32__
printf_filtered ("\tAttached to DOS asynctsr\n");
Index: remote-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/remote-utils.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 remote-utils.h
--- remote-utils.h 12 Apr 2003 17:41:25 -0000 1.9
+++ remote-utils.h 22 Mar 2004 18:15:30 -0000
@@ -119,7 +119,7 @@ long sr_get_hex_word (void);
void gr_close (int quitting);
void gr_create_inferior (char *execfile, char *args, char **env);
void gr_detach (char *args, int from_tty);
-void gr_files_info (struct target_ops *ops);
+void gr_files_info (struct target_ops *ops, struct ui_out *uiout);
void gr_generic_checkin (void);
void gr_kill (void);
void gr_mourn (void);
Index: remote-vx.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-vx.c,v
retrieving revision 1.30
diff -u -3 -p -r1.30 remote-vx.c
--- remote-vx.c 21 Sep 2003 01:26:45 -0000 1.30
+++ remote-vx.c 22 Mar 2004 18:15:31 -0000
@@ -554,7 +554,7 @@ vx_xfer_memory (CORE_ADDR memaddr, char
}
static void
-vx_files_info (void)
+vx_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
printf_unfiltered ("\tAttached to host `%s'", vx_host);
printf_unfiltered (", which has %sfloating point", target_has_fp ? "" : "no ");
@@ -562,7 +562,7 @@ vx_files_info (void)
}
static void
-vx_run_files_info (void)
+vx_run_files_info (struct target_ops *ignore, struct ui_out *)
{
printf_unfiltered ("\tRunning %s VxWorks process %s",
vx_running ? "child" : "attached",
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.131
diff -u -3 -p -r1.131 remote.c
--- remote.c 15 Mar 2004 20:38:08 -0000 1.131
+++ remote.c 22 Mar 2004 18:15:31 -0000
@@ -70,7 +70,7 @@ void async_remote_interrupt_twice (gdb_c
static void build_remote_gdbarch_data (void);
-static void remote_files_info (struct target_ops *ignore);
+static void remote_files_info (struct target_ops *ignore, struct ui_out *uiout);
static int remote_xfer_memory (CORE_ADDR memaddr, char *myaddr,
int len, int should_write,
@@ -3832,7 +3832,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
}
static void
-remote_files_info (struct target_ops *ignore)
+remote_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
puts_filtered ("Debugging a target over a serial line.\n");
}
Index: sol-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/sol-thread.c,v
retrieving revision 1.39
diff -u -3 -p -r1.39 sol-thread.c
--- sol-thread.c 1 Feb 2004 22:35:28 -0000 1.39
+++ sol-thread.c 22 Mar 2004 18:15:31 -0000
@@ -784,9 +784,9 @@ sol_thread_xfer_partial (struct target_o
/* Print status information about what we're accessing. */
static void
-sol_thread_files_info (struct target_ops *ignore)
+sol_thread_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
- procfs_ops.to_files_info (ignore);
+ procfs_ops.to_files_info (ignore, uiout);
}
static void
@@ -1455,9 +1455,9 @@ sol_core_detach (char *args, int from_tt
}
static void
-sol_core_files_info (struct target_ops *t)
+sol_core_files_info (struct target_ops *t, struct ui_out *uiout)
{
- orig_core_ops.to_files_info (t);
+ orig_core_ops.to_files_info (t, uiout);
}
/* Worker bee for info sol-thread command. This is a callback function that
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.71
diff -u -3 -p -r1.71 target.c
--- target.c 9 Mar 2004 16:16:52 -0000 1.71
+++ target.c 22 Mar 2004 18:15:32 -0000
@@ -39,7 +39,7 @@
#include "gdb_assert.h"
#include "gdbcore.h"
-static void target_info (char *, int);
+void target_info (char *, int);
static void maybe_kill_then_create_inferior (char *, char *, char **);
@@ -111,7 +111,7 @@ static void debug_to_prepare_to_store (v
static int debug_to_xfer_memory (CORE_ADDR, char *, int, int,
struct mem_attrib *, struct target_ops *);
-static void debug_to_files_info (struct target_ops *);
+static void debug_to_files_info (struct target_ops *, struct ui_out *);
static int debug_to_insert_breakpoint (CORE_ADDR, char *);
@@ -315,7 +315,7 @@ kill_or_be_killed (int from_tty)
if (target_has_execution)
{
printf_unfiltered ("You are already running a program:\n");
- target_files_info ();
+ target_files_info (uiout);
if (query ("Kill it? "))
{
target_kill ();
@@ -500,7 +500,7 @@ update_current_target (void)
(int (*) (CORE_ADDR, char *, int, int, struct mem_attrib *, struct target_ops *))
nomemory);
de_fault (to_files_info,
- (void (*) (struct target_ops *))
+ (void (*) (struct target_ops *, struct ui_out *))
target_ignore);
de_fault (to_insert_breakpoint,
memory_insert_breakpoint);
@@ -1210,7 +1210,7 @@ get_target_memory_unsigned (struct targe
return extract_unsigned_integer (buf, len);
}
-static void
+void
target_info (char *args, int from_tty)
{
struct target_ops *t;
@@ -1234,7 +1234,7 @@ target_info (char *args, int from_tty)
if (has_all_mem)
printf_unfiltered ("\tWhile running this, GDB does not access memory from...\n");
printf_unfiltered ("%s:\n", t->to_longname);
- (t->to_files_info) (t);
+ (t->to_files_info) (t, uiout);
has_all_mem = t->to_has_all_memory;
}
}
@@ -1856,9 +1856,9 @@ debug_to_xfer_memory (CORE_ADDR memaddr,
}
static void
-debug_to_files_info (struct target_ops *target)
+debug_to_files_info (struct target_ops *target, struct ui_out *uiout)
{
- debug_target.to_files_info (target);
+ debug_target.to_files_info (target, uiout);
fprintf_unfiltered (gdb_stdlog, "target_files_info (xxx)\n");
}
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.57
diff -u -3 -p -r1.57 target.h
--- target.h 4 Feb 2004 21:49:55 -0000 1.57
+++ target.h 22 Mar 2004 18:15:32 -0000
@@ -332,7 +332,7 @@ struct target_ops
struct mem_attrib *attrib,
struct target_ops *target);
- void (*to_files_info) (struct target_ops *);
+ void (*to_files_info) (struct target_ops *, struct ui_out *uiout);
int (*to_insert_breakpoint) (CORE_ADDR, char *);
int (*to_remove_breakpoint) (CORE_ADDR, char *);
int (*to_can_use_hw_breakpoint) (int, int, int);
@@ -616,12 +616,12 @@ extern int inferior_has_execd (int pid,
/* From exec.c */
-extern void print_section_info (struct target_ops *, bfd *);
+extern void print_section_info (struct target_ops *, bfd *, struct ui_out *);
/* Print a line about the current target. */
-#define target_files_info() \
- (*current_target.to_files_info) (¤t_target)
+#define target_files_info(uiout) \
+ (*current_target.to_files_info) (¤t_target, uiout)
/* Insert a breakpoint at address ADDR in the target machine. SAVE is
a pointer to memory allocated for saving the target contents. It
Index: v850ice.c
===================================================================
RCS file: /cvs/src/src/gdb/v850ice.c,v
retrieving revision 1.18
diff -u -3 -p -r1.18 v850ice.c
--- v850ice.c 2 Oct 2003 20:28:30 -0000 1.18
+++ v850ice.c 22 Mar 2004 18:15:32 -0000
@@ -57,7 +57,7 @@ static int init_hidden_window (void);
static LRESULT CALLBACK v850ice_wndproc (HWND, UINT, WPARAM, LPARAM);
-static void v850ice_files_info (struct target_ops *ignore);
+static void v850ice_files_info (struct target_ops *ignore, struct ui_out *uiout);
static int v850ice_xfer_memory (CORE_ADDR memaddr, char *myaddr,
int len, int should_write,
@@ -698,7 +698,7 @@ v850ice_xfer_memory (CORE_ADDR memaddr,
}
static void
-v850ice_files_info (struct target_ops *ignore)
+v850ice_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
puts_filtered ("Debugging a target via the NEC V850 ICE.\n");
}
Index: win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.87
diff -u -3 -p -r1.87 win32-nat.c
--- win32-nat.c 5 Jan 2004 19:53:08 -0000 1.87
+++ win32-nat.c 22 Mar 2004 18:15:32 -0000
@@ -1662,7 +1662,7 @@ child_detach (char *args, int from_tty)
/* Print status information about what we're accessing. */
static void
-child_files_info (struct target_ops *ignore)
+child_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
printf_unfiltered ("\tUsing the running image of %s %s.\n",
attach_flag ? "attached" : "child", target_pid_to_str (inferior_ptid));
Index: wince.c
===================================================================
RCS file: /cvs/src/src/gdb/wince.c,v
retrieving revision 1.26
diff -u -3 -p -r1.26 wince.c
--- wince.c 6 Nov 2003 02:52:28 -0000 1.26
+++ wince.c 22 Mar 2004 18:15:32 -0000
@@ -1521,7 +1521,7 @@ child_wait (ptid_t ptid, struct target_w
/* Print status information about what we're accessing. */
static void
-child_files_info (struct target_ops *ignore)
+child_files_info (struct target_ops *ignore, struct ui_out *uiout)
{
printf_unfiltered ("\tUsing the running image of child %s.\n",
target_pid_to_str (inferior_ptid));
Index: mi/mi-cmd-file.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-file.c,v
retrieving revision 1.1
diff -u -3 -p -r1.1 mi-cmd-file.c
--- mi/mi-cmd-file.c 2 Apr 2003 22:10:35 -0000 1.1
+++ mi/mi-cmd-file.c 22 Mar 2004 18:15:33 -0000
@@ -65,3 +65,11 @@ mi_cmd_file_list_exec_source_file(char *
return MI_CMD_DONE;
}
+
+extern void target_info (char *, int);
+
+enum mi_cmd_result
+mi_cmd_file_list_exec_sections(char *command, char **argv, int argc)
+{
+ target_info(NULL, 1);
+}
Index: mi/mi-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmds.c,v
retrieving revision 1.14
diff -u -3 -p -r1.14 mi-cmds.c
--- mi/mi-cmds.c 4 Aug 2003 23:18:50 -0000 1.14
+++ mi/mi-cmds.c 22 Mar 2004 18:15:33 -0000
@@ -79,7 +79,7 @@ struct mi_cmd mi_cmds[] =
{ "file-clear", { NULL, 0 }, NULL, NULL },
{ "file-exec-and-symbols", { "file", 1 }, NULL, NULL },
{ "file-exec-file", { "exec-file", 1 }, NULL, NULL },
- { "file-list-exec-sections", { NULL, 0 }, NULL, NULL },
+ { "file-list-exec-sections", { NULL, 0 }, 0, mi_cmd_file_list_exec_sections },
{ "file-list-exec-source-file", { NULL, 0 }, 0, mi_cmd_file_list_exec_source_file},
{ "file-list-exec-source-files", { NULL, 0 }, NULL, NULL },
{ "file-list-shared-libraries", { NULL, 0 }, NULL, NULL },
Index: mi/mi-cmds.h
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmds.h,v
retrieving revision 1.12
diff -u -3 -p -r1.12 mi-cmds.h
--- mi/mi-cmds.h 24 Jan 2004 04:21:43 -0000 1.12
+++ mi/mi-cmds.h 22 Mar 2004 18:15:33 -0000
@@ -86,6 +86,7 @@ extern mi_cmd_args_ftype mi_cmd_exec_ste
extern mi_cmd_args_ftype mi_cmd_exec_step_instruction;
extern mi_cmd_args_ftype mi_cmd_exec_until;
extern mi_cmd_args_ftype mi_cmd_exec_interrupt;
+extern mi_cmd_argv_ftype mi_cmd_file_list_exec_sections;
extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file;
extern mi_cmd_argv_ftype mi_cmd_gdb_exit;
extern mi_cmd_argv_ftype mi_cmd_interpreter_exec;