From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-114.mimecast.com (us-smtp-delivery-114.mimecast.com [170.10.133.114]) by sourceware.org (Postfix) with ESMTPS id E8AA33830FCE for ; Wed, 14 Dec 2022 11:08:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E8AA33830FCE Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=labware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=labware.com Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2045.outbound.protection.outlook.com [104.47.73.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-vNQ-gufCMMearagpWTtNUg-1; Wed, 14 Dec 2022 06:08:13 -0500 X-MC-Unique: vNQ-gufCMMearagpWTtNUg-1 Received: from BN6PR17MB3106.namprd17.prod.outlook.com (2603:10b6:405:7d::31) by SJ0PR17MB4583.namprd17.prod.outlook.com (2603:10b6:a03:370::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.11; Wed, 14 Dec 2022 11:08:08 +0000 Received: from BN6PR17MB3106.namprd17.prod.outlook.com ([fe80::3853:c649:19f1:60cb]) by BN6PR17MB3106.namprd17.prod.outlook.com ([fe80::3853:c649:19f1:60cb%7]) with mapi id 15.20.5880.019; Wed, 14 Dec 2022 11:08:08 +0000 From: Jan Vrany To: gdb-patches@sourceware.org CC: Jan Vrany , tom@tromey.com, luis.machado@arm.com, simark@simark.ca Subject: Re: [PATCH] gdb: fix command lookup in execute_command () commands" Date: Wed, 14 Dec 2022 11:07:47 +0000 Message-ID: <20221214110747.1150349-1-jan.vrany@labware.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <4dc13e01-2fd8-a63e-24f2-a1f7c7650d3b@simark.ca> References: <4dc13e01-2fd8-a63e-24f2-a1f7c7650d3b@simark.ca> X-ClientProxiedBy: LO4P123CA0246.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a7::17) To BN6PR17MB3106.namprd17.prod.outlook.com (2603:10b6:405:7d::31) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR17MB3106:EE_|SJ0PR17MB4583:EE_ X-MS-Office365-Filtering-Correlation-Id: fb1f0ebd-37f4-47ec-0ee5-08daddc37b38 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: +uRXBfiXVvDEe08GGMZuRgjrGozYbGQEHTFPcNfNS8mA7nCf4AO70jS9pqgDVJbgovCfoy5xC43Wxr57gVYdH+AWIZuzovdYEB65STFDZvKF98JH1dNt7plGAWcK4HOWykumgdY6qj9kaYcBCWeP2IRWdfEO82VEHkKVKzZhVmvxUPNN439+DZuOkIo0W0Q1pSfRFP6mwJOtjQ6TiAeetuNzN8sNFh1TM7+1yb2QdVgjoPxM25OUiRS3ncpxFjiA5AZGpdm0UL9TxYyHwC4RZsj4IOYLfsubnMhkMu+f+waF6Z6tJkuOmqGzK1R3fv8onmWhxSC+MdhEbjVEfBSeDmOjCPL9bni8ewBazFMVm1QeytgFzgdN3p6In6ptucKAigwx9VfaNb7aKMY2v9lE2iyZm4Qtr/YZHQzRTL2zKzOpybOmrH9MYbX0UzgpPFKbud3vIpZ6j+us3WkRx41zN+/jC1/uUbawwv3DxZOO1kFzcATRx1OQlQi4oiz2IYIlaLOSxOKq2ifXiZPFhxdZIZhyyEiurEEjIoNsijN3VDFChm1oPerIa/2LMgB7ZGDE1kIS1bysdd7oM5oCHp2SxQjksHJAww1iO18M1+zmAZk/Ah1rWRQZ/wh0F6dG+nwq5dM3BfWqTpo5schRJhUpVSEAmaNMxaBfYwcfFlAKvn36w1bfkboR1mN1Biq4jBZF9WJn0yBPDy6kOZQI2KSV1i8Jym9TK8jM2DpBk05BsKg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR17MB3106.namprd17.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(39850400004)(346002)(366004)(396003)(451199015)(36756003)(38100700002)(2616005)(83380400001)(86362001)(316002)(6916009)(6666004)(478600001)(6486002)(2906002)(44832011)(30864003)(8676002)(4326008)(66556008)(66946007)(66476007)(4001150100001)(8936002)(5660300002)(41300700001)(186003)(6512007)(53546011)(26005)(6506007)(1076003)(84970400001)(21314003);DIR:OUT;SFP:1101 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vEs15LlaMFlPxj/Rcw84AJu8u1qdg5MHTJzx0Velkb2wb+AiEyult6iJSThS?= =?us-ascii?Q?QzIR+hnA28rpVHbmat5mFVX17XPTD8cJqHgkjQtx5hTIgjHFgGqCQcib59MB?= =?us-ascii?Q?zM+uRm7Va7kmGtu1m83k9FX8r8gvglu5SukJ1SONwl1LLFCsiWbYr4E5Qyqv?= =?us-ascii?Q?wchoTUoj02vmhINy3c4E2Ce00ey3UqvJLEAOKN6lThha/gUNLaxDXw9dVgUl?= =?us-ascii?Q?KYYdTdkvZs8nhwouOlRgPB41exlBWMeADiHYTXURG/2OB6A1gUG77OoT++Wv?= =?us-ascii?Q?j3Es++uITNokOOzif4QHXsbrQeXlHiM7IB4ZtjzWgQw0wqkgJga4ITPDJlnd?= =?us-ascii?Q?ZHQ3ta8GPhDddnQJQ/qsilFqKrGRmObbIDOBoNOThOrZrSdIXyfMgHgDeYpE?= =?us-ascii?Q?UpBU6FOZkPgtTiYbHQGMfoSajSrwZhxB8E5CPGMbxXy3+m+mA7ywh/TpKTl4?= =?us-ascii?Q?TKdI9WERk9TH6QgP8bNXKkv+Sr/aAwgROwB6BPaEKghAuWfhWZAsbTZYHFy3?= =?us-ascii?Q?FK6x3O43dt3+S+H0wJ5G8CsvbhdvVTXOYnyly6VN5sGG37CpKUjECF2YseyF?= =?us-ascii?Q?wQcDyv3QRv+jwDY0GGK6uIcd49NyWmKHYMsUcgFAsuv4xZJLPfGyhrwr5wvl?= =?us-ascii?Q?gws9XhE7gjr/Iu5bEck4JbXmjFm/EI/6qBMdtBMLYKgH0ooOkhKRE3n88Ml8?= =?us-ascii?Q?OYQn5RyRKNTox+WqQnoixlWyDyHODtYNPm8M/CZl5UMmg+Jm8ostsyQq1rES?= =?us-ascii?Q?K47HRAm+Ej+AvIiMmcMiro3exqlcSTHuYZB6RIZwrjaPeeUysShn7D8DSWKI?= =?us-ascii?Q?FhZw0Rnp6RRsxRVqJN9YnZ+qZ5gU7Lqiv1WE2xQVFV+CTzwbvjxpDpLa0orF?= =?us-ascii?Q?HCqeQd+uQuMA1AksyrPFpM9UompDGIg2u+vJR5qh5NeCaAp13dlCdDe+SYxJ?= =?us-ascii?Q?D4Aba3WkAEjxcBhXHu1e7nb09gQoIIsRCE6Bl/4WKekAjoW7pntrrS/5+KzF?= =?us-ascii?Q?qgwdrYOUbdiiNArCoiCcL/lST7aV12uF1u4P7sahsLH8Q1hAlfADDlLqrtb0?= =?us-ascii?Q?BewCF9dM+2qoLZH7mZjlTYeo+VHjodvg1+h4tmdC6blZGTLvoq9eCzfTp0pV?= =?us-ascii?Q?9f0b84YboWUu9+hRnU/O1AAye8Hm//GrfIvuFCNXuIyOHWxCFqKUmNjqzAq1?= =?us-ascii?Q?t1+SYBjfkS5lawt11l6oxR5FXyBsnXjgaSTajZQLISdGAWmGwrjXCKOB9s7y?= =?us-ascii?Q?rZkxd5d0kkQIQccJ0vhGfFGOMOrjhyKbCy3JHGxq9Jaw+GW8ewKNGcmJ4TkX?= =?us-ascii?Q?3JWQ+z2CaoFmSPHWhLYHeRz662mbh1oDUophca+7KCs8Ind/7Xg5VJiuzxvD?= =?us-ascii?Q?Yy1bAJB5/RVeiU6jqBSYqwv81M4ba58ofuSH0GqqEDvRTUzxDlUe28DnZK9p?= =?us-ascii?Q?lmGY48uk2v6RTvzawYWluq5P4mygPhw7eYMwJ1Zl9uWhcoR9wDo/ZkJb5mCC?= =?us-ascii?Q?MzZOP1XRz/IX5pVhrvtV0fecLM9k9kz1JsRPR+xrRN503D0A0Z4Lo2qObCQv?= =?us-ascii?Q?u7hV/CENL1aG1aeUEid1/4c591X+veXFt+OKO4mH?= X-OriginatorOrg: labware.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb1f0ebd-37f4-47ec-0ee5-08daddc37b38 X-MS-Exchange-CrossTenant-AuthSource: BN6PR17MB3106.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 11:08:08.4166 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b5db0322-1aa0-4c0a-859c-ad0f96966f4c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +tz3AmHPuDE69fG+oNj++5uZQM/6kOrmcPXC6dywuknM/fqQz/SEt7PEgPFJG33Q42bim/gpMmfQ6+XSRyZbEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR17MB4583 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: labware.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,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: On Tue, 2022-12-13 at 14:29 -0500, Simon Marchi wrote: > On 12/13/22 13:48, Jan Vran=C3=BD wrote: > > On Tue, 2022-12-13 at 08:05 -0700, Tom Tromey wrote: > > > > > > > > "Jan" =3D=3D Jan Vrany via Gdb-patches writes: > > >=20 > > > Jan> The below patch should fix this case - with it on my system > > > Jan> gdb.base/define.exp passes. > > >=20 > > > Jan> Alternatively I may just revert the commit until better solution > > > Jan> is found. > > >=20 > > > This patch looks ok to me, but could you say whether you ran all the > > > tests or just define.exp? Given the history I think a full regressio= n > > > test is warranted. > >=20 > > I did use try-build which succeeded (build #28) but it seems to me it > > runs only very limited number of tests.=20 > >=20 > > I did run all of gdb.base and did not spot any new regression compared > > to master with my (previous, broken) patch reverted. I did not run more > > than gdb.base mainly because just gdb.base takes about an hour on my ma= chine. > > Also I get weird intermittent failures when running testsuite.=20 > >=20 > > Jan >=20 > Here are the unexpected failures I saw: >=20 > UNRESOLVED: gdb.base/bp-cmds-execution-x-script.exp: run to end > UNRESOLVED: gdb.base/bp-cmds-run-with-ex.exp: execute bp commands > UNRESOLVED: gdb.base/bp-cmds-sourced-script.exp: source the script > UNRESOLVED: gdb.base/bp-cmds-sourced-script.exp: continue until exit > UNRESOLVED: gdb.base/commands.exp: deprecated_command_test: source file c= ontaining xxx_yyy command and its alias > UNRESOLVED: gdb.base/commands.exp: deprecated_command_test: deprecated al= ias with prefix give a warning > UNRESOLVED: gdb.base/commands.exp: deprecated_command_alias_help_test: de= fine real_command: input 1: define real_command > UNRESOLVED: gdb.base/commands.exp: deprecated_command_alias_help_test: al= ias alias_command =3D real_command > UNRESOLVED: gdb.base/commands.exp: deprecated_command_alias_help_test: al= ias alias_with_args_command =3D real_command 123 > UNRESOLVED: gdb.base/commands.exp: deprecated_command_alias_help_test: he= lp real_command, before > UNRESOLVED: gdb.base/commands.exp: deprecated_command_alias_help_test: ma= intenance deprecate alias_command > UNRESOLVED: gdb.base/commands.exp: deprecated_command_alias_help_test: ma= intenance deprecate alias_with_args_command > UNRESOLVED: gdb.base/commands.exp: deprecated_command_alias_help_test: he= lp real_command, after > UNRESOLVED: gdb.base/commands.exp: bp_deleted_in_command_test: delete all= breakpoints in delete_breakpoints > UNRESOLVED: gdb.base/commands.exp: bp_deleted_in_command_test: break fact= orial > UNRESOLVED: gdb.base/commands.exp: bp_deleted_in_command_test: begin comm= ands > UNRESOLVED: gdb.base/commands.exp: bp_deleted_in_command_test: add silent= command > UNRESOLVED: gdb.base/commands.exp: bp_deleted_in_command_test: add clear = command > UNRESOLVED: gdb.base/commands.exp: bp_deleted_in_command_test: add printf= command > UNRESOLVED: gdb.base/commands.exp: bp_deleted_in_command_test: add cont c= ommand > UNRESOLVED: gdb.base/commands.exp: bp_deleted_in_command_test: end comman= ds > UNRESOLVED: gdb.base/commands.exp: temporary_breakpoint_commands: delete = all breakpoints in delete_breakpoints > UNRESOLVED: gdb.base/commands.exp: temporary_breakpoint_commands: breakpo= int > UNRESOLVED: gdb.base/commands.exp: temporary_breakpoint_commands: begin c= ommands in bp_deleted_in_command_test > UNRESOLVED: gdb.base/commands.exp: temporary_breakpoint_commands: add sil= ent tbreak command > UNRESOLVED: gdb.base/commands.exp: temporary_breakpoint_commands: add pri= ntf tbreak command > UNRESOLVED: gdb.base/commands.exp: temporary_breakpoint_commands: add con= t tbreak command > UNRESOLVED: gdb.base/commands.exp: temporary_breakpoint_commands: end tbr= eak commands > UNRESOLVED: gdb.base/commands.exp: stray_arg0_test: #1 > UNRESOLVED: gdb.base/commands.exp: stray_arg0_test: #2 > UNRESOLVED: gdb.base/commands.exp: stray_arg0_test: #3 > UNRESOLVED: gdb.base/commands.exp: stray_arg0_test: #4 > UNRESOLVED: gdb.base/commands.exp: source_file_with_indented_comment: sou= rce file > UNRESOLVED: gdb.base/commands.exp: recursive_source_test: source file > UNRESOLVED: gdb.base/commands.exp: if_commands_test: set $tem > UNRESOLVED: gdb.base/commands.exp: if_commands_test: if $tem =3D=3D 2 - i= f_commands_test 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: break -q main - if_c= ommands_test 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: else - if_commands_t= est 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: break factorial - if= _commands_test 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: commands - if_comman= ds_test 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: silent - if_commands= _test 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: set $tem =3D 3 - if_= commands_test 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: continue - if_comman= ds_test 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: first end - if_comma= nds_test 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: second end - if_comm= ands_test 1 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: if $tem =3D=3D 1 - i= f_commands_test 2 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: break -q main - if_c= ommands_test 2 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: else - if_commands_t= est 2 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: break factorial - if= _commands_test 2 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: commands - if_comman= ds_test 2 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: silent - if_commands= _test 2 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: set $tem =3D 3 - if_= commands_test 2 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: continue - if_comman= ds_test 2 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: first end - if_comma= nds_test 2 > UNRESOLVED: gdb.base/commands.exp: if_commands_test: second end - if_comm= ands_test 2 > UNRESOLVED: gdb.base/commands.exp: error_clears_commands_left: hook-stop = 1 > UNRESOLVED: gdb.base/commands.exp: error_clears_commands_left: hook-stop = 1a > UNRESOLVED: gdb.base/commands.exp: error_clears_commands_left: hook-stop = 1b > UNRESOLVED: gdb.base/commands.exp: error_clears_commands_left: delete all= breakpoints in delete_breakpoints > UNRESOLVED: gdb.base/dprintf-execution-x-script.exp: load and run script = with -x > UNRESOLVED: gdb.base/dprintf-execution-x-script.exp: load and run script = using source command > UNRESOLVED: gdb.base/dprintf-execution-x-script.exp: run again > UNRESOLVED: gdb.base/save-bp.exp: source bps > UNRESOLVED: gdb.base/save-bp.exp: info break (pattern 1) (timeout) > UNRESOLVED: gdb.base/trace-commands.exp: source -v (pattern 4) (timeout) > UNRESOLVED: gdb.base/trace-commands.exp: set trace-commands > UNRESOLVED: gdb.base/trace-commands.exp: show trace-commands says on > UNRESOLVED: gdb.base/trace-commands.exp: simple trace-commands test > UNRESOLVED: gdb.base/trace-commands.exp: nested trace-commands test (patt= ern 1) (timeout) > UNRESOLVED: gdb.base/trace-commands.exp: define user command (pattern 1) = (timeout) > UNRESOLVED: gdb.base/trace-commands.exp: nested trace-commands test with = source (pattern 1) (timeout) > UNRESOLVED: gdb.base/trace-commands.exp: depth resets on error part 1 (pa= ttern 1) (timeout) > UNRESOLVED: gdb.base/trace-commands.exp: depth resets on error part 2 > UNRESOLVED: gdb.trace/save-trace.exp: relative: read back saved tracepoin= ts > UNRESOLVED: gdb.trace/save-trace.exp: relative: verify recovered tracepoi= nts > DUPLICATE: gdb.trace/save-trace.exp: relative: verify recovered tracepoin= ts > UNRESOLVED: gdb.trace/save-trace.exp: relative: verify default-collect > UNRESOLVED: gdb.trace/save-trace.exp: absolute: save tracepoint definitio= ns > UNRESOLVED: gdb.trace/save-trace.exp: absolute: clear default-collect > UNRESOLVED: gdb.trace/save-trace.exp: absolute: delete tracepoints > UNRESOLVED: gdb.trace/save-trace.exp: absolute: read back saved tracepoin= ts > UNRESOLVED: gdb.trace/save-trace.exp: absolute: verify recovered tracepoi= nts > DUPLICATE: gdb.trace/save-trace.exp: absolute: verify recovered tracepoin= ts > UNRESOLVED: gdb.trace/save-trace.exp: absolute: verify default-collect > UNRESOLVED: gdb.trace/save-trace.exp: verify help save tracepoints > Hmm. I do not see these failures. When I run tests with second patch applie= d atop of dc3fb44540 ("gdb/testsuite: avoid creating temp file in gdb/testsui= te/ directory") using command: make -C gdb check RUNTESTFLAGS=3D'TRANSCRIPT=3Dy gdb.base/*.exp' Then I do not see them: $ grep UNRESOLVED gdb.sum.with-second-patch UNRESOLVED: gdb.base/gdb-sigterm.exp: 50 SIGTERM passes $ grep DUPLICATE gdb.sum.with-second-patch $ When I run gdb.base tests with on commit dc3fb44540 but with first patch (b5661ff24) `git revert`ed, the only difference in tests I see is $ diff -u gdb.sum.with-second-patch gdb.sum.with-first-patch-reverted --- gdb.sum.with-second-patch=092022-12-14 09:14:46.790229064 +0000 +++ gdb.sum.with-first-patch-reverted=092022-12-14 09:40:53.460377645 +0000 @@ -1,4 +1,4 @@ -Test run by jv on Wed Dec 14 08:19:53 2022 +Test run by jv on Wed Dec 14 09:16:33 2022 Native configuration is x86_64-pc-linux-gnu =20 =09=09=3D=3D=3D gdb tests =3D=3D=3D @@ -1931,9 +1931,9 @@ PASS: gdb.base/step-over-syscall.exp: clone: displaced=3Don: set displaced= -stepping on PASS: gdb.base/step-over-syscall.exp: clone: displaced=3Don: single step o= ver clone PASS: gdb.base/step-over-syscall.exp: clone: displaced=3Don: check_pc_afte= r_cross_syscall: get hexadecimal valueof "$pc" -PASS: gdb.base/step-over-syscall.exp: clone: displaced=3Don: check_pc_afte= r_cross_syscall: single step over clone final pc +KFAIL: gdb.base/step-over-syscall.exp: clone: displaced=3Don: check_pc_aft= er_cross_syscall: single step over clone final pc (PRMS: gdb/19675) PASS: gdb.base/step-over-syscall.exp: clone: displaced=3Don: break marker -KFAIL: gdb.base/step-over-syscall.exp: clone: displaced=3Don: continue to = marker (clone) (PRMS: gdb/19675) +KPASS: gdb.base/step-over-syscall.exp: clone: displaced=3Don: continue to = marker (clone) (PRMS gdb/19675) Running /home/jv/Projects/gdb/users_jv_patches/gdb/testsuite/gdb.base/sigi= nfo-infcall.exp ... PASS: gdb.base/siginfo-infcall.exp: continue to SIGUSR1 PASS: gdb.base/siginfo-infcall.exp: p callme () @@ -58069,9 +58069,10 @@ =20 =09=09=3D=3D=3D gdb Summary =3D=3D=3D =20 -# of expected passes=09=0957356 +# of expected passes=09=0957355 # of unexpected failures=096 # of expected failures=09=0933 +# of unknown successes=09=091 # of known failures=09=0932 # of unresolved testcases=091 # of untested testcases=09=096 gdb.base/step-over-syscall.exp seems to be one of the shaky tests on my mac= hine. It does not seem to define any custom commands nor does it use post-hooks s= o I'd think it is unrelated (but I must admit I do not understand exactly wha= t it does and which parts of the system it excercises). So, since the original patch (which I pushed little too hastily) clearly br= eak things and a fix causes problems elsewhere which I cannot reproduce yet, I suggest= to revert b5661ff2 "gdb: fix possible use-after-free when executing commands" until I find a better solution (patch below) What do you think? -- >8 -- Subject: [PATCH] Revert "gdb: fix possible use-after-free when executing commands" Commit b5661ff2 causes gdb.base/define.exp. Using lookup_cmd () instead lookup_cmd_exact () fixed this test but causes failures elsewhere. This reverts commit b5661ff2 until a better solution is found. --- gdb/top.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/gdb/top.c b/gdb/top.c index 742997808bd..e9794184f07 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -655,11 +655,6 @@ execute_command (const char *p, int from_tty) =09 } =09} =20 - /* Remember name of the command. This is needed later when -=09 executing command post-hooks to handle the case when command -=09 is redefined or removed during it's execution. See below. */ - std::string c_name (c->name); - /* If this command has been pre-hooked, run the hook first. */ execute_cmd_pre_hook (c); =20 @@ -698,13 +693,8 @@ execute_command (const char *p, int from_tty) =20 maybe_wait_sync_command_done (was_sync); =20 - /* If this command has been post-hooked, run the hook last. -=09 We need to lookup the command again since during its execution, -=09 a command may redefine itself. In this case, C pointer -=09 becomes invalid so we need to look it up again. */ - c =3D lookup_cmd_exact (c_name.c_str (), cmdlist); - if (c !=3D nullptr) -=09execute_cmd_post_hook (c); + /* If this command has been post-hooked, run the hook last. */ + execute_cmd_post_hook (c); =20 if (repeat_arguments !=3D NULL && cmd_start =3D=3D saved_command_lin= e) =09{ --=20 2.35.1