From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13409 invoked by alias); 5 Aug 2013 08:26:37 -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 13399 invoked by uid 89); 5 Aug 2013 08:26:37 -0000 X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 05 Aug 2013 08:26:36 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 05 Aug 2013 01:26:27 -0700 X-ExtLoop1: 1 Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by azsmga001.ch.intel.com with ESMTP; 05 Aug 2013 01:26:25 -0700 Received: from irsmsx152.ger.corp.intel.com (163.33.192.66) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 5 Aug 2013 09:26:23 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.64]) by IRSMSX152.ger.corp.intel.com ([169.254.6.33]) with mapi id 14.03.0123.003; Mon, 5 Aug 2013 09:26:23 +0100 From: "Agovic, Sanimir" To: 'Yao Qi' CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH] Set entryval_error to NULL if entryval is set Date: Mon, 05 Aug 2013 08:26:00 -0000 Message-ID: <0377C58828D86C4588AEEC42FC3B85A717646EE3@IRSMSX105.ger.corp.intel.com> References: <1375690566-7417-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1375690566-7417-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-08/txt/msg00130.txt.bz2 lgtm. Unfortunately I cannot approve your patch. -Sanimir > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourcewa= re.org] On Behalf > Of Yao Qi > Sent: Monday, August 05, 2013 10:16 AM > To: gdb-patches@sourceware.org > Subject: [PATCH] Set entryval_error to NULL if entryval is set >=20 > Hi, > I get an internal error when 'set print entry-values' to 'both' and > then type command 'tfind 0', shown as below, >=20 > (gdb) target remote :1234 > Remote debugging using :1234 > (gdb) b main > Breakpoint 1 at 0x80483eb: file ../../../../git/gdb/testsuite/gdb.trace/t= race- > unavailable.c, line 41. > (gdb) c > Continuing. >=20 > Breakpoint 1, > main () at ../../../../git/gdb/testsuite/gdb.trace/trace-unavailable.c:41 > 41 bar (4, s); >=20 > (gdb) trace bar > Tracepoint 3 at 0x80483ca: file ../../../../git/gdb/testsuite/gdb.trace/t= race- > unavailable.c, line 22. > (gdb) actions > Enter actions for tracepoint 3, one per line. > End with a line saying just "end". > >collect array > >collect j > >end > (gdb) tstart > (gdb) b marker > Breakpoint 4 at 0x80483e3: file ../../../../git/gdb/testsuite/gdb.trace/t= race- > unavailable.c, line 34. > (gdb) c > Continuing. > Breakpoint 4, marker () at ../../../../git/gdb/testsuite/gdb.trace/trace-= unavailable.c:34 > 34 {} > (gdb) tstop > (gdb) set print entry-values both > (gdb) tfind 0 > ../../../git/gdb/stack.c:223: internal-error: print_frame_arg: Assertion = `!arg->val || > !arg->error' failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? " >=20 > In print_frame_arg, this assert indicates that either arg->val or > arg->error should be NULL. It looks right to me. This patch is to > set 'entryval_error' NULL when 'entryval' is set (non-NULL). >=20 > The test case is modified to expose this internal error, and without > fix in read_frame_arg, we can get the internal error when running > gdb.trace/collection.exp >=20 > (gdb) PASS: gdb.trace/collection.exp: collect args collectively: tfind te= st frame > tfind -1^M > No longer looking at any trace frame^M > 79 }^M > (gdb) set print entry-values only^M > (gdb) tfind 0^M > Found trace frame 0, tracepoint 4^M > A problem internal to GDB has been detected,^M > further debugging may prove unreliable.^M > Quit this debugging session? (y or n) FAIL: gdb.trace/collection.exp: col= lect args > collectively: tfind 0 with entry-values only (GDB internal error) >=20 > This internal error is fixed when the patch is applied. The patch is > tested on x86_64-linux with board file unix.exp and > native-gdbserver.exp respectively. >=20 > gdb: >=20 > 2013-08-05 Yao Qi >=20 > * stack.c (read_frame_arg): Set 'entryval_error' to NULL if > 'entryval' is set. >=20 > gdb/testsuite: >=20 > 2013-08-05 Yao Qi >=20 > * gdb.trace/collection.exp (gdb_collect_args_test): Set > "only" and "both" to 'print entry-values' before selecting > trace frame. > --- > gdb/stack.c | 5 ++++- > gdb/testsuite/gdb.trace/collection.exp | 16 ++++++++++++++++ > 2 files changed, 20 insertions(+), 1 deletions(-) >=20 > diff --git a/gdb/stack.c b/gdb/stack.c > index 3177877..9e9ebc1 100644 > --- a/gdb/stack.c > +++ b/gdb/stack.c > @@ -475,7 +475,10 @@ read_frame_arg (struct symbol *sym, struct frame_inf= o *frame, > || print_entry_values =3D=3D print_entry_values_both > || (print_entry_values =3D=3D print_entry_values_preferred > && (!val || value_optimized_out (val)))) > - entryval =3D allocate_optimized_out_value (SYMBOL_TYPE (sym)); > + { > + entryval =3D allocate_optimized_out_value (SYMBOL_TYPE (sym)); > + entryval_error =3D NULL; > + } > } > if ((print_entry_values =3D=3D print_entry_values_compact > || print_entry_values =3D=3D print_entry_values_if_needed > diff --git a/gdb/testsuite/gdb.trace/collection.exp > b/gdb/testsuite/gdb.trace/collection.exp > index f6d44ce..844cbb5 100644 > --- a/gdb/testsuite/gdb.trace/collection.exp > +++ b/gdb/testsuite/gdb.trace/collection.exp > @@ -128,6 +128,22 @@ proc gdb_collect_args_test { myargs msg } { > # Begin the test. > run_trace_experiment $msg args_test_func >=20 > + # Frame arguments and their entry values are displaced correctly with > + # various values of "print entry-values" when a trace frame is > + # selected. > + > + gdb_test "tfind -1" ".*" "" > + gdb_test_no_output "set print entry-values only" "" > + gdb_test "tfind 0" \ > + " \\(argc@entry=3D\[^,\]*, argi@entry=3D\[^,\]*, argf@entry=3D\[^,\]*, = argd@entry=3D\[^,\]*, > argstruct@entry=3D\[^,\]*, argarray@entry=3D\[^,\]*\\) .*" \ > + "collect $msg: tfind 0 with entry-values only" > + > + gdb_test "tfind -1" ".*" "" > + gdb_test_no_output "set print entry-values both" "" > + gdb_test "tfind 0" \ > + " \\(argc=3D\[^,\]*, argc@entry=3D\[^,\]*, argi=3D\[^,\]*, argi@entry= =3D\[^,\]*, > argf=3D\[^,\]*, argf@entry=3D\[^,\]*, argd=3D\[^,\]*, argd@entry=3D\[^,\]= *, argstruct=3D\[^,\]*, > argstruct@entry=3D\[^,\]*, argarray=3D\[^,\]*, argarray@entry=3D\[^,\]*\\= ) .*" \ > + "collect $msg: tfind 0 with entry-values both" > + > gdb_test "print argc" \ > "\\$\[0-9\]+ =3D 1 '.001'$cr" \ > "collect $msg: collected arg char" > -- > 1.7.7.6 Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052