From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [pushed] gdb/testsuite: reformat gdb.python/pretty-print-call-by-hand.py
Date: Mon, 21 Mar 2022 09:59:52 -0400 [thread overview]
Message-ID: <20220321135952.197492-1-simon.marchi@efficios.com> (raw)
Run black on the file.
Change-Id: Ifb576137fb7158a0227173f61c1202f0695b3685
---
gdb/testsuite/gdb.python/pretty-print-call-by-hand.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py b/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py
index f8f5df678f8f..5343af831a78 100644
--- a/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py
+++ b/gdb/testsuite/gdb.python/pretty-print-call-by-hand.py
@@ -21,21 +21,25 @@ class MytypePrinter:
self.val = val
def to_string(self):
- calls = gdb.parse_and_eval('f()')
- return "mytype is %s" % self.val['x']
+ calls = gdb.parse_and_eval("f()")
+ return "mytype is %s" % self.val["x"]
+
def ec_lookup_function(val):
typ = val.type
if typ.code == gdb.TYPE_CODE_REF:
typ = typ.target()
- if str(typ) == 'struct mytype':
+ if str(typ) == "struct mytype":
return MytypePrinter(val)
return None
+
def disable_lookup_function():
ec_lookup_function.enabled = False
+
def enable_lookup_function():
ec_lookup_function.enabled = True
+
gdb.pretty_printers.append(ec_lookup_function)
--
2.26.2
reply other threads:[~2022-03-21 14:00 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=20220321135952.197492-1-simon.marchi@efficios.com \
--to=simon.marchi@efficios.com \
--cc=gdb-patches@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).