From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4171 invoked by alias); 19 Jun 2007 20:41:46 -0000 Received: (qmail 4162 invoked by uid 22791); 19 Jun 2007 20:41:46 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS,TW_TM X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 19 Jun 2007 20:41:42 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l5JKfdVH001256 for ; Tue, 19 Jun 2007 16:41:39 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l5JKfclZ015926 for ; Tue, 19 Jun 2007 16:41:38 -0400 Received: from [172.16.14.55] (toner.toronto.redhat.com [172.16.14.55]) by pobox.toronto.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id l5JKfbl9006524; Tue, 19 Jun 2007 16:41:37 -0400 Message-ID: <46783F81.3090906@redhat.com> Date: Tue, 19 Jun 2007 21:11:00 -0000 From: Sami Wagiaalla User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: Sami Wagiaalla CC: frysk Subject: Re: Dwarf expertise needed References: <4677F3AA.2070904@redhat.com> <4677F4BF.4050107@redhat.com> <4677FA4B.8000600@redhat.com> In-Reply-To: <4677FA4B.8000600@redhat.com> Content-Type: multipart/mixed; boundary="------------050802020601080807080701" X-Virus-Checked: Checked by ClamAV on sourceware.org X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q2/txt/msg00339.txt.bz2 This is a multi-part message in MIME format. --------------050802020601080807080701 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1017 This is a run of the above test-case with more details: There are two issues: get_addrdie() does not return the correct die: calling get_addrdie() with address 0x8048369 returned die: DW_TAG_compile_unit name: /to/scratch/swagiaal/frysks/frysk.patches/frysk-core/frysk/pkglibdir/funit-scopes.c But it can be seen from the attached relevenat debug info that the address actually falls within the expanded instance of the inlined function. The other issue is that in the test case where it works the complete hierarchy of scopes is not returned. Is there a bug or what is the correct way of getting the hierarchy of scopes that a die belongs to ? Frysk uses dwarf_getscopes() >> >> ------------------------------------------------------------------------ >> >> #include >> >> void crash(int param1){ >> int* a = 0; >> a[0] = param1; >> } >> >> inline void second(int w){ >> crash(0); >> } >> >> void first(){ >> second(0); >> } >> >> int main(){ >> >> first(0); >> >> return 0; >> } --------------050802020601080807080701 Content-Type: text/plain; name="debug_info" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="debug_info" Content-length: 1406 The section .debug_info contains: Compilation Unit @ offset 0x0: Length: 227 Version: 2 Abbrev Offset: 0 Pointer Size: 4 <0>: Abbrev Number: 1 (DW_TAG_compile_unit) DW_AT_stmt_list : 0 DW_AT_high_pc : 0x80483aa DW_AT_low_pc : 0x8048344 DW_AT_producer : (indirect string, offset: 0xbc): GNU C 4.1.1 20070105 (Red Hat 4.1.1-51) DW_AT_language : 1 (ANSI C) DW_AT_name : (indirect string, offset: 0x62): /to/scratch/swagiaal/frysks/frysk.patches/frysk-core/frysk/pkglibdir/funit-scopes.c [...] <1><9d>: Abbrev Number: 7 (DW_TAG_subprogram) DW_AT_external : 1 DW_AT_name : (indirect string, offset: 0x5b): second DW_AT_decl_file : 1 DW_AT_decl_line : 8 DW_AT_inline : 3 (declared as inline and inlined) <1>: Abbrev Number: 4 (DW_TAG_subprogram) DW_AT_sibling : DW_AT_external : 1 DW_AT_name : (indirect string, offset: 0xb6): first DW_AT_decl_file : 1 DW_AT_decl_line : 12 DW_AT_low_pc : 0x8048353 DW_AT_high_pc : 0x8048370 DW_AT_frame_base : 0x2c (location list) <2>: Abbrev Number: 8 (DW_TAG_inlined_subroutine) DW_AT_abstract_origin: <9d> DW_AT_low_pc : 0x8048365 DW_AT_high_pc : 0x804836a DW_AT_call_file : 1 DW_AT_call_line : 13 --------------050802020601080807080701--