From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7862) id A21A33858290; Tue, 11 Oct 2022 09:41:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A21A33858290 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665481284; bh=8Vn7SVJXdINXxUVlFxS0+uBAlwWMa8NrZbjQkRhsTlY=; h=From:To:Subject:Date:From; b=ItOhzvCnGuiaNpbnuN+6KBbJmhuQ6fuTdMrvQl9x1rn8uHyoSwtvVuwn2SRH7opW7 fjqOsi7K8csI2WpdHacReu9WkYLnzeqcHzjLS4ef23EnYyFQ5EIdMWK90j76L8yqft eUMCyF0pdn6hwTE7ySbJXN26zKMmgwkgPHI7r1wE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Bruno Larsen To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: Fix formatting of python script X-Act-Checkin: binutils-gdb X-Git-Author: Bruno Larsen X-Git-Refname: refs/heads/master X-Git-Oldrev: 86b4a00fa329a4df7ec2cb404c2b52152560aa0f X-Git-Newrev: 73fa80feee65dde8cbbdacca1b76b4f3f6af62cb Message-Id: <20221011094124.A21A33858290@sourceware.org> Date: Tue, 11 Oct 2022 09:41:24 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D73fa80feee65= dde8cbbdacca1b76b4f3f6af62cb commit 73fa80feee65dde8cbbdacca1b76b4f3f6af62cb Author: Bruno Larsen Date: Tue Oct 11 11:22:37 2022 +0200 gdb/testsuite: Fix formatting of python script =20 The python black formatter was complaining about formatting on the script gdb.python/pretty-print-call-by-hand.py. This commit changed the offending lines to make the formatter happy. Diff: --- 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/te= stsuite/gdb.python/pretty-print-call-by-hand.py index f8f5df678f8..5343af831a7 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 =3D val =20 def to_string(self): - calls =3D gdb.parse_and_eval('f()') - return "mytype is %s" % self.val['x'] + calls =3D gdb.parse_and_eval("f()") + return "mytype is %s" % self.val["x"] + =20 def ec_lookup_function(val): typ =3D val.type if typ.code =3D=3D gdb.TYPE_CODE_REF: typ =3D typ.target() - if str(typ) =3D=3D 'struct mytype': + if str(typ) =3D=3D "struct mytype": return MytypePrinter(val) return None =20 + def disable_lookup_function(): ec_lookup_function.enabled =3D False =20 + def enable_lookup_function(): ec_lookup_function.enabled =3D True =20 + gdb.pretty_printers.append(ec_lookup_function)