From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29759 invoked by alias); 21 Nov 2012 01:45:28 -0000 Received: (qmail 29732 invoked by uid 22791); 21 Nov 2012 01:45:27 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Nov 2012 01:45:22 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TazNR-0005Y6-GB from Hui_Zhu@mentor.com for gdb-patches@sourceware.org; Tue, 20 Nov 2012 17:45:21 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 20 Nov 2012 17:45:21 -0800 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Tue, 20 Nov 2012 17:45:19 -0800 Message-ID: <50AC322D.2030209@mentor.com> Date: Wed, 21 Nov 2012 01:45:00 -0000 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Subject: [PATCH] Add CTF support to GDB [2/4] Fix a bug of function dwarf_expr_frame_base Content-Type: multipart/mixed; boundary="------------080302090808080908050004" 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-11/txt/msg00553.txt.bz2 --------------080302090808080908050004 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 459 After I add prev patch to GDB, the GDB got crash when a trace frame didn't include all the variables that it should include. I think this issue should be handle because the trace frame didn't include all the variables will be always happen (What I use is GDB and gdbserver). So I post this patch to handle it. Thanks, Hui 2012-11-20 Hui Zhu * dwarf2loc.c (dwarf_expr_frame_base): Add check for the return value of get_frame_block. --------------080302090808080908050004 Content-Type: text/plain; charset="us-ascii"; name="check-get_frame_block-return.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="check-get_frame_block-return.txt" Content-length: 801 --- 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 (_("No symbol table info available.\n")); /* 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, --------------080302090808080908050004--