aboutsummaryrefslogtreecommitdiff
path: root/gdb/NEWS
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2016-03-10 17:12:30 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2016-03-10 17:12:30 -0500
commitf2f3ccb9f81255fd1b4f877600f39979c2d7ece5 (patch)
treeb716861822a8b7ecd3d643061903298d57b969b8 /gdb/NEWS
parenta9f02af88d230aabf6771f94a6c401727a865188 (diff)
downloadbinutils-f2f3ccb9f81255fd1b4f877600f39979c2d7ece5.zip
binutils-f2f3ccb9f81255fd1b4f877600f39979c2d7ece5.tar.gz
binutils-f2f3ccb9f81255fd1b4f877600f39979c2d7ece5.tar.bz2
Add $_as_string convenience function
This patch is a follow-up to "Add printf format specifier for printing enumerator": https://sourceware.org/ml/gdb-patches/2016-02/msg00144.html Instead of having a solution specific to the printf command, Pedro suggested adding a general purpose function $_as_string() that would cover this use case and more. So, in order to print the textual label of an enum, one can use: (gdb) printf "Visiting node of type %s\n", $_as_string(node) Visiting node of type NODE_INTEGER gdb/ChangeLog: * data-directory/Makefile.in (PYTHON_FILE_LIST): Install gdb/function/as_string.py. * python/lib/gdb/function/as_string.py: New file. * NEWS: Mention the new $_as_string function. gdb/testsuite/ChangeLog: * gdb.python/py-as-string.exp: New file. * gdb.python/py-as-string.c: New file. gdb/doc/ChangeLog: * gdb.texinfo (Convenience Functions): Document $_as_string.
Diffstat (limited to 'gdb/NEWS')
-rw-r--r--gdb/NEWS4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/NEWS b/gdb/NEWS
index be15902..55b56b0 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,10 @@
*** Changes since GDB 7.11
+* New Python-based convenience function $_as_string(val), which returns
+ the textual representation of a value. This function is especially
+ useful to obtain the text label of an enum value.
+
* Intel MPX bound violation handling.
Segmentation faults caused by a Intel MPX boundary violation