public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
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
Date: Wed, 28 Nov 2012 17:17:00 -0000	[thread overview]
Message-ID: <20121128171750.22062.qmail@sourceware.org> (raw)

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.


                 reply	other threads:[~2012-11-28 17:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121128171750.22062.qmail@sourceware.org \
    --to=pmuldoon@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).