From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27274 invoked by alias); 7 Jun 2010 11:56:52 -0000 Received: (qmail 27255 invoked by uid 22791); 7 Jun 2010 11:56:51 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Jun 2010 11:56:46 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o57BujWr018506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 Jun 2010 07:56:45 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o57Bug9Y012275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Jun 2010 07:56:44 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o57BugG0004807; Mon, 7 Jun 2010 13:56:42 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o57BugW4004806; Mon, 7 Jun 2010 13:56:42 +0200 Date: Mon, 07 Jun 2010 11:56:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: [patch 1/2] DW_OP_call: Provide per_cu in the batons Message-ID: <20100607115641.GB24148@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091012210844.GA20340@caradoc.them.org> User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-06/txt/msg00170.txt.bz2 Hi, provide per_cu in the batons as required by the patch 2/2. Thanks, Jan gdb/ 2010-06-07 Jan Kratochvil * dwarf2loc.c (struct dwarf_expr_baton) Replace objfile by per_cu. (dwarf_expr_tls_address): Use per_cu instead of objfile. (dwarf2_evaluate_loc_desc): Drop initialization of BATON.OBJFILE. Initialize new BATON.PER_CU. Adjust CTX->GDBARCH initialization for this change. (struct needs_frame_baton): New field per_cu. (dwarf2_loc_desc_needs_frame): Initialize new BATON.PER_CU. * dwarf2read.c (struct dwarf2_per_cu_data) : Extend the comment. --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -122,7 +122,7 @@ find_location_expression (struct dwarf2_loclist_baton *baton, struct dwarf_expr_baton { struct frame_info *frame; - struct objfile *objfile; + struct dwarf2_per_cu_data *per_cu; }; /* Helper functions for dwarf2_evaluate_loc_desc. */ @@ -227,8 +227,9 @@ static CORE_ADDR dwarf_expr_tls_address (void *baton, CORE_ADDR offset) { struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton; + struct objfile *objfile = dwarf2_per_cu_objfile (debaton->per_cu); - return target_translate_tls_address (debaton->objfile, offset); + return target_translate_tls_address (objfile, offset); } struct piece_closure @@ -801,12 +802,12 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame, } baton.frame = frame; - baton.objfile = dwarf2_per_cu_objfile (per_cu); + baton.per_cu = per_cu; ctx = new_dwarf_expr_context (); old_chain = make_cleanup_free_dwarf_expr_context (ctx); - ctx->gdbarch = get_objfile_arch (baton.objfile); + ctx->gdbarch = get_objfile_arch (dwarf2_per_cu_objfile (per_cu)); ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); ctx->baton = &baton; ctx->read_reg = dwarf_expr_read_reg; @@ -907,6 +908,7 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame, struct needs_frame_baton { int needs_frame; + struct dwarf2_per_cu_data *per_cu; }; /* Reads from registers do require a frame. */ @@ -973,6 +975,7 @@ dwarf2_loc_desc_needs_frame (const gdb_byte *data, unsigned short size, struct cleanup *old_chain; baton.needs_frame = 0; + baton.per_cu = per_cu; ctx = new_dwarf_expr_context (); old_chain = make_cleanup_free_dwarf_expr_context (ctx); --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -337,7 +337,8 @@ struct dwarf2_per_cu_data Otherwise it's from .debug_info. */ unsigned int from_debug_types : 1; - /* Set iff currently read in. */ + /* Set no non-NULL iff this CU is currently loaded. When it gets freed out + of the CU cache it gets reset to NULL again. */ struct dwarf2_cu *cu; /* If full symbols for this CU have been read in, then this field