From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53079 invoked by alias); 14 Oct 2016 21:20:46 -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 53065 invoked by uid 89); 14 Oct 2016 21:20:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 spammy=na, NA, 115,6, 25,9 X-HELO: sessmg22.ericsson.net Received: from sessmg22.ericsson.net (HELO sessmg22.ericsson.net) (193.180.251.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Oct 2016 21:20:35 +0000 Received: from ESESSHC019.ericsson.se (Unknown_Domain [153.88.183.75]) by (Symantec Mail Security) with SMTP id 66.F6.02458.F1C41085; Fri, 14 Oct 2016 23:20:32 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 14 Oct 2016 23:20:30 +0200 Received: from DB5PR07MB1269.eurprd07.prod.outlook.com (10.164.41.147) by DB5PR07MB1270.eurprd07.prod.outlook.com (10.164.41.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.5; Fri, 14 Oct 2016 21:20:29 +0000 Received: from DB5PR07MB1269.eurprd07.prod.outlook.com ([10.164.41.147]) by DB5PR07MB1269.eurprd07.prod.outlook.com ([10.164.41.147]) with mapi id 15.01.0669.016; Fri, 14 Oct 2016 21:20:29 +0000 From: =?iso-8859-1?Q?Marc-Andr=E9_Laperle?= To: "gdb-patches@sourceware.org" Subject: Re: [PATCH 3/3] Add -file-list-shared-libraries MI command Date: Fri, 14 Oct 2016 21:20:00 -0000 Message-ID: References: <1473712054-30417-1-git-send-email-marc-andre.laperle@ericsson.com>,<1473712054-30417-3-git-send-email-marc-andre.laperle@ericsson.com> In-Reply-To: <1473712054-30417-3-git-send-email-marc-andre.laperle@ericsson.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=marc-andre.laperle@ericsson.com; x-ms-office365-filtering-correlation-id: 47b28d3e-d5d3-4cd3-7dd3-08d3f477ec9a x-microsoft-exchange-diagnostics: 1;DB5PR07MB1270;6:9kO/LgOUmr1+rb5O8QBpCfh1YcvU+DtZdTy1GfIfRbpv4CILMcyNiTbhiN3Hp+I5QbDWR9QKcFDJFM4b0oCOiuxbk05ero7H12cf7c1eNJ3hoSdhZ/Q/4eEQ1GvfzOj0tqilOXdFE65Nex86GtCh/KjW+tn39KcTa3NolKTGiTlW3r922fldrLAhNhV4/Tx7DkL6wVDMw9MAGQ00H62keLj/DDpu/eVMrdMaCZpFwZd0Mp+d/fwF5/WqWx+x85XtFtHDeCZ07yKBw6rCst7KS5+6gt14y44YlVB7FLIB2p5xMKaEJWqqB5Yc2h/xBZa1;5:Vi0PTh/WLMCig4iFTTwmse7ICF6pA0rr5Wbn6sgFXhXet1ZpfUGKyPhtF6BxKJ37OLSuNqsf2DLHtiXaFFzbLlXHndqyOMiPrJp/cB0knImzD8Y011f9I0Mo66076SSB4vBTFSihjU7v9YDyiX1+mQ==;24:Sp7hkNpLrrVOZ3vnQLhEAyoYO7ZSZHzusixZa4WulZoW6bLX3EVMFvfijzP8+ONGf2lVvEinErCSusYGqjEJzbH9KUUbC58naL1lNWfySBE=;7:U4BSkrm92l5UaunDEOA0lNb/965YvdQltcqBvgiclFXed8Uex6dc2XrLoohWoCibBtYNoK76h40C44nplI09JuPS1FAg7bNopyFh8UM1lPk1S668GnxBSq8kZYMbuo63HMAhY6HZfylGoawslwPZ/s/JzDBkyEFeGvcigxvLWqYRLy6KamX7edexqpjfXOEld0e5dooXZcIaPROt4WB/lr1NEmzJOukWNe5p7XY6Hsw9frX6Wojmqu68J/v6/RqxR6YJwapLv0abMviYJwjfwHeSxgaTG5F9QH/6cL4PzachyCu6U3KnTn2hoeQd9apyAteM/5WPPP7tmwj74cdMoaIA14PCEPP02Wj9NYkDGFo= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR07MB1270; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(37575265505322)(788757137089); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:DB5PR07MB1270;BCL:0;PCL:0;RULEID:;SRVR:DB5PR07MB1270; x-forefront-prvs: 0095BCF226 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(54534003)(377454003)(189002)(199003)(105586002)(8676002)(10400500002)(11100500001)(107886002)(2906002)(81156014)(450100001)(106356001)(92566002)(81166006)(2351001)(230783001)(3660700001)(106116001)(86362001)(3900700001)(110136003)(87936001)(7696004)(5640700001)(77096005)(2501003)(189998001)(5660300001)(2900100001)(586003)(76176999)(3280700002)(19580405001)(7736002)(3846002)(6116002)(97736004)(66066001)(122556002)(50986999)(54356999)(19580395003)(5002640100001)(33656002)(6916009)(9686002)(2950100002)(68736007)(8936002)(74316002)(7846002)(102836003)(101416001)(76576001)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR07MB1270;H:DB5PR07MB1269.eurprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2016 21:20:29.5603 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB1270 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00461.txt.bz2 Ping. From: Marc-Andr=E9 Laperle Sent: Monday, September 12, 2016 4:27 PM To: gdb-patches@sourceware.org Cc: Marc-Andr=E9 Laperle Subject: [PATCH 3/3] Add -file-list-shared-libraries MI command =A0=20=20=20 This change adds the MI equivalent for the "info sharedlibrary" command. The command was already partially documented but ignored as it was not implemented. The new MI command works similarly to the CLI command, taking an optional regular expression as an argument and outputting the library information. I included a test for the new command in mi-solib.exp. gdb/doc/ChangeLog: =A0=A0=A0=A0=A0=A0=A0 * gdb.texinfo (gdb/mi Symbol Query Commands): Documen= t new MI =A0=A0=A0=A0=A0=A0=A0 command file-list-shared-libraries gdb/ChangeLog: =A0=A0=A0=A0=A0=A0=A0 * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries= ): =A0=A0=A0=A0=A0=A0=A0 New function definition. =A0=A0=A0=A0=A0=A0=A0 * mi/mi-cmds.c (mi_cmds): Add -file-list-shared-libra= ries command. =A0=A0=A0=A0=A0=A0=A0 * mi/mi-cmds.h (mi_cmd_file_list_shared_libraries): =A0=A0=A0=A0=A0=A0=A0 New function declaration. =A0=A0=A0=A0=A0=A0=A0 * solib.c (info_sharedlibrary_command): Replace for l= oop with =A0=A0=A0=A0=A0=A0=A0 ALL_SO_LIBS macro =A0=A0=A0=A0=A0=A0=A0 * solib.h (update_solib_list): New function declarati= on. =A0=A0=A0=A0=A0=A0=A0 * solist.h (ALL_SO_LIBS): New macro. gdb/testsuite/ChangeLog: =A0=A0=A0=A0=A0=A0=A0 * gdb.mi/mi-solib.exp (test_file_list_shared_librarie= s): =A0=A0=A0=A0=A0=A0=A0 New procedure. Signed-off-by: Marc-Andre Laperle --- =A0gdb/doc/gdb.texinfo=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 | 15 +++++= ++-- =A0gdb/mi/mi-cmd-file.c=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 | 67 +++++++= ++++++++++++++++++++++++++++++++ =A0gdb/mi/mi-cmds.c=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |=A0= 2 ++ =A0gdb/mi/mi-cmds.h=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 |=A0= 1 + =A0gdb/solib.c=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 | 18 ++--------- =A0gdb/solib.h=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 | 18 +++++++++++ =A0gdb/solist.h=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 |=A0 5 +++ =A0gdb/testsuite/gdb.mi/mi-solib.exp | 50 ++++++++++++++++++++--------- =A08 files changed, 142 insertions(+), 34 deletions(-) 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= }. =A0(gdb) =A0@end smallexample =A0 -@ignore =A0@subheading The @code{-file-list-shared-libraries} Command =A0@findex -file-list-shared-libraries =A0 =A0@subsubheading Synopsis =A0 =A0@smallexample - -file-list-shared-libraries + -file-list-shared-libraries [ @var{regexp} ] =A0@end smallexample =A0 =A0List the shared libraries in the program. +With a regular expression @var{regexp}, only those libraries whose +names match @var{regexp} are listed. =A0 =A0@subsubheading @value{GDBN} Command =A0 =A0The corresponding @value{GDBN} command is @samp{info shared}. =A0 =A0@subsubheading Example -N.A. +@smallexample +(gdb) +-file-list-exec-source-files +^done,shared-libraries=3D[ +@{from=3D"0x72815989",to=3D"0x728162c0",syms-read=3D"1",name=3D"/lib/libfo= o.so"@}, +@{from=3D"0x76ee48c0",to=3D"0x76ee9160",syms-read=3D"1",name=3D"/lib/libba= r.so"@}] +(gdb) +@end smallexample =A0 =A0 +@ignore =A0@subheading The @code{-file-list-symbol-files} Command =A0@findex -file-list-symbol-files =A0 diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c index 310cd5b..eb8b361 100644 --- a/gdb/mi/mi-cmd-file.c +++ b/gdb/mi/mi-cmd-file.c @@ -25,6 +25,9 @@ =A0#include "source.h" =A0#include "objfiles.h" =A0#include "psymtab.h" +#include "solib.h" +#include "solist.h" +#include "xregex.h" =A0 =A0/* Return to the client the absolute path and line number of the=20 =A0=A0=A0 current file being executed.=A0 */ @@ -108,3 +111,67 @@ mi_cmd_file_list_exec_source_files (char *command, cha= r **argv, int argc) =A0 =A0=A0 ui_out_end (uiout, ui_out_type_list); =A0} + +void +mi_cmd_file_list_shared_libraries (char *command, char **argv, int argc) +{ +=A0 struct ui_out *uiout =3D current_uiout; +=A0 const char *pattern; +=A0 struct so_list *so =3D NULL; +=A0 struct gdbarch *gdbarch =3D target_gdbarch (); + +=A0 switch (argc) +=A0=A0=A0 { +=A0=A0=A0 case 0: +=A0=A0=A0=A0=A0 pattern =3D NULL; +=A0=A0=A0=A0=A0 break; +=A0=A0=A0 case 1: +=A0=A0=A0=A0=A0 pattern =3D argv[0]; +=A0=A0=A0=A0=A0 break; +=A0=A0=A0 default: +=A0=A0=A0=A0=A0 error (_("Usage: -file-list-shared-libraries [REGEXP]")); +=A0=A0=A0=A0=A0 break; +=A0=A0=A0 } + +=A0 if (pattern !=3D NULL) +=A0=A0=A0 { +=A0=A0=A0=A0=A0 char *re_err =3D re_comp (pattern); + +=A0=A0=A0=A0=A0 if (re_err !=3D NULL) +=A0=A0=A0=A0=A0=A0 error (_("Invalid regexp: %s"), re_err); +=A0=A0=A0 } + +=A0 update_solib_list (1); + +=A0 /* Print the table header.=A0 */ +=A0 ui_out_begin (uiout, ui_out_type_list, "shared-libraries"); + +=A0 ALL_SO_LIBS (so) +=A0=A0=A0 { +=A0=A0=A0=A0=A0 if (so->so_name[0] =3D=3D '\0') +=A0=A0=A0=A0=A0=A0 continue; +=A0=A0=A0=A0=A0 if (pattern !=3D NULL && !re_exec (so->so_name)) +=A0=A0=A0=A0=A0=A0 continue; + +=A0=A0=A0=A0=A0 ui_out_begin (uiout, ui_out_type_tuple, NULL); + +=A0=A0=A0=A0=A0 if (so->addr_high !=3D 0) +=A0=A0=A0=A0=A0=A0 { +=A0=A0=A0=A0=A0=A0=A0=A0 ui_out_field_core_addr (uiout, "from", gdbarch, s= o->addr_low); +=A0=A0=A0=A0=A0=A0=A0=A0 ui_out_field_core_addr (uiout, "to", gdbarch, so-= >addr_high); +=A0=A0=A0=A0=A0=A0 } +=A0=A0=A0=A0=A0 else +=A0=A0=A0=A0=A0=A0 { +=A0=A0=A0=A0=A0=A0=A0=A0 ui_out_field_skip (uiout, "from"); +=A0=A0=A0=A0=A0=A0=A0=A0 ui_out_field_skip (uiout, "to"); +=A0=A0=A0=A0=A0=A0 } + +=A0=A0=A0=A0=A0 ui_out_field_int (uiout, "syms-read", so->symbols_loaded ?= 1 : 0); + +=A0=A0=A0=A0=A0 ui_out_field_string (uiout, "name", so->so_name); + +=A0=A0=A0=A0=A0 ui_out_end (uiout, ui_out_type_tuple); +=A0=A0=A0 } + +=A0 ui_out_end (uiout, ui_out_type_list); +} diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index 4779832..18bb2a6 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -115,6 +115,8 @@ static struct mi_cmd mi_cmds[] =3D =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_cmd_file_list_exec_s= ource_file), =A0=A0 DEF_MI_CMD_MI ("file-list-exec-source-files", =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_cmd_file_list_exec_s= ource_files), +=A0 DEF_MI_CMD_MI ("file-list-shared-libraries", +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 mi_cmd_file_list_shared_libr= aries), =A0=A0 DEF_MI_CMD_CLI ("file-symbol-file", "symbol-file", 1), =A0=A0 DEF_MI_CMD_MI ("gdb-exit", mi_cmd_gdb_exit), =A0=A0 DEF_MI_CMD_CLI_1 ("gdb-set", "set", 1, diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index 69472a9..79241bb 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -70,6 +70,7 @@ extern mi_cmd_argv_ftype mi_cmd_exec_step; =A0extern mi_cmd_argv_ftype mi_cmd_exec_step_instruction; =A0extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file; =A0extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_files; +extern mi_cmd_argv_ftype mi_cmd_file_list_shared_libraries; =A0extern mi_cmd_argv_ftype mi_cmd_gdb_exit; =A0extern mi_cmd_argv_ftype mi_cmd_inferior_tty_set; =A0extern mi_cmd_argv_ftype mi_cmd_inferior_tty_show; diff --git a/gdb/solib.c b/gdb/solib.c index eefd6fb..fecf667 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -737,21 +737,7 @@ solib_used (const struct so_list *const known) =A0=A0 return 0; =A0} =A0 -/* Synchronize GDB's shared object list with inferior's. - -=A0=A0 Extract the list of currently loaded shared objects from the -=A0=A0 inferior, and compare it with the list of shared objects currently -=A0=A0 in GDB's so_list_head list.=A0 Edit so_list_head to bring it in sync -=A0=A0 with the inferior's new list. - -=A0=A0 If we notice that the inferior has unloaded some shared objects, -=A0=A0 free any symbolic info GDB had read about those shared objects. - -=A0=A0 Don't load symbolic info for any new shared objects; just add them -=A0=A0 to the list, and leave their symbols_loaded flag clear. - -=A0=A0 If FROM_TTY is non-null, feel free to print messages about what -=A0=A0 we're doing.=A0 */ +/* See solib.h.=A0 */ =A0 =A0void =A0update_solib_list (int from_tty) @@ -1096,7 +1082,7 @@ info_sharedlibrary_command (char *pattern, int from_t= ty) =A0 =A0=A0 ui_out_table_body (uiout); =A0 -=A0 for (so =3D so_list_head; so; so =3D so->next) +=A0 ALL_SO_LIBS (so) =A0=A0=A0=A0 { =A0=A0=A0=A0=A0=A0 struct cleanup *lib_cleanup; =A0 diff --git a/gdb/solib.h b/gdb/solib.h index 75490b6..ee621ce 100644 --- a/gdb/solib.h +++ b/gdb/solib.h @@ -73,6 +73,24 @@ extern void no_shared_libraries (char *ignored, int from= _tty); =A0extern void set_solib_ops (struct gdbarch *gdbarch, =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 const struct target_so_ops *new_ops); =A0 +/* Synchronize GDB's shared object list with inferior's. + +=A0=A0 Extract the list of currently loaded shared objects from the +=A0=A0 inferior, and compare it with the list of shared objects currently +=A0=A0 in GDB's so_list_head list.=A0 Edit so_list_head to bring it in sync +=A0=A0 with the inferior's new list. + +=A0=A0 If we notice that the inferior has unloaded some shared objects, +=A0=A0 free any symbolic info GDB had read about those shared objects. + +=A0=A0 Don't load symbolic info for any new shared objects; just add them +=A0=A0 to the list, and leave their symbols_loaded flag clear. + +=A0=A0 If FROM_TTY is non-null, feel free to print messages about what +=A0=A0 we're doing.=A0 */ + +extern void update_solib_list (int from_tty); + =A0/* Return non-zero if NAME is the libpthread shared library.=A0 */ =A0 =A0extern int libpthread_name_p (const char *name); diff --git a/gdb/solist.h b/gdb/solist.h index 1bdfbaf..a46d23a 100644 --- a/gdb/solist.h +++ b/gdb/solist.h @@ -23,6 +23,11 @@ =A0/* For domain_enum domain.=A0 */ =A0#include "symtab.h" =A0 +#define ALL_SO_LIBS(so) \ +=A0=A0=A0 for (so =3D current_program_space->so_list; \ +=A0=A0=A0=A0=A0=A0=A0 so; \ +=A0=A0=A0=A0=A0=A0=A0 so =3D so->next) + =A0/* Forward declaration for target specific link map information.=A0 This =A0=A0=A0 struct is opaque to all but the target specific file.=A0 */ =A0struct lm_info; diff --git a/gdb/testsuite/gdb.mi/mi-solib.exp b/gdb/testsuite/gdb.mi/mi-so= lib.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] !=3D "" =A0 =A0mi_delete_breakpoints =A0mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir =A0mi_gdb_load ${binfile} =A0 =A0mi_load_shlibs $binfile_lib =A0 -mi_gdb_test "777-gdb-set stop-on-solib-events 1" "777\\^done" \ -=A0=A0=A0 "set stop-on-solib-events" +proc test_stop_on_solib_events {} { +=A0=A0=A0 mi_gdb_test "777-gdb-set stop-on-solib-events 1" "777\\^done" \ +=A0=A0=A0=A0=A0=A0 "set stop-on-solib-events" =A0 -# 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 +=A0=A0=A0 # We use "run" rather than "-exec-run" here in order to test tha= t CLI +=A0=A0=A0 # commands still cause the correct MI output to be generated. +=A0=A0=A0 mi_run_with_cli =A0 -# Also test that the CLI solib event note is output. -set test "CLI prints solib event" -gdb_expect { -=A0=A0=A0 -re "~\"Stopped due to shared library event \\(no libraries adde= d or removed\\)\\\\n" { -=A0=A0=A0=A0=A0=A0 pass "$test" -=A0=A0=A0 } -=A0=A0=A0 timeout { -=A0=A0=A0=A0=A0=A0 fail "$test (timeout)" +=A0=A0=A0 # Also test that the CLI solib event note is output. +=A0=A0=A0 set test "CLI prints solib event" +=A0=A0=A0 gdb_expect { +=A0=A0=A0=A0=A0=A0 -re "~\"Stopped due to shared library event \\(no libra= ries added or removed\\)\\\\n" { +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 pass "$test" +=A0=A0=A0=A0=A0=A0 } +=A0=A0=A0=A0=A0=A0 timeout { +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 fail "$test (timeout)" +=A0=A0=A0=A0=A0=A0 } =A0=A0=A0=A0 } + +=A0=A0=A0 mi_expect_stop solib-event .* .* .* .* .* "check for solib event" + +=A0=A0=A0 # Unset solib events to avoid interfering with other tests. +=A0=A0=A0 mi_gdb_test "778-gdb-set stop-on-solib-events 0" "778\\^done" \ +=A0=A0=A0=A0=A0=A0 "unset stop-on-solib-events" +} + +proc test_file_list_shared_libraries {} { +=A0=A0=A0 global libname +=A0=A0=A0 global binfile + +=A0=A0=A0 mi_continue_to main + +=A0=A0=A0 mi_gdb_test "222-file-list-shared-libraries" \ +=A0=A0=A0=A0=A0=A0 "222\\^done,shared-libraries=3D\\\[.*\{from=3D\".*\",to= =3D\".*\",syms-read=3D\"1\",name=3D\".*${libname}.so\"\}.*]" \ +=A0=A0=A0=A0=A0=A0 "Getting a list of shared libraries." =A0} =A0 -mi_expect_stop solib-event .* .* .* .* .* "check for solib event" +test_stop_on_solib_events +test_file_list_shared_libraries +mi_gdb_exit --=20 2.7.4 =20=20=20=20 >From gdb-patches-return-134051-listarch-gdb-patches=sources.redhat.com@sourceware.org Fri Oct 14 21:22:49 2016 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 55377 invoked by alias); 14 Oct 2016 21:22:49 -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 Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 55337 invoked by uid 89); 14 Oct 2016 21:22:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:898, reader X-HELO: gproxy8-pub.mail.unifiedlayer.com Received: from gproxy8-pub.mail.unifiedlayer.com (HELO gproxy8-pub.mail.unifiedlayer.com) (67.222.33.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Fri, 14 Oct 2016 21:22:38 +0000 Received: (qmail 1543 invoked by uid 0); 14 Oct 2016 21:22:37 -0000 Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy8.mail.unifiedlayer.com with SMTP; 14 Oct 2016 21:22:37 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id vZNZ1t00q2f2jeq01ZNcAD; Fri, 14 Oct 2016 15:22:36 -0600 X-Authority-Analysis: v=2.1 cv=IecUBwaa c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=CH0kA5CcgfcA:10 a=20KFwNOVAAAA:8 a=8F6gY-xophSSON0-M9YA:9 a=e_O65bzb51kRm2y5VmPK:22 Received: from 174-16-143-211.hlrn.qwest.net ([174.16.143.211]:35738 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1bv9w1-0006IR-L8; Fri, 14 Oct 2016 15:22:33 -0600 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA v2 06/17] Record minimal symbols directly in reader. References: <1476393012-29987-1-git-send-email-tom@tromey.com> <1476393012-29987-7-git-send-email-tom@tromey.com> Date: Fri, 14 Oct 2016 21:22:00 -0000 In-Reply-To: (Pedro Alves's message of "Thu, 13 Oct 2016 23:33:55 +0100") Message-ID: <87vawulj6w.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1bv9w1-0006IR-L8 X-Source-Sender: 174-16-143-211.hlrn.qwest.net (bapiya) [174.16.143.211]:35738 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2016-10/txt/msg00462.txt.bz2 Content-length: 876 >>>>> "Pedro" == Pedro Alves writes: >> +minimal_symbol_reader::record_full (const char *name, int name_len, >> + int copy_name, Pedro> Can you make this bool while at it? I've added a follow-up patch for this. >> + SECTION - the symbol's section >> + appropriate obj_section for the minimal symbol. This can be NULL. Pedro> Hmm, preexisting, but, this parameter's type is actually int. Pedro> Not sure that comment makes sense as is. I fixed this. >> + OBJFILE - the objfile associated with the minimal symbol. */ Pedro> ENOSUCHPARAMETER. .. and this >> + >> + struct minimal_symbol *record_full (const char *name, >> + int name_len, >> + int copy_name, Pedro> Use "bool" for copy_name ? .. and this and the other related things in the follow-up. Also I've fixed the other callers of record_full. Tom