aboutsummaryrefslogtreecommitdiff
path: root/include/gdb
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-06-15 19:17:16 +0545
committerMike Frysinger <vapier@gentoo.org>2015-06-17 13:19:51 -0400
commit6362a3f8757bfce133b724df2077573433823ad4 (patch)
tree681f10063e77d5ed43b862eb7be12d4c860e790e /include/gdb
parent920467912a594a3e5af1d779487ffe3e5c550aef (diff)
downloadgdb-6362a3f8757bfce133b724df2077573433823ad4.zip
gdb-6362a3f8757bfce133b724df2077573433823ad4.tar.gz
gdb-6362a3f8757bfce133b724df2077573433823ad4.tar.bz2
sim: callback: add human readable strings for debugging to maps
When tracing, we often want to display the human readable name for the various syscall/errno values. Rather than make each target duplicate the lookup, extend the existing maps to include the string directly, and add helper functions to look up the constants. While most targets are autogenerated (from libgloss), the bfin/cris targets have custom maps for the Linux ABI which need to be updated by hand.
Diffstat (limited to 'include/gdb')
-rw-r--r--include/gdb/ChangeLog7
-rw-r--r--include/gdb/callback.h9
2 files changed, 16 insertions, 0 deletions
diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog
index d36d6b8..24fe00f 100644
--- a/include/gdb/ChangeLog
+++ b/include/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2015-06-17 Mike Frysinger <vapier@gentoo.org>
+
+ * callback.h (CB_TARGET_DEFS_MAP): Add name member.
+ (cb_host_str_syscall, cb_host_str_errno, cb_host_str_signal,
+ cb_target_str_syscall, cb_target_str_errno, cb_target_str_signal):
+ Declare.
+
2015-03-28 James Bowman <james.bowman@ftdichip.com>
* sim-ft32.h: New file.
diff --git a/include/gdb/callback.h b/include/gdb/callback.h
index 4628b7e..80299f1 100644
--- a/include/gdb/callback.h
+++ b/include/gdb/callback.h
@@ -59,6 +59,7 @@
name of the symbol. */
typedef struct {
+ const char *name;
int host_val;
int target_val;
} CB_TARGET_DEFS_MAP;
@@ -316,6 +317,14 @@ int cb_target_to_host_signal (host_callback *, int);
/* Translate host signal number to target. */
int cb_host_to_gdb_signal (host_callback *, int);
+/* Translate symbols into human readable strings. */
+const char *cb_host_str_syscall (host_callback *, int);
+const char *cb_host_str_errno (host_callback *, int);
+const char *cb_host_str_signal (host_callback *, int);
+const char *cb_target_str_syscall (host_callback *, int);
+const char *cb_target_str_errno (host_callback *, int);
+const char *cb_target_str_signal (host_callback *, int);
+
/* Translate host stat struct to target.
If stat struct ptr is NULL, just compute target stat struct size.
Result is size of target stat struct or 0 if error. */