From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22111 invoked by alias); 28 Nov 2012 17:17:53 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 22081 invoked by uid 9514); 28 Nov 2012 17:17:51 -0000 Date: Wed, 28 Nov 2012 17:17:00 -0000 Message-ID: <20121128171750.22062.qmail@sourceware.org> From: pmuldoon@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-pmuldoon-python-backtrace: Use gdb.GdbError. Print it, instead of raising to default printer X-Git-Refname: refs/heads/archer-pmuldoon-python-backtrace X-Git-Reftype: branch X-Git-Oldrev: e934dfbae52cf15314f8a64d9f2e0ae32861a52c X-Git-Newrev: 4ce407121da47b9df7b153dab59452cb7aac0bb7 X-SW-Source: 2012-q4/txt/msg00015.txt.bz2 List-Id: 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 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.