From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114575 invoked by alias); 4 Jan 2017 17:19:26 -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 114506 invoked by uid 89); 4 Jan 2017 17:19:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=NA, interfering, H*M:ericsson, H*F:D*ericsson.com X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Jan 2017 17:19:11 +0000 Received: from ESESSHC002.ericsson.se (Unknown_Domain [153.88.183.24]) by (Symantec Mail Security) with SMTP id 85.94.22046.C8E2D685; Wed, 4 Jan 2017 18:19:09 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.24) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 4 Jan 2017 18:19:37 +0100 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=marc-andre.laperle@ericsson.com; Received: from [142.133.51.131] (192.75.88.130) by HE1PR07MB1275.eurprd07.prod.outlook.com (10.164.51.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.3; Wed, 4 Jan 2017 17:18:56 +0000 Subject: Re: [PATCH 3/3] Add -file-list-shared-libraries MI command To: Pedro Alves , References: <1473712054-30417-1-git-send-email-marc-andre.laperle@ericsson.com> <1473712054-30417-3-git-send-email-marc-andre.laperle@ericsson.com> <176aae27-f7c3-c563-141d-35eb1f69ee02@redhat.com> From: =?UTF-8?Q?Marc-Andr=c3=a9_Laperle?= Message-ID: Date: Wed, 04 Jan 2017 17:19:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <176aae27-f7c3-c563-141d-35eb1f69ee02@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BN6PR07CA0019.namprd07.prod.outlook.com (10.173.33.157) To HE1PR07MB1275.eurprd07.prod.outlook.com (10.164.51.149) X-MS-Office365-Filtering-Correlation-Id: 54ed4cc7-016a-479c-c674-08d434c5c405 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:HE1PR07MB1275; X-Microsoft-Exchange-Diagnostics: 1;HE1PR07MB1275;3:is+Zu67+Bc0f1Y3etCmNlKpiF1i38Fn0Y1f6JUOkf82AwhGsO7ofrHQ1iKAWdjIvw2Y4e/kFUUU19RqrHV+q3+qjTcJtagF6LswX1qCuoDQutYPLJ0/hrA0+re377kCgHRRnP2DzQehGkGzFqSPZxQi6imc+Y7mIwwdzhTI5SbjnSm5VvSmsq20EZimzXoqWNKPDV07jVH+8XR6lUQqcOh0gd8v72w29r+K/cKTi/HBjGrqqYTD12D6ss+q+uAWVYZlqWrO0T1wlbKSDc/H7OA== X-Microsoft-Exchange-Diagnostics: 1;HE1PR07MB1275;25:WwkvggYzz2fkUm+xk6CCsBMM6uyWqCx4HAr8zm6eYN93fyXbsKckCU74lKFt42Bk2yVl98a3kvC6gul7EMbZIZapN4Sx2Sw7+cdAhjTQ28Pd0z+5P2/09Qr+sWskkxyzvsG2zY7a+y9o5vkiAbC87Fs/s89i/prSpoFe/wrtShoPUKKlKN2xSV+a994T2QTSxp2xirlPnxU7bs4o1F1hgAS7V/00A0Z0g3L4IDTVr66XM7GYDy10YjIBFA9M9U1lThOqNl/B189XTFQNXq416fBA/EXv6jgQ5HYjAGBEYftHLyfoHr4lJK0kS4bQUKMc4ixJjYe/2rZzR4wL6y0Y21O0++crVBrComId0CNrRHnYCMWM2Xno7Iu8O+4oJfFp0R579WKHEZ+Vw0bdRhJPnmOmHquTg6RCxuiOU0NkT9Q1nSexT9oMpj3cf2ewtVtrFmR/muAwVc6Gb0STq3Qse11GfWbj3Mr4LNjg/OF+JMGdiKDFPQqtOwBqnbmjIaFAoVhecjvZylxxkq4gH40zSMB4jRzGnwU8SM8eg4XytAOpWZ5IMzaoj60U5/0Z9Y/PQ7OOCronVnIZk6OO83/KyiJ8wLyqlvqYHndbtNv+hHKkOSe99sEMlYEzVilrgTsrAGiTtd6DAQMLAECQk+wjgvSFWsCK9ZJezBcpQ8urv/YZ9uFwciz8bliWR7v2aGTId1Oj7CCLO6yYdAiB4JvqCEgK8qIptXU5F0wLFg0HyN/OpaX3KxTGtngvW4pAynP2flD5jZzIpqi80z6/WRrT4Q== X-Microsoft-Exchange-Diagnostics: 1;HE1PR07MB1275;31:yIm1pd0oqKRu+ou1Zffw1lrM+4kuvUjfz28hqDoqPjkXDPWD0x+skmSgls/Uzj4WvwqN2F9KBzRSwA+QSpDnQgXqvbvZlTuL4caS3JQ9reZ6rRldLy/kWM0vtIfYbNl+zGNmXxxsyS01Z2lmu5EO2h8233gbZ/NBG9qwfHWcDIQKa0Ir3LVaPZeXqRev7I82RBwbAHvukFKQWfxeOMaH2fqOBKuGoaF61ecE0gqY9yNclL+7J3XC3H7EIbF7sv/rjrWrsnDADviuqUIeTQR0zQ==;20:WGGIwkz6qfKMH08/E78Dy3trdB7Xj5+PLtVZze7a7ujcSKEwrbiVDImtbfn1+nGexCAMrUDChoZtk/LpYqH2ySddtkUdKCD/e+GV9gM5Pr/pwAARISksux8aNFJGgSJU16rQo6bryVBjnJKngTrM54J5Qjv/VtH10ob5uE5sYlEXdlKTrYPuaNDA9vZzLw3TCdI90QoNFV1qQttrE0mBTV6/Xamjn17wazk2IVTCL2GxXfxwXz88Lp9ZmX3xSFn2je2P9ioGhtrZxVHrMBdlAQyxmu8CbMn5Yy5e1MPgHeKJJjV7O+LiM9k2ULYmOMdwfXi5Tw/+kJBk5KBnLVSModtMabgLrFSH0uYsD87TC9rhWVPI5Y1wKZA4QLUeGN0iHvzz2WF5vOefZWqNzcjF2EsS2c3fLgOEzLGsjGcuBrd6TAVI2cVOXZT8GHFRVMtLtZskESd59RDXjXu3lmhHmkfVseaewlpb1Z/awG8gYxxjzY/9fbb3ys1j/pw218I0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148);SRVR:HE1PR07MB1275;BCL:0;PCL:0;RULEID:;SRVR:HE1PR07MB1275; X-Microsoft-Exchange-Diagnostics: 1;HE1PR07MB1275;4:6IWJZ93IPuZ6yHhwdHwA2/eEz3VkD8nKY5IYSdKl4RjMwNxodKYhV7EdDUwL/RNFugC9RGgdNjvdhG74+3vfMQq+L/Cqzx7v722/kx0FPsC2qMY9wEuI1ThfvhOVmzEwDVEFydE9KL+IxahsiTQTVloFDWoG3OZBOb5N1tITvZN33SOkjQp3y4YwtV1zWbEYLb0ZT3aoYriMc0aa9Oow6FjJRhEvUY+nlj3n7gAxW4MEjbLgrQGTgO/aZE2453B8o+79K3c/B0ETCbjuZV+PnXi+5HRn6mU8f96Y0+gIMTWI+nAVpdi8veygBtLD3xmd0RV2ngvVi5MtmLIRhRp/9yZho1aVL80Kb8lQR2F+1jgVbA8n5jzoTpGbHf8wvZH/4bqWLbB4AtK+2kTTof7lC9KXT3tPa+AihzVPLgegHBjuunEUe4Re56d3g6bd0qMBoRz9Iy0BenXebOkX5s1wHFBv+vdrqutALRmyEwzDl+XK+80hRwBhf8Wn7hr8rrKlTnWGhgLDIWWo74YlF1eEQElh0uxsSJ/QukW12Nc9lwJaBp86L1z+V6UmgNJ673qNry62npNYTQ8mjaLJQIsUYQ== X-Forefront-PRVS: 0177904E6B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(39450400003)(76104003)(199003)(377454003)(377424004)(24454002)(189002)(51914003)(31686004)(8676002)(36756003)(47776003)(65806001)(65956001)(81166006)(81156014)(66066001)(230700001)(230783001)(5660300001)(305945005)(7736002)(106356001)(101416001)(105586002)(42186005)(76176999)(54356999)(50986999)(65826007)(6116002)(83506001)(31696002)(4001150100001)(6486002)(90366009)(3846002)(92566002)(33646002)(23746002)(86362001)(68736007)(25786008)(64126003)(6666003)(2950100002)(50466002)(189998001)(2906002)(107886002)(4001350100001)(38730400001)(97736004)(229853002)(5001770100001);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR07MB1275;H:[142.133.51.131];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;HE1PR07MB1275;23:eBD76vsG9QtawaGL7z7fA7MF4yD53zhpAwR95?= =?Windows-1252?Q?QhaOKVwYdu7KFRi0JwOYKC7PyhJiujFY1UHMgIeP/pqQUALkw9OIG9W7?= =?Windows-1252?Q?75D7veV5TyyFaxRcxsWbkKFdVKNw6dGUdGNkhC3dCh+ls0mly/l11MfL?= =?Windows-1252?Q?A3Ny038p2UQjSICLRT9wT7vpxA2nDQNZyrIZdBmbRWVLYJi3KJBvnggW?= =?Windows-1252?Q?YiXWRnGyJKAUQdIRLHc5TEczgZ6i0zCKHrUKNUXyfj8Bd/Yudr9IGIeJ?= =?Windows-1252?Q?8EYSvQkgQn2sgGNX3IjCsPtZBN3I4L+gPhHjvGR5Dczwyr/F2snbak5q?= =?Windows-1252?Q?fwjy3WxiF9b3Ohc/eKT+e4875yDvprIBskU50NnekvO41mDA5+R0+v9x?= =?Windows-1252?Q?zsoUlpCbjcUuY5LZ2V99sFurZLP2703dvtwKYCBx0tuKdySo8QldkrFJ?= =?Windows-1252?Q?1UQfG8s5l5aCLeJDuvyhRTb7lFis9klNaVubVl5XeIc0qbCGcA6BgpCP?= =?Windows-1252?Q?sCKGxEo5silN0e17psrOZ7zH5G2lUBixcmGpNeSCSUAtHHeRxN8zdxBz?= =?Windows-1252?Q?xaf2QilZNVrDqtf0Wx4Bq+eL7DT0PH7bXfDrCugGn7hGTaEk/gzCsD4i?= =?Windows-1252?Q?UPv0Zl+5x4TOB9f4AW3w0qh2pj9eml9JPCharBNsY3aSeJJdGm4aTyCJ?= =?Windows-1252?Q?A/8zXA/9qsCU1hTwPywsjMdENTn3pTVGWvpB10lDQ4nAmmnNuss5Y0Ay?= =?Windows-1252?Q?/td119LlJsSn+y47Zchu6oA2qhqifoA/PBN11cvjkwNigdMiA30Pftif?= =?Windows-1252?Q?4yAInkazLO0jpInFLVsZbcUj+mnz8Oj1+OYf41QsEtpMWyO/emFaniiH?= =?Windows-1252?Q?z7YVc6guKD3kXg2DMHLDWmnWzvVI9Ol/YY81LvWuCow2/OEDlcIKDZ7N?= =?Windows-1252?Q?fJNDohmXoXU7eVWeAjlH+yuhqMLq+4/Psa5qIFk7bn6up/gXU8FX4NzL?= =?Windows-1252?Q?HAjhidZLHkRiKrwwy1/h8GGo7PEol61GiDHIO37YWPkKlY186SkTIpel?= =?Windows-1252?Q?LtCdEdxLyBVdmtXdotp57kj6lpbhcbstEI94h0+wJvQyjvrxxWRYRm+x?= =?Windows-1252?Q?pUX3KdBxCVdd4ZTT32zPDeuu73dqB9Xfc9AORs5w+6e3LLHW9XPGrRpG?= =?Windows-1252?Q?eGQekysjlPpkK6d0QY6MHKwhXmcwEejV9MyxDORgLnnbypimEwx2/Vui?= =?Windows-1252?Q?/M9qbXFSELn463yjzbrIGp3Q/sW9Yo+bY2wOY3TYriU007+3t8U0tget?= =?Windows-1252?Q?sfVbvKE7VsHQzqJSMTlm1E48jmX4dMqxZ2JaNC60vud8n3y+Qv29FWT7?= =?Windows-1252?Q?lC34DKiCMRtdGfqOaEv3BSUKIiqqMd/lQuwaMulpy5/W1BplSGzB75+V?= =?Windows-1252?Q?5Yi8iHOVH/arID9OqgxAIU20e/sfpG2qws2YVpTwcwnUaquIYDUsuqxG?= =?Windows-1252?Q?lKLCHpAFoVsJs279axsd02wL2ApPcv636xXRbEnD3a/WR8yiATuUS6iw?= =?Windows-1252?Q?k+I918/b5RnxCM=3D?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR07MB1275;6:DXj0jj8EREldr2WDKHVLLH1bVcRRmeUS4I8mpZfTCajQ9+nVgqfrkjuCBaVe3ql+P/5odob8H8rKKKUAqBQVsB1bUDU5vrH0mUiAind7xMFwqrvCO4/rvCcHWZ5JXP7zurl41NGrcHmuqylGXDcsKK7t5uAbD2fzv6lLEixnNc4QlGzGmZif2yZo6u9DcMmzzmNfbtMLcb3Ng8b8lZYTuzfqrEeLVlNBORgvag3anOYc9pmJHLh6w6/pLkoe0znOyrpqpNK5gb+bqA2CGsdsjkjsiKMC6MbqH4hkwHsyx+FUxnxIWWxddadrsj6PoB1jEL0aXple7JeUCIQvCG5jbNzNZ55ckhgFfXFcCrmqmIo899jxiEcVQEJRncD1qAYacGTexu9cVIxJsdrJhZRTiNe5YSoEi9DgBbwqiLmpjwU=;5:TVEmUB532TQy2WDlhj0G8b1XrVE6XkQiDU65ZFObht3Q9RZGjqzKmPz1u4MMPlnpM0264Wl57cJ8mB382zgpQ5GLu24TcpW27WwB1g8pZCSoJ+DcaQTHQPj1YRf2pOHh+kRmMIQkkphILD0NzF3EWw==;24:9xRDZFPwjAbq6pBO3mDk+jtWlcsUYp47SVeAC+W5VoAqQx/VLbzJo7MIJQgmrcF17Ne2olJgxKornLV8xB2cyRsNaCAhYY1NdK5VjKd2Qm0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR07MB1275;7:/eTRcBby1eXtv5VBH8Mj80qygxHeA3Ijik/8A45wkzpoP44CuVz8zbpaa7+1/+upm+cVRtnMGJZFNk5XpSY+Ln3kK62ZI5u5qwk/vt0SBRMEJpv9uuY+CDOpU3aQjdKQt5BpIFgyU/9yjBibrowFNgKQA/LQc7gl1NobZ1cfG3KnZ01F88xt7kBtCLeSaZKMpIet2p/EjROuOOsap+0WUFsG9L5KnFtIYM66JwUAyCTPMoJqbre13cjo58bb0nLK7vDX1Ux6NNEmbWcqMUazM6QG0hhb7Km/8kCIZckk/stYQ78G93lEBq5T8mydCXRUUXnwwwNxfY3rjIQx5UDVFMha/bDzZY/UJJ6eO/RyvB2/oW9zkTYUEIiQacdazqAAS2O8wJeRbaankkPrgPNkSyHGupiRuVYYAddvUiFVGT0KhAppWWj6X6ZiA/LkWaFZ9OIIYFWPganHaR7sXkU/Jg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2017 17:18:56.1881 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB1275 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00058.txt.bz2 Thanks for the comments! A few questions/suggestions below. On 2016-11-23 08:06 AM, Pedro Alves wrote: > Hi Marc-Andre, > > Great that you're tackling this. Thanks much for digging into GDB. :-) > I like this. As for following GDB's code standards, it's almost perfect. > > But I have questions on the MI output, though. See below. > > On 09/12/2016 09:27 PM, Marc-Andre Laperle wrote: > >> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo >> index d1a5e7c..c6b2133 100644 >> --- a/gdb/doc/gdb.texinfo >> +++ b/gdb/doc/gdb.texinfo >> @@ -31401,26 +31401,35 @@ The @value{GDBN} equivalent is @samp{info sources}. >> (gdb) >> @end smallexample >> >> -@ignore >> @subheading The @code{-file-list-shared-libraries} Command >> @findex -file-list-shared-libraries >> >> @subsubheading Synopsis >> >> @smallexample >> - -file-list-shared-libraries >> + -file-list-shared-libraries [ @var{regexp} ] >> @end smallexample >> >> List the shared libraries in the program. >> +With a regular expression @var{regexp}, only those libraries whose >> +names match @var{regexp} are listed. >> >> @subsubheading @value{GDBN} Command >> >> The corresponding @value{GDBN} command is @samp{info shared}. >> >> @subsubheading Example >> -N.A. >> +@smallexample >> +(gdb) >> +-file-list-exec-source-files >> +^done,shared-libraries=[ >> +@{from="0x72815989",to="0x728162c0",syms-read="1",name="/lib/libfoo.so"@}, >> +@{from="0x76ee48c0",to="0x76ee9160",syms-read="1",name="/lib/libbar.so"@}] > I don't see where the documentation describes what the > attributes of each list element are. Sorry if I missed it. > > I find it surprising that the attributes output don't match > attributes output by =library-loaded ? I'd think they should > match. That'd simplify the documentation too, as one place > would refer to the other for attributes list. > > BTW, =library-loaded doesn't output from/to. ISTR that that > was discussed and left out, because from/to assume there's > a contiguous range to report, while that's not true on all > targets (i.e., assumes a single segment). So it seems to > me that that's a separate discussion/patch would better > be addressed in both places. Those attributes are from the "info shared" command which is what this new MI command is inspired from. The from/to are shown in Eclipse and I personally use it to know in which library a given stack frame is, in absence of debug symbols. I could change the attributes to be just like "=library-loaded" but it would be inconsistent with "info shared" and will remove information that was available before. Perhaps the best way forward would be to make all attributes the same as "=library-loaded" but also add the from/to. To make the MI more future proof, it could be a list of from/to segments instead, but for now it will only one segment. What do you think? >> +void >> +mi_cmd_file_list_shared_libraries (char *command, char **argv, int argc) >> +{ >> + struct ui_out *uiout = current_uiout; >> + const char *pattern; >> + struct so_list *so = NULL; >> + struct gdbarch *gdbarch = target_gdbarch (); >> + >> + switch (argc) >> + { >> + case 0: >> + pattern = NULL; >> + break; >> + case 1: >> + pattern = argv[0]; >> + break; >> + default: >> + error (_("Usage: -file-list-shared-libraries [REGEXP]")); >> + break; > error doesn't return. No need for the break. > >> + } >> + >> + if (pattern != NULL) >> + { >> + char *re_err = re_comp (pattern); >> + >> + if (re_err != NULL) >> + error (_("Invalid regexp: %s"), re_err); >> + } >> + >> + update_solib_list (1); >> + >> + /* Print the table header. */ >> + ui_out_begin (uiout, ui_out_type_list, "shared-libraries"); >> + >> + ALL_SO_LIBS (so) >> + { >> + if (so->so_name[0] == '\0') >> + continue; >> + if (pattern != NULL && !re_exec (so->so_name)) >> + continue; >> + >> + ui_out_begin (uiout, ui_out_type_tuple, NULL); >> + >> + if (so->addr_high != 0) >> + { >> + ui_out_field_core_addr (uiout, "from", gdbarch, so->addr_low); >> + ui_out_field_core_addr (uiout, "to", gdbarch, so->addr_high); >> + } >> + else >> + { >> + ui_out_field_skip (uiout, "from"); >> + ui_out_field_skip (uiout, "to"); >> + } >> + >> + ui_out_field_int (uiout, "syms-read", so->symbols_loaded ? 1 : 0); >> + >> + ui_out_field_string (uiout, "name", so->so_name); > So seems to me that the inner body of this loop would be better > calling a function that is shared with =library-loaded. > >> + >> --- a/gdb/solist.h >> +++ b/gdb/solist.h >> @@ -23,6 +23,11 @@ >> /* For domain_enum domain. */ >> #include "symtab.h" >> >> +#define ALL_SO_LIBS(so) \ >> + for (so = current_program_space->so_list; \ >> + so; \ > Write explicit 'so != NULL'. > >> + so = so->next) >> + >> /* Forward declaration for target specific link map information. This >> struct is opaque to all but the target specific file. */ >> struct lm_info; >> diff --git a/gdb/testsuite/gdb.mi/mi-solib.exp b/gdb/testsuite/gdb.mi/mi-solib.exp >> index 2227987..4c40ba4 100644 >> --- a/gdb/testsuite/gdb.mi/mi-solib.exp >> +++ b/gdb/testsuite/gdb.mi/mi-solib.exp >> @@ -48,27 +48,47 @@ if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" >> >> mi_delete_breakpoints >> mi_gdb_reinitialize_dir $srcdir/$subdir >> -mi_gdb_reinitialize_dir $srcdir/$subdir >> mi_gdb_load ${binfile} >> >> mi_load_shlibs $binfile_lib >> >> -mi_gdb_test "777-gdb-set stop-on-solib-events 1" "777\\^done" \ >> - "set stop-on-solib-events" >> +proc test_stop_on_solib_events {} { > Looks like a good candidate for the the new proc_with_prefix. > >> + mi_gdb_test "777-gdb-set stop-on-solib-events 1" "777\\^done" \ >> + "set stop-on-solib-events" >> >> -# We use "run" rather than "-exec-run" here in order to test that CLI >> -# commands still cause the correct MI output to be generated. >> -mi_run_with_cli >> + # We use "run" rather than "-exec-run" here in order to test that CLI >> + # commands still cause the correct MI output to be generated. >> + mi_run_with_cli >> >> -# Also test that the CLI solib event note is output. >> -set test "CLI prints solib event" >> -gdb_expect { >> - -re "~\"Stopped due to shared library event \\(no libraries added or removed\\)\\\\n" { >> - pass "$test" >> - } >> - timeout { >> - fail "$test (timeout)" >> + # Also test that the CLI solib event note is output. >> + set test "CLI prints solib event" >> + gdb_expect { >> + -re "~\"Stopped due to shared library event \\(no libraries added or removed\\)\\\\n" { >> + pass "$test" >> + } >> + timeout { >> + fail "$test (timeout)" >> + } >> } >> + >> + mi_expect_stop solib-event .* .* .* .* .* "check for solib event" >> + >> + # Unset solib events to avoid interfering with other tests. >> + mi_gdb_test "778-gdb-set stop-on-solib-events 0" "778\\^done" \ >> + "unset stop-on-solib-events" >> +} >> + >> +proc test_file_list_shared_libraries {} { >> + global libname >> + global binfile >> + >> + mi_continue_to main >> + >> + mi_gdb_test "222-file-list-shared-libraries" \ >> + "222\\^done,shared-libraries=\\\[.*\{from=\".*\",to=\".*\",syms-read=\"1\",name=\".*${libname}.so\"\}.*]" \ >> + "Getting a list of shared libraries." > Lowercase, no period at end, and use imperative: > > "get list of shared libraries" > > Thanks, > Pedro Alves >