public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-tromey-python: make pahole print a hole after the last field Date: Wed, 19 Dec 2012 20:50:00 -0000 [thread overview] Message-ID: <20121219205037.32081.qmail@sourceware.org> (raw) The branch, archer-tromey-python has been updated via 3e4a982a09b88f3f416b86abdffa1a7fca7050c4 (commit) from da55ddadfd53c0c125444ddc697977adfef7a464 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 3e4a982a09b88f3f416b86abdffa1a7fca7050c4 Author: Tom Tromey <tromey@redhat.com> Date: Wed Dec 19 13:49:44 2012 -0700 make pahole print a hole after the last field This changes the pahole command to notice holes between the last field and the end of the object. ----------------------------------------------------------------------- Summary of changes: gdb/python/lib/gdb/command/pahole.py | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) First 500 lines of diff: diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py index 21a0bf0..636f99d 100644 --- a/gdb/python/lib/gdb/command/pahole.py +++ b/gdb/python/lib/gdb/command/pahole.py @@ -1,6 +1,6 @@ # pahole command for gdb -# Copyright (C) 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,6 +26,11 @@ It prints the type and displays comments showing where holes are.""" super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE, gdb.COMPLETE_SYMBOL) + def maybe_print_hole(self, bitpos, field_bitpos): + if bitpos != field_bitpos: + hole = field_bitpos - bitpos + print ' /* XXX %d bit hole, try to pack */' % hole + def pahole (self, type, level, name): if name is None: name = '' @@ -41,10 +46,8 @@ It prints the type and displays comments showing where holes are.""" ftype = field.type.strip_typedefs() - if bitpos != field.bitpos: - hole = field.bitpos - bitpos - print ' /* XXX %d bit hole, try to pack */' % hole - bitpos = field.bitpos + self.maybe_print_hole(bitpos, field.bitpos) + bitpos = field.bitpos if field.bitsize > 0: fieldsize = field.bitsize else: @@ -61,6 +64,9 @@ It prints the type and displays comments showing where holes are.""" print ' ' * (2 + 2 * level), print '%s %s' % (str (ftype), field.name) + if level == 0: + self.maybe_print_hole(bitpos, 8 * type.sizeof) + print ' ' * (14 + 2 * level), print '} %s' % name hooks/post-receive -- Repository for Project Archer.
reply other threads:[~2012-12-19 20:50 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=20121219205037.32081.qmail@sourceware.org \ --to=tromey@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: linkBe 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).