From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10178 invoked by alias); 1 Dec 2012 16:34:23 -0000 Received: (qmail 9966 invoked by uid 22791); 1 Dec 2012 16:34:20 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-bk0-f41.google.com (HELO mail-bk0-f41.google.com) (209.85.214.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 Dec 2012 16:34:15 +0000 Received: by mail-bk0-f41.google.com with SMTP id jg9so614421bkc.0 for ; Sat, 01 Dec 2012 08:34:13 -0800 (PST) Received: by 10.204.5.141 with SMTP id 13mr1416060bkv.35.1354379653418; Sat, 01 Dec 2012 08:34:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.205.32.12 with HTTP; Sat, 1 Dec 2012 08:33:33 -0800 (PST) In-Reply-To: <87k3t45ihq.fsf@fleche.redhat.com> References: <50AC322D.2030209@mentor.com> <87k3t45ihq.fsf@fleche.redhat.com> From: Hui Zhu Date: Sat, 01 Dec 2012 16:34:00 -0000 Message-ID: Subject: Re: [PATCH] Add CTF support to GDB [2/4] Fix a bug of function dwarf_expr_frame_base To: Tom Tromey Cc: Hui Zhu , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 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: 2012-12/txt/msg00001.txt.bz2 On Fri, Nov 30, 2012 at 3:14 AM, Tom Tromey wrote: >>>>>> "Hui" == Hui Zhu writes: > > Hui> 2012-11-20 Hui Zhu > Hui> * dwarf2loc.c (dwarf_expr_frame_base): Add check for the return > Hui> value of get_frame_block. > > I think this is reasonable even without the rest of your patches. OK. > > One nit: > > Hui> + if (bl == NULL) > Hui> + error (_("No symbol table info available.\n")); > > I don't think this is a very clear error message. > I'm not sure what else to suggest though. > > Also, no \n at the end of the error message. > > Tom What about I change it to "frame address is not available." because in get_frame_block: if (!get_frame_address_in_block_if_available (frame, &pc)) return NULL; Post a new version. Thanks, Hui 2012-11-01 Hui Zhu * dwarf2loc.c (dwarf_expr_frame_base): Add check for the return value of get_frame_block. --- a/dwarf2loc.c +++ b/dwarf2loc.c @@ -332,11 +332,15 @@ dwarf_expr_frame_base (void *baton, cons this_base method. */ struct symbol *framefunc; struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton; + struct block *bl = get_frame_block (debaton->frame, NULL); + + if (bl == NULL) + error (_("frame address is not available.")); /* Use block_linkage_function, which returns a real (not inlined) function, instead of get_frame_function, which may return an inlined function. */ - framefunc = block_linkage_function (get_frame_block (debaton->frame, NULL)); + framefunc = block_linkage_function (bl); /* If we found a frame-relative symbol then it was certainly within some function associated with a frame. If we can't find the frame,