From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24109 invoked by alias); 14 Aug 2013 09:46:29 -0000 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 Received: (qmail 24085 invoked by uid 89); 14 Aug 2013 09:46:28 -0000 X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=no version=3.3.2 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 14 Aug 2013 09:46:27 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1V9Xer-0007nf-2q from Yao_Qi@mentor.com ; Wed, 14 Aug 2013 02:46:25 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 14 Aug 2013 02:46:24 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Wed, 14 Aug 2013 02:46:24 -0700 Message-ID: <520B51B6.4040209@codesourcery.com> Date: Wed, 14 Aug 2013 09:46:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH] Only print entry values for arguments. References: <1375663450-5825-1-git-send-email-yao@codesourcery.com> <51FFB2A5.8040005@redhat.com> <52033CB7.3070202@codesourcery.com> <5203A9F7.5060907@redhat.com> In-Reply-To: <5203A9F7.5060907@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-SW-Source: 2013-08/txt/msg00373.txt.bz2 On 08/08/2013 10:23 PM, Pedro Alves wrote: > If we run 7.6 against that test pristine would it pass cleanly? > No. In gdb.trace/mi-trace-unavailable.exp, we'll save trace data to ctf and test "--skip-unavailable" for MI command "-data-list-register-values". These two are not supported in 7.6 tree, so we'll get three fails: FAIL: gdb.trace/mi-trace-unavailable.exp: save ctf trace file FAIL: gdb.trace/mi-trace-unavailable.exp: live: -data-list-register-values --skip-unavailable x FAIL: gdb.trace/mi-trace-unavailable.exp: tfile: -data-list-register-values --skip-unavailable x >> >I plan to >> > 1) cvs -d :ext:qiyao@sourceware.org:/cvs/src co -r gdb_7_6-branch gdb >> > 2) apply this patch without changes to gdb.trace/mi-trace-unavailable.exp >> > >> >Since it is not a bug fix, don't have to mention it in >> >http://sourceware.org/gdb/wiki/GDB_7.6_Release . > Hmm. If this is issue is present in the 7.6 branch, how is it > not a bug fix? Instead, what we should do if the bug wasn't > reported in bugzilla, is file one, so we can reference it from > the wiki. > I filed PR gdb/15837 (http://sourceware.org/bugzilla/show_bug.cgi?id=15837) and record it in wiki like this: PR gdb/15837 (GDB prints entry values for local variables) Here is the patch to 7.6 branch. -- Yao (齐尧) gdb: 2013-08-14 Yao Qi PR gdb/15837: * frame.h (read_frame_local): Declare. * mi/mi-cmd-stack.c (list_args_or_locals): Call read_frame_local. * stack.c (read_frame_local): New. --- gdb/frame.h | 2 ++ gdb/mi/mi-cmd-stack.c | 5 ++++- gdb/stack.c | 21 +++++++++++++++++++++ diff --git a/gdb/frame.h b/gdb/frame.h index 31b9cb7..f02addf 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -714,6 +714,8 @@ struct frame_arg extern void read_frame_arg (struct symbol *sym, struct frame_info *frame, struct frame_arg *argp, struct frame_arg *entryargp); +extern void read_frame_local (struct symbol *sym, struct frame_info *frame, + struct frame_arg *argp); extern void args_info (char *, int); diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 9294e46..e542fc1 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -602,7 +602,10 @@ list_args_or_locals (enum what_to_list what, enum print_values values, && TYPE_CODE (type) != TYPE_CODE_UNION) { case PRINT_ALL_VALUES: - read_frame_arg (sym2, fi, &arg, &entryarg); + if (SYMBOL_IS_ARGUMENT (sym)) + read_frame_arg (sym2, fi, &arg, &entryarg); + else + read_frame_local (sym2, fi, &arg); } break; } diff --git a/gdb/stack.c b/gdb/stack.c index d89ff89..7d97dc8 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -301,6 +301,27 @@ print_frame_arg (const struct frame_arg *arg) annotate_arg_end (); } +/* Read in inferior function local SYM at FRAME into ARGP. Caller is + responsible for xfree of ARGP->ERROR. This function never throws an + exception. */ + +void +read_frame_local (struct symbol *sym, struct frame_info *frame, + struct frame_arg *argp) +{ + volatile struct gdb_exception except; + struct value *val = NULL; + + TRY_CATCH (except, RETURN_MASK_ERROR) + { + val = read_var_value (sym, frame); + } + + argp->error = (val == NULL) ? xstrdup (except.message) : NULL; + argp->sym = sym; + argp->val = val; +} + /* Read in inferior function parameter SYM at FRAME into ARGP. Caller is responsible for xfree of ARGP->ERROR. This function never throws an exception. */