Discussion:
[Bug python/18852] New: Raising gdb.GdbError in parameter "set" handlers shouldn't print as a python exception
dje at google dot com
2015-08-18 22:09:44 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18852

Bug ID: 18852
Summary: Raising gdb.GdbError in parameter "set" handlers
shouldn't print as a python exception
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: dje at google dot com
Target Milestone: ---

gdb.GdbError exists to flag a gdb error without mentioning python.
The canonical use is in gdb commands to flag a user-error (bad option or some
such).
It's also useful in "set" handlers of gdb.Parameter where one wants to flag the
set value as invalid.
In this case however the error is printed as a python exception, which is what
gdb.GdbError exists to avoid.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-15 07:17:50 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18852

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
Assignee|unassigned at sourceware dot org |tromey at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-09-24 05:17:22 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18852

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <***@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ae778caf097e08497f2e9218cf68b254b8da38f1

commit ae778caf097e08497f2e9218cf68b254b8da38f1
Author: Tom Tromey <***@tromey.com>
Date: Sat Sep 15 01:09:22 2018 -0600

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 <***@tromey.com>

PR python/18852:
* python/py-param.c (get_set_value): Use gdbpy_handle_exception.

gdb/doc/ChangeLog
2018-09-23 Tom Tromey <***@tromey.com>

PR python/18852:
* python.texi (Parameters In Python): Document exception behavior
of get_set_string.

gdb/testsuite/ChangeLog
2018-09-23 Tom Tromey <***@tromey.com>

PR python/18852:
* gdb.python/py-parameter.exp: Add test for parameter that throws
on "set".
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-23 23:48:52 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18852

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |8.3

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...