From ae778caf097e08497f2e9218cf68b254b8da38f1 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 15 Sep 2018 01:09:22 -0600 Subject: Allow setting a parameter to raise gdb.GdbError A convention in the Python layer is that raising a gdb.GdbError will not print the Python stack -- instead the exception is treated as any other gdb exception. PR python/18852 asks that this treatment be extended the the get_set_value method of gdb.Parameter. This makes sense, because it lets Python-created parameters act like gdb parameters. 2018-09-23 Tom Tromey PR python/18852: * python/py-param.c (get_set_value): Use gdbpy_handle_exception. gdb/doc/ChangeLog 2018-09-23 Tom Tromey PR python/18852: * python.texi (Parameters In Python): Document exception behavior of get_set_string. gdb/testsuite/ChangeLog 2018-09-23 Tom Tromey PR python/18852: * gdb.python/py-parameter.exp: Add test for parameter that throws on "set". --- gdb/python/py-param.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gdb/python/py-param.c') diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c index 0f0214b..bff5d60 100644 --- a/gdb/python/py-param.c +++ b/gdb/python/py-param.c @@ -396,10 +396,7 @@ get_set_value (const char *args, int from_tty, { set_doc_string = call_doc_function (obj, set_doc_func.get (), NULL); if (! set_doc_string) - { - gdbpy_print_stack (); - return; - } + gdbpy_handle_exception (); } const char *str = set_doc_string.get (); -- cgit v1.1