aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2012-01-20 09:49:58 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2012-01-20 09:49:58 +0000
commit3030c96e669f372adf4ce989b755e18b99fe7792 (patch)
treefc843296b14684e7a3429499804d5c76357597a1 /gdb/gdbarch.c
parent145b16a97aad6c8c3f30119d7c42b48753a0b1f8 (diff)
downloadgdb-3030c96e669f372adf4ce989b755e18b99fe7792.zip
gdb-3030c96e669f372adf4ce989b755e18b99fe7792.tar.gz
gdb-3030c96e669f372adf4ce989b755e18b99fe7792.tar.bz2
* gdbarch.sh (info_proc): New callback.
* gdbarch.c, gdbarch.h: Regenerate. * infcmd.c (info_proc_cmd_1): Try gdbarch info_proc callback before falling back to the target info_proc callback. * linux-nat.c: Do not include "cli/cli-utils.h". (linux_nat_info_proc): Remove. (linux_target_install_ops): No longer install it. * linux-tdep.c: Include "cli/cli-utils.h" and <ctype.h>. (read_mapping): New function. (linux_info_proc): Likewise. (linux_init_abi): Install it.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 1ada504..2dbdda9 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -272,6 +272,7 @@ struct gdbarch
const char * solib_symbols_extension;
int has_dos_based_file_system;
gdbarch_gen_return_address_ftype *gen_return_address;
+ gdbarch_info_proc_ftype *info_proc;
};
@@ -427,6 +428,7 @@ struct gdbarch startup_gdbarch =
0, /* solib_symbols_extension */
0, /* has_dos_based_file_system */
default_gen_return_address, /* gen_return_address */
+ 0, /* info_proc */
/* startup_gdbarch() */
};
@@ -715,6 +717,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of auto_wide_charset, invalid_p == 0 */
/* Skip verify of has_dos_based_file_system, invalid_p == 0 */
/* Skip verify of gen_return_address, invalid_p == 0 */
+ /* Skip verify of info_proc, has predicate. */
buf = ui_file_xstrdup (log, &length);
make_cleanup (xfree, buf);
if (length > 0)
@@ -1003,6 +1006,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: in_solib_return_trampoline = <%s>\n",
host_address_to_string (gdbarch->in_solib_return_trampoline));
fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_info_proc_p() = %d\n",
+ gdbarch_info_proc_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: info_proc = <%s>\n",
+ host_address_to_string (gdbarch->info_proc));
+ fprintf_unfiltered (file,
"gdbarch_dump: inner_than = <%s>\n",
host_address_to_string (gdbarch->inner_than));
fprintf_unfiltered (file,
@@ -3911,6 +3920,30 @@ set_gdbarch_gen_return_address (struct gdbarch *gdbarch,
gdbarch->gen_return_address = gen_return_address;
}
+int
+gdbarch_info_proc_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->info_proc != NULL;
+}
+
+void
+gdbarch_info_proc (struct gdbarch *gdbarch, char *args, enum info_proc_what what)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->info_proc != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_info_proc called\n");
+ gdbarch->info_proc (gdbarch, args, what);
+}
+
+void
+set_gdbarch_info_proc (struct gdbarch *gdbarch,
+ gdbarch_info_proc_ftype info_proc)
+{
+ gdbarch->info_proc = info_proc;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */