From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 787 invoked by alias); 24 Dec 2012 14:15:48 -0000 Received: (qmail 776 invoked by uid 22791); 24 Dec 2012 14:15:46 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-la0-f52.google.com (HELO mail-la0-f52.google.com) (209.85.215.52) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Dec 2012 14:15:43 +0000 Received: by mail-la0-f52.google.com with SMTP id l5so8515502lah.39 for ; Mon, 24 Dec 2012 06:15:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.102.5 with SMTP id fk5mr8814049lbb.31.1356358541470; Mon, 24 Dec 2012 06:15:41 -0800 (PST) Received: by 10.112.162.34 with HTTP; Mon, 24 Dec 2012 06:15:41 -0800 (PST) Date: Mon, 24 Dec 2012 14:15:00 -0000 Message-ID: Subject: can pahole print a struct definition in a given CU? From: Tristan Su To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00078.txt.bz2 Hi, I found pahole (python api) quite useful but jusst could not have it print a struct in a given compilation unit. With the ptype command: (gdb) ptype S but we can also specify the CU because the struct may have different define in different CUs. (gdb) ptype 'foo.c'::S but pahale doesn't seem to support this: (gdb) pahole 'foo.c'::S Traceback (most recent call last): File "/usr/share/gdb/python/gdb/command/pahole.py", line 68, in invoke type = gdb.lookup_type (arg) RuntimeError: No type named 'foo.c'::S. Error occurred in Python command: No type named 'foo.c'::S. Is that possible/easy to make pahole support this? I'm using gdb 7.2 on x86-64. Thanks, Tristan