public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-pmuldoon-python-backtrace: Use gdb.GdbError. Print it, instead of raising to default printer
@ 2012-11-28 17:17 pmuldoon
0 siblings, 0 replies; only message in thread
From: pmuldoon @ 2012-11-28 17:17 UTC (permalink / raw)
To: archer-commits
The branch, archer-pmuldoon-python-backtrace has been updated
via 4ce407121da47b9df7b153dab59452cb7aac0bb7 (commit)
from e934dfbae52cf15314f8a64d9f2e0ae32861a52c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 4ce407121da47b9df7b153dab59452cb7aac0bb7
Author: Phil Muldoon <pmuldoon@redhat.com>
Date: Wed Nov 28 17:17:09 2012 +0000
Use gdb.GdbError. Print it, instead of raising to default printer
-----------------------------------------------------------------------
Summary of changes:
gdb/python/lib/gdb/command/frame_filters.py | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
First 500 lines of diff:
diff --git a/gdb/python/lib/gdb/command/frame_filters.py b/gdb/python/lib/gdb/command/frame_filters.py
index 6b842cb..85db8bc 100644
--- a/gdb/python/lib/gdb/command/frame_filters.py
+++ b/gdb/python/lib/gdb/command/frame_filters.py
@@ -35,7 +35,7 @@ def _parse_arg (cmd_name, arg):
argv = gdb.string_to_argv(arg);
argc = len(argv)
if argc != 2:
- raise SyntaxError(cmd_name + " takes exactly " + \
+ raise gdb.GdbError(cmd_name + " takes exactly " + \
"two arguments.")
object_list = argv[0]
@@ -374,7 +374,7 @@ class SetFrameFilterPriority (gdb.Command):
argv = gdb.string_to_argv(arg);
argc = len(argv)
if argc != 3:
- raise SyntaxError("set python frame-filter priority " \
+ raise gdb.GdbError("set python frame-filter priority " \
"takes exactly three arguments.")
object_list = argv[0]
@@ -413,7 +413,11 @@ class SetFrameFilterPriority (gdb.Command):
def invoke(self, arg, from_tty):
"""GDB calls this to perform the command."""
command_tuple = self._parse_pri_arg(arg)
- self._set_filter_priority (command_tuple)
+ try:
+ self._set_filter_priority (command_tuple)
+ except e:
+ # Print the error, instead of raising it.
+ gdb.write(e.message+"\n")
class ShowFrameFilterPriority (gdb.Command):
"""GDB command to show the priority of the specified frame-filter.
@@ -438,7 +442,7 @@ class ShowFrameFilterPriority (gdb.Command):
argv = gdb.string_to_argv(arg);
argc = len(argv)
if argc != 2:
- raise SyntaxError("show python frame-filter priority " \
+ raise gdb.GdbError("show python frame-filter priority " \
"takes exactly two arguments.")
object_list = argv[0]
@@ -465,7 +469,12 @@ class ShowFrameFilterPriority (gdb.Command):
def invoke(self, arg, from_tty):
"""GDB calls this to perform the command."""
- command_tuple = self._parse_pri_arg(arg)
+ try:
+ command_tuple = self._parse_pri_arg(arg)
+ except gdb.GdbError as e:
+ # Print the error instead of raising it.
+ gdb.write(e.message+"\n")
+ return
filter_name = command_tuple[1]
list_name = command_tuple[0]
try:
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-28 17:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-28 17:17 [SCM] archer-pmuldoon-python-backtrace: Use gdb.GdbError. Print it, instead of raising to default printer pmuldoon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).