From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 0FB23385800C for ; Tue, 21 Mar 2023 09:50:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0FB23385800C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=undo.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=undo.io Received: by mail-ed1-x52a.google.com with SMTP id r11so57255415edd.5 for ; Tue, 21 Mar 2023 02:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=undo.io; s=google2; t=1679392217; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=m5PXn/H+vIH4cZeRwZRKOTadyWRZk9LKBixlVg3JJUs=; b=AynptRIYlO0CwxC/l52n8BbA5IEOPcq7RMZ4kubd+2Cu0sPz7wmkrabONPKeq2yv9V XIUD+gg/8t0uDbgj6a+5gUly33Vkbl+4/rtu4KuwZe9SRphN4J3Yg8BlohPWWQnGhNcD RShFthGDcSjvctv9wSTdcl1oDHpLJqCJauU55mo7YwVploi620Ca3u3Qc3GGo5O00QQC +ptmyVSkCXN51Vkm9upHwGC9H4EVox0UikjzdEp5brQ9iy3G/3N3lDRn4ZkxeQBbR35t /Us0xSNsIR4QtDzhKos+UO+bafuJrvw9bR4CZ8SMTWuA4DK7V46IdxFCaVNR6h8Ju4mf WH9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679392217; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m5PXn/H+vIH4cZeRwZRKOTadyWRZk9LKBixlVg3JJUs=; b=k7HCaPxMtejNNT5wKKgDwQKs8THG258uIUqhgiw2ffLDQZKO8Yx4HxSwzwEjf0z3N/ 7stqpuuhwWrFfdzG6gl7DnvpGgEHvhhzPXwFprcXMoD3uE+15uSv+CVQBnJF3ZpS/IJc mE3vofoWHNPOJokmANcWNtrIQqR4iwMfqSWXigsMffQwrfzVgsUL+B3ZYSgxa2tQlehU 4pfUJomNP2/XmJh4mccyyHR6sIOzempNKY6ro7KjybD5D9av/l3VyjeecYnUNXfJ8IkR OZJsTrb3ongkeyWpgCmZO+Tsw777l+0LesArvo3tE2J/70zJLEkVNa4VfcsM0bMavY2h YsRg== X-Gm-Message-State: AO0yUKURUs0sWDiSz2Kga50QYJmsJr3h7Hj6bcwgfrhYP1/KiuVeKjEq dfyrDS4MUMeA66VtreI1FsOSN9lVLpfeBbRq480Erp0iAjurfb/pTdgpbw== X-Google-Smtp-Source: AK7set9cy44LFaPqcOCygPaUZclZcBGnLfY/WvRBXyAUWk3CbJw3556D5W5jVFlS+pscS+oDwiF/q/ieTLI0ExUOZhY= X-Received: by 2002:a17:906:5dd8:b0:931:dd22:4486 with SMTP id p24-20020a1709065dd800b00931dd224486mr998978ejv.8.1679392217327; Tue, 21 Mar 2023 02:50:17 -0700 (PDT) MIME-Version: 1.0 References: <20221020174702.514681-1-grees@undo.io> <20230311114934.3632834-1-grees@undo.io> In-Reply-To: <20230311114934.3632834-1-grees@undo.io> From: Gareth Rees Date: Tue, 21 Mar 2023 09:50:06 +0000 Message-ID: Subject: [PING] [PATCH v6] [gdb/mi] Don't treat references to compound values as "simple". To: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is a patch modifying the behaviour of the --simple-values option but as discussed previously, if GDB maintainers agree that adding a new option is the best approach, I would be happy to submit a patch for that solution instead. On Sat, 11 Mar 2023 at 11:49, Gareth Rees wrote: > > SUMMARY > > The '--simple-values' argument to '-stack-list-arguments' and similar > GDB/MI commands does not take reference types into account, so that > references to arbitrarily large structures are considered "simple" and > printed. This means that the '--simple-values' argument cannot be used > by IDEs when tracing the stack due to the time taken to print large > structures passed by reference. > > DETAILS > > Various GDB/MI commands ('-stack-list-arguments', '-stack-list-locals', > '-stack-list-variables' and so on) take a PRINT-VALUES argument which > may be '--no-values' (0), '--all-values' (1) or '--simple-values' (2). > In the '--simple-values' case, the command is supposed to print the > name, type, and value of variables with simple types, and print only the > name and type of variables with compound types. > > The '--simple-values' argument ought to be suitable for IDEs that need > to update their user interface with the program's call stack every time > the program stops. However, it does not take C++ reference types into > account, and this makes the argument unsuitable for this purpose. > > For example, consider the following C++ program: > > struct s { > int v[10]; > }; > > int > sum(const struct s &s) > { > int total =3D 0; > for (int i =3D 0; i < 10; ++i) total +=3D s.v[i]; > return total; > } > > int > main(void) > { > struct s s =3D { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } }; > return sum(s); > } > > If we start GDB in MI mode and continue to 'sum', the behaviour of > '-stack-list-arguments' is as follows: > > (gdb) > -stack-list-arguments --simple-values > ^done,stack-args=3D[frame=3D{level=3D"0",args=3D[{name=3D"s",type=3D"= const s &",value=3D"@0x7fffffffe310: {v =3D {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}= }"}]},frame=3D{level=3D"1",args=3D[]}] > > Note that the value of the argument 's' was printed, even though 's' is > a reference to a structure, which is not a simple value. > > See https://github.com/microsoft/MIEngine/pull/673 for a case where this > behaviour caused Microsoft to avoid the use of '--simple-values' in > their MIEngine debug adapter, because it caused Visual Studio Code to > take too long to refresh the call stack in the user interface. > > SOLUTIONS > > There are two ways we could fix this problem, depending on whether we > consider the current behaviour to be a bug. > > 1. If the current behaviour is a bug, then we can update the behaviour > of '--simple-values' so that it takes reference types into account: > that is, a value is simple if it is neither an array, struct, or > union, nor a reference to an array, struct or union. > > In this case we must add a feature to the '-list-features' command so > that IDEs can detect that it is safe to use the '--simple-values' > argument when refreshing the call stack. > > 2. If the current behaviour is not a bug, then we can add a new option > for the PRINT-VALUES argument, for example, '--scalar-values' (3), > that would be suitable for use by IDEs. > > In this case we must add a feature to the '-list-features' command > so that IDEs can detect that the '--scalar-values' argument is > available for use when refreshing the call stack. > > PATCH > > This patch implements solution (1) as I think the current behaviour of > not printing structures, but printing references to structures, is > contrary to reasonable expectation. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29554 > --- > gdb/NEWS | 8 +++ > gdb/doc/gdb.texinfo | 7 +++ > gdb/mi/mi-cmd-stack.c | 9 +-- > gdb/mi/mi-cmd-var.c | 27 ++++++--- > gdb/mi/mi-cmds.h | 5 ++ > gdb/mi/mi-main.c | 7 +-- > gdb/python/py-framefilter.c | 6 +- > gdb/testsuite/gdb.mi/mi-stack.exp | 16 ++++- > gdb/testsuite/gdb.mi/print-simple-values.cc | 62 ++++++++++++++++++++ > gdb/testsuite/gdb.mi/print-simple-values.exp | 53 +++++++++++++++++ > 10 files changed, 175 insertions(+), 25 deletions(-) > create mode 100644 gdb/testsuite/gdb.mi/print-simple-values.cc > create mode 100644 gdb/testsuite/gdb.mi/print-simple-values.exp > > diff --git a/gdb/NEWS b/gdb/NEWS > index cc262f1f8a6..1971b76a736 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -104,6 +104,14 @@ show always-read-ctf > without a thread restriction. The same is also true for the 'task' > field of an Ada task-specific breakpoint. > > +** The '--simple-values' argument to the '-stack-list-arguments', > + '-stack-list-locals', '-stack-list-variables', and '-var-list-childre= n' > + commands now takes reference types into account: that is, a value is = now > + considered simple if it is neither an array, structure, or union, nor= a > + reference to an array, structure, or union. (Previously all referenc= es were > + considered simple.) Support for this feature can be verified by usin= g the > + '-list-features' command, which should contain "simple-values-ref-typ= es". > + > *** Changes in GDB 13 > > * MI version 1 is deprecated, and will be removed in GDB 14. > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index 954f1481dae..dff7ba374bd 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -37948,6 +37948,13 @@ option (@pxref{GDB/MI Program Execution}). > @item data-disassemble-a-option > Indicates that the @code{-data-disassemble} command supports the @option= {-a} > option (@pxref{GDB/MI Data Manipulation}). > +@item simple-values-ref-types > +Indicates that the @code{--simple-values} argument to the > +@code{-stack-list-arguments}, @code{-stack-list-locals}, > +@code{-stack-list-variables}, and @code{-var-list-children} commands > +takes reference types into account: that is, a value is considered > +simple if it is neither an array, structure, or union, nor a reference > +to an array, structure, or union. > @end ftable > > @findex -list-target-features > diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c > index 4c4662ab5d7..406bf85ceec 100644 > --- a/gdb/mi/mi-cmd-stack.c > +++ b/gdb/mi/mi-cmd-stack.c > @@ -645,13 +645,8 @@ list_args_or_locals (const frame_print_options &fp_o= pts, > switch (values) > { > case PRINT_SIMPLE_VALUES: > - { > - struct type *type =3D check_typedef (sym2->type ()); > - if (type->code () =3D=3D TYPE_CODE_ARRAY > - || type->code () =3D=3D TYPE_CODE_STRUCT > - || type->code () =3D=3D TYPE_CODE_UNION) > - break; > - } > + if (!mi_simple_type_p (sym2->type ())) > + break; > /* FALLTHROUGH */ > > case PRINT_ALL_VALUES: > diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c > index e026c239b87..36eea4619a7 100644 > --- a/gdb/mi/mi-cmd-var.c > +++ b/gdb/mi/mi-cmd-var.c > @@ -335,14 +335,27 @@ mi_print_value_p (struct varobj *var, enum print_va= lues print_values) > if (type =3D=3D NULL) > return 1; > else > - { > - type =3D check_typedef (type); > + return mi_simple_type_p (type); > +} > > - /* For PRINT_SIMPLE_VALUES, only print the value if it has a type > - and that type is not a compound type. */ > - return (type->code () !=3D TYPE_CODE_ARRAY > - && type->code () !=3D TYPE_CODE_STRUCT > - && type->code () !=3D TYPE_CODE_UNION); > +/* See mi-cmds.h. */ > + > +bool > +mi_simple_type_p (struct type *type) > +{ > + type =3D check_typedef (type); > + > + if (TYPE_IS_REFERENCE (type)) > + type =3D check_typedef (type->target_type ()); > + > + switch (type->code ()) > + { > + case TYPE_CODE_ARRAY: > + case TYPE_CODE_STRUCT: > + case TYPE_CODE_UNION: > + return false; > + default: > + return true; > } > } > > diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h > index 490f50484d9..d867c298df9 100644 > --- a/gdb/mi/mi-cmds.h > +++ b/gdb/mi/mi-cmds.h > @@ -226,4 +226,9 @@ using remove_mi_cmd_entries_ftype > =3D gdb::function_view; > extern void remove_mi_cmd_entries (remove_mi_cmd_entries_ftype callback)= ; > > +/* Return true if type is a simple type: that is, neither an array, stru= cture, > + or union, nor a reference to an array, structure, or union. */ > + > +extern bool mi_simple_type_p (struct type *type); > + > #endif /* MI_MI_CMDS_H */ > diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c > index 0013e5dfafd..cedad60d0b8 100644 > --- a/gdb/mi/mi-main.c > +++ b/gdb/mi/mi-main.c > @@ -1656,6 +1656,7 @@ mi_cmd_list_features (const char *command, char **a= rgv, int argc) > uiout->field_string (NULL, "undefined-command-error-code"); > uiout->field_string (NULL, "exec-run-start-option"); > uiout->field_string (NULL, "data-disassemble-a-option"); > + uiout->field_string (NULL, "simple-values-ref-types"); > > if (ext_lang_initialized_p (get_ext_lang_defn (EXT_LANG_PYTHON))) > uiout->field_string (NULL, "python"); > @@ -2458,7 +2459,6 @@ static void > print_variable_or_computed (const char *expression, enum print_values va= lues) > { > struct value *val; > - struct type *type; > struct ui_out *uiout =3D current_uiout; > > string_file stb; > @@ -2478,12 +2478,9 @@ print_variable_or_computed (const char *expression= , enum print_values values) > switch (values) > { > case PRINT_SIMPLE_VALUES: > - type =3D check_typedef (val->type ()); > type_print (val->type (), "", &stb, -1); > uiout->field_stream ("type", stb); > - if (type->code () !=3D TYPE_CODE_ARRAY > - && type->code () !=3D TYPE_CODE_STRUCT > - && type->code () !=3D TYPE_CODE_UNION) > + if (mi_simple_type_p (val->type ())) > { > struct value_print_options opts; > > diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c > index 0e8b2409636..e555dc3d879 100644 > --- a/gdb/python/py-framefilter.c > +++ b/gdb/python/py-framefilter.c > @@ -235,14 +235,10 @@ py_print_value (struct ui_out *out, struct value *v= al, > if (args_type =3D=3D MI_PRINT_SIMPLE_VALUES > || args_type =3D=3D MI_PRINT_ALL_VALUES) > { > - struct type *type =3D check_typedef (val->type ()); > - > if (args_type =3D=3D MI_PRINT_ALL_VALUES) > should_print =3D 1; > else if (args_type =3D=3D MI_PRINT_SIMPLE_VALUES > - && type->code () !=3D TYPE_CODE_ARRAY > - && type->code () !=3D TYPE_CODE_STRUCT > - && type->code () !=3D TYPE_CODE_UNION) > + && mi_simple_type_p (val->type ())) > should_print =3D 1; > } > else if (args_type !=3D NO_VALUES) > diff --git a/gdb/testsuite/gdb.mi/mi-stack.exp b/gdb/testsuite/gdb.mi/mi-= stack.exp > index 633e090c13a..777a425894f 100644 > --- a/gdb/testsuite/gdb.mi/mi-stack.exp > +++ b/gdb/testsuite/gdb.mi/mi-stack.exp > @@ -87,6 +87,9 @@ proc test_stack_args_listing {} { > # -stack-list-arguments 1 1 1 > # -stack-list-arguments 1 1 3 > # -stack-list-arguments > + # -stack-list-arguments 1 1 300 > + # -stack-list-arguments 2 1 1 > + # -stack-list-arguments --simple-values 1 1 > > mi_gdb_test "231-stack-list-arguments 0" \ > "231\\^done,stack-args=3D\\\[frame=3D\{level=3D\"0\",args=3D\\\[\= \\]\},frame=3D\{level=3D\"1\",args=3D\\\[name=3D\"strarg\"\\\]\},frame=3D\{= level=3D\"2\",args=3D\\\[name=3D\"intarg\",name=3D\"strarg\"\\\]\},frame=3D= \{level=3D\"3\",args=3D\\\[name=3D\"intarg\",name=3D\"strarg\",name=3D\"flt= arg\"\\\]\},frame=3D\{level=3D\"4\",args=3D\\\[\\\]\}\\\]" \ > @@ -119,6 +122,14 @@ proc test_stack_args_listing {} { > mi_gdb_test "235-stack-list-arguments 1 1 300" \ > "235\\^done,stack-args=3D\\\[frame=3D\{level=3D\"1\",args=3D\\\[\= {name=3D\"strarg\",value=3D\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},= frame=3D\{level=3D\"2\",args=3D\\\[\{name=3D\"intarg\",value=3D\"2\"\},\{na= me=3D\"strarg\",value=3D\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},fra= me=3D\{level=3D\"3\",args=3D\\\[\{name=3D\"intarg\",value=3D\"2\"\},\{name= =3D\"strarg\",value=3D\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=3D\"= fltarg\",value=3D\"3.5\"\}\\\]\},frame=3D\{level=3D\"4\",args=3D\\\[\\\]\}\= \\]" \ > "stack args listing 1 1 300" > + > + mi_gdb_test "236-stack-list-arguments 2 1 1" \ > + "236\\^done,stack-args=3D\\\[frame=3D\\{level=3D\"1\",args=3D\\\[= \\{name=3D\"strarg\",type=3D\"char \\*\",value=3D\"$hex \\\\\"A string argu= ment.\\\\\"\"\\}\\\]\\}\\\]" \ > + "stack args listing 2 1 1" > + > + mi_gdb_test "237-stack-list-arguments --simple-values 1 1" \ > + "237\\^done,stack-args=3D\\\[frame=3D\\{level=3D\"1\",args=3D\\\[= \\{name=3D\"strarg\",type=3D\"char \\*\",value=3D\"$hex \\\\\"A string argu= ment.\\\\\"\"\\}\\\]\\}\\\]" \ > + "stack args listing --simple-values 1 1" > } > > proc test_stack_info_depth {} { > @@ -157,7 +168,6 @@ proc test_stack_locals_listing {} { > # -stack-list-locals 0 (--no-values) > # -stack-list-locals 1 (--all-values) > # -stack-list-locals 2 (--simple-values) > - # -stack-list-arguments > > mi_gdb_test "232-stack-list-locals 0" \ > "232\\^done,locals=3D\\\[name=3D\"A\",name=3D\"B\",name=3D\"C\",n= ame=3D\"D\"\\\]" \ > @@ -173,6 +183,10 @@ proc test_stack_locals_listing {} { > "232\\^done,locals=3D\\\[\{name=3D\"A\",value=3D\"1\"\},\{name=3D= \"B\",value=3D\"2\"\},\{name=3D\"C\",value=3D\"3\"\},\{name=3D\"D\",value= =3D\"\\{0, 1, 2\\}\"\}\\\]" \ > "stack locals listing of names and values" > > + mi_gdb_test "232-stack-list-locals 2" \ > + "232\\^done,locals=3D\\\[\{name=3D\"A\",type=3D\"int\",value=3D\"= 1\"\},\{name=3D\"B\",type=3D\"int\",value=3D\"2\"\},\{name=3D\"C\",type=3D\= "int\",value=3D\"3\"\},\{name=3D\"D\",type=3D\"int \\\[3\\\]\"\}\\\]" \ > + "stack locals listing 2" > + > mi_gdb_test "232-stack-list-locals --simple-values" \ > "232\\^done,locals=3D\\\[\{name=3D\"A\",type=3D\"int\",value=3D\"= 1\"\},\{name=3D\"B\",type=3D\"int\",value=3D\"2\"\},\{name=3D\"C\",type=3D\= "int\",value=3D\"3\"\},\{name=3D\"D\",type=3D\"int \\\[3\\\]\"\}\\\]" \ > "stack locals listing, simple types: names and values, complex ty= pe: names and types" > diff --git a/gdb/testsuite/gdb.mi/print-simple-values.cc b/gdb/testsuite/= gdb.mi/print-simple-values.cc > new file mode 100644 > index 00000000000..1aad724efb9 > --- /dev/null > +++ b/gdb/testsuite/gdb.mi/print-simple-values.cc > @@ -0,0 +1,62 @@ > +/* This test case is part of GDB, the GNU debugger. > + > + Copyright 2022-2023 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see .= */ > + > +/* Test program for PRINT_SIMPLE_VALUES. > + > + In the function f: > + > + * The arguments i, ir, and irr are ints or references to ints, which > + must be printed by PRINT_SIMPLE_VALUES. > + > + * The arguments a, s, and u are non-scalar values, which must not be > + printed by PRINT_SIMPLE_VALUES. > + > + * The arguments ar, arr, sr, srr, ur, and urr are references to > + non-scalar values, which must not be printed by > + PRINT_SIMPLE_VALUES. */ > + > +struct s > +{ > + int v; > +}; > + > +union u > +{ > + int v; > +}; > + > +int > +f (int i, int &ir, int &&irr, > + int a[1], int (&ar)[1], int (&&arr)[1], > + struct s s, struct s &sr, struct s &&srr, > + union u u, union u &ur, union u &&urr) > +{ > + return (i + ir + irr > + + a[0] + ar[0] + arr[0] > + + s.v + sr.v + srr.v > + + u.v + ur.v + urr.v); > +} > + > +int > +main (void) > +{ > + int i =3D 1, j =3D 2; > + int a[1] =3D { 4 }, b[1] =3D { 5 }; > + struct s s =3D { 7 }, t =3D { 8 }; > + union u u =3D { 10 }, v =3D { 11 }; > + return f (i, j, 3, a, b, { 6 }, s, t, { 9 }, u, v, { 12 }); > +} > diff --git a/gdb/testsuite/gdb.mi/print-simple-values.exp b/gdb/testsuite= /gdb.mi/print-simple-values.exp > new file mode 100644 > index 00000000000..9436645df84 > --- /dev/null > +++ b/gdb/testsuite/gdb.mi/print-simple-values.exp > @@ -0,0 +1,53 @@ > +# Copyright 2022-2023 Free Software Foundation, Inc. > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# Test of PRINT_SIMPLE_VALUES. > +# > +# Test that PRINT_SIMPLE_VALUES distinguishes simple and compound types, > +# including C++ reference and rvalue reference types. > + > +require allow_cplus_tests > + > +load_lib mi-support.exp > +set MIFLAGS "-i=3Dmi" > + > +standard_testfile .cc > + > +if [build_executable "failed to prepare" $testfile $srcfile {debug c++}]= { > + return -1 > +} > + > +if [mi_clean_restart $binfile] { > + return > +} > + > +mi_runto_main > + > +mi_gdb_test "-break-insert f" "\\^done.*" "set breakpoint on f" > + > +mi_send_resuming_command "exec-continue" "exec-continue to breakpoint on= f" > + > +mi_expect_stop "breakpoint-hit" "f" ".*" ".*" ".*" {.* disp=3D"keep"} \ > + "run until breakpoint on f" > + > +mi_gdb_test "-stack-list-arguments 2" \ > + "\\^done,stack-args=3D\\\[frame=3D\\{level=3D\"0\",args=3D\\\[\\{nam= e=3D\"i\",type=3D\"int\",value=3D\"1\"\\},\\{name=3D\"ir\",type=3D\"int &\"= ,value=3D\"@$hex: 2\"\\},\\{name=3D\"irr\",type=3D\"int &&\",value=3D\"@$he= x: 3\"\\},\\{name=3D\"a\",type=3D\"int \\*\",value=3D\"$hex\"\\},\\{name=3D= \"ar\",type=3D\"int \\(&\\)\\\[1\\\]\"\\},\\{name=3D\"arr\",type=3D\"int \\= (&&\\)\\\[1\\\]\"\\},\\{name=3D\"s\",type=3D\"s\"\\},\\{name=3D\"sr\",type= =3D\"s &\"\\},\\{name=3D\"srr\",type=3D\"s &&\"\\},\\{name=3D\"u\",type=3D\= "u\"\\},\\{name=3D\"ur\",type=3D\"u &\"\\},\\{name=3D\"urr\",type=3D\"u &&\= "\\}\\\]\\},frame=3D\\{level=3D\"1\",args=3D\\\[\\\]\\}\\\]" \ > + "stack arguments listing 2" > + > +mi_gdb_test "-stack-list-arguments --simple-values" \ > + "\\^done,stack-args=3D\\\[frame=3D\\{level=3D\"0\",args=3D\\\[\\{nam= e=3D\"i\",type=3D\"int\",value=3D\"1\"\\},\\{name=3D\"ir\",type=3D\"int &\"= ,value=3D\"@$hex: 2\"\\},\\{name=3D\"irr\",type=3D\"int &&\",value=3D\"@$he= x: 3\"\\},\\{name=3D\"a\",type=3D\"int \\*\",value=3D\"$hex\"\\},\\{name=3D= \"ar\",type=3D\"int \\(&\\)\\\[1\\\]\"\\},\\{name=3D\"arr\",type=3D\"int \\= (&&\\)\\\[1\\\]\"\\},\\{name=3D\"s\",type=3D\"s\"\\},\\{name=3D\"sr\",type= =3D\"s &\"\\},\\{name=3D\"srr\",type=3D\"s &&\"\\},\\{name=3D\"u\",type=3D\= "u\"\\},\\{name=3D\"ur\",type=3D\"u &\"\\},\\{name=3D\"urr\",type=3D\"u &&\= "\\}\\\]\\},frame=3D\\{level=3D\"1\",args=3D\\\[\\\]\\}\\\]" \ > + "stack arguments listing --simple-values" > + > +mi_gdb_exit > -- > 2.26.0 >