Discussion:
[Bug python/14062] New: Exceptions in callbacks posted by gdb.post_event are silently ignored.
gareth at blacksphere dot co.nz
2012-05-05 01:03:29 UTC
Permalink
http://sourceware.org/bugzilla/show_bug.cgi?id=14062

Bug #: 14062
Summary: Exceptions in callbacks posted by gdb.post_event are
silently ignored.
Product: gdb
Version: 7.4
Status: NEW
Severity: normal
Priority: P2
Component: python
AssignedTo: ***@sourceware.org
ReportedBy: ***@blacksphere.co.nz
Classification: Unclassified


This is the simplest example to reproduce this problem:

(gdb) python invalid()
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'invalid' is not defined
Error while executing Python code.
(gdb) python gdb.post_event(lambda : invalid())
(gdb)

Note that the exception in the lambda function is never reported.

This is observed on GDB 7.4.1 (target arm-none-eabi) with Python 2.6.6 and
Linux 2.6.35-32 (Ubuntu 10.10).
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
tromey at sourceware dot org
2016-03-30 18:12:39 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=14062

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
This came up again here:
http://stackoverflow.com/questions/36145239/gdb-python-api-exceptions-disappearing
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-15 00:37:25 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=14062

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
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:06 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=14062

--- Comment #2 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=39a24317ac65837663ce1e1b0adcf880758ddc8e

commit 39a24317ac65837663ce1e1b0adcf880758ddc8e
Author: Tom Tromey <***@tromey.com>
Date: Sat Sep 15 00:07:32 2018 -0600

Report Python errors coming from gdb.post_event

PR python/14062 points out that errors coming from the gdb.post_event
callback are not reported. This can make it hard to understand why
your Python code in gdb isn't working.

Because users have control over whether exceptions are printed at all,
it seems good to simply have post_event report errors in the usual
way.

2018-09-23 Tom Tromey <***@tromey.com>

PR python/14062:
* python/python.c (gdbpy_run_events): Do not ignore exceptions.

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

PR python/14062:
* gdb.python/python.exp: Add test for post_event error.
--
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:21 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=14062

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #3 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...