From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70052.outbound.protection.outlook.com [40.107.7.52]) by sourceware.org (Postfix) with ESMTPS id BE5603858C20 for ; Tue, 22 Nov 2022 07:27:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BE5603858C20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WHQTbdtmnJSdjaRDOvilgOXaYeBMKXjEowxdgXep0jA=; b=QHQtBk1/YaJd++ph4qgb1H/IHiTb4WhjvYeIAp5lvEY0jc/2NkhhofjExEoWUzmtvTYHwF2lGMjP3V86RI/wUlRu2ebdRaOtWL5c3w0BfvQQPfCAK/CDU6qcHnm/jQpI3QRHfMZsIiwk88p7CPRYEnqBurFm95/Zaj3eVJCPcds= Received: from AS8PR04CA0176.eurprd04.prod.outlook.com (2603:10a6:20b:331::31) by PAXPR08MB6334.eurprd08.prod.outlook.com (2603:10a6:102:dc::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Tue, 22 Nov 2022 07:27:20 +0000 Received: from AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:331:cafe::ca) by AS8PR04CA0176.outlook.office365.com (2603:10a6:20b:331::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.11 via Frontend Transport; Tue, 22 Nov 2022 07:27:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT065.mail.protection.outlook.com (100.127.140.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.8 via Frontend Transport; Tue, 22 Nov 2022 07:27:19 +0000 Received: ("Tessian outbound 6c699027a257:v130"); Tue, 22 Nov 2022 07:27:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5e0ebfe31e1a0197 X-CR-MTA-TID: 64aa7808 Received: from 04c888624a99.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 28634405-A720-4629-B058-DD43676953CA.1; Tue, 22 Nov 2022 07:27:13 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 04c888624a99.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 22 Nov 2022 07:27:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XM+iIlqNWNRG9fktnN/sQA/FgZ8v3sCF4sk5RBIwxP8PtH6sHRrtKnnplbmcBbuHH01zaHcCy2yzo9I5dIeXR9tG/g9gMXYNQEg664RnUZ1gHAa2QUkfKco6TM/6tfAd0eANy+yCl0YtpOapqlAnk4Ljz70IkH4M2uFlyuukvsOfYOM4zvN0mPDvn41eoSyDrEc0/zkFVofXZsUJ44/pxACe04MyJ5VMy/aRPbhDRDfuxMSBOD18PZ8fXJtVCofomee7funtQne9oPlPU9/O11xPjirRa325ouV0E02+9W8blLxcwxtJ65qKteUZh9kshIx7F/KwUlqWFsBG3t4D5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WHQTbdtmnJSdjaRDOvilgOXaYeBMKXjEowxdgXep0jA=; b=S+rRVjrUEup6yyvrfPOkWCVKMgyFz1/WZTqi1+e9N5kTP8Ovqbg9UrAfAg1SgeEgNidA1XDH9Lp2KmCwvo/CQTpVZI7SPApAuoGiG3dC7mmRrN2nJ0x8ytbYYrGOHKWVjDwd9E/TF7APxnbOdlzB6uWBtaDcfMKrizIJlU7+WlyXKsOJLOVPLBKoKf6ESD5WC78VOcuF3Eqb8Y7+0RfuvHvsFMsz21D4X6KgvPMiSbx8gs7UM97KCW0yh7SjtIutMD37R4t8AzK+Rnf6qTw15MgxGJ8SERA+1uFJy9UZ5b1RSjcLhkoVxapA4Hu34Rk3z+9G2E1Li98VNrEHUhjNlA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WHQTbdtmnJSdjaRDOvilgOXaYeBMKXjEowxdgXep0jA=; b=QHQtBk1/YaJd++ph4qgb1H/IHiTb4WhjvYeIAp5lvEY0jc/2NkhhofjExEoWUzmtvTYHwF2lGMjP3V86RI/wUlRu2ebdRaOtWL5c3w0BfvQQPfCAK/CDU6qcHnm/jQpI3QRHfMZsIiwk88p7CPRYEnqBurFm95/Zaj3eVJCPcds= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by GV2PR08MB8487.eurprd08.prod.outlook.com (2603:10a6:150:b4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Tue, 22 Nov 2022 07:27:08 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c470:cc90:a9ad:6dd1]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c470:cc90:a9ad:6dd1%4]) with mapi id 15.20.5857.017; Tue, 22 Nov 2022 07:27:08 +0000 Message-ID: <0cbcd0ed-9702-2c8e-f356-5b68e24dbb0d@arm.com> Date: Tue, 22 Nov 2022 07:27:05 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2] gdb: Modify until_break_command to act correctly on SIGTRAMP_FRAME Content-Language: en-US To: Tomas Vanek , gdb-patches@sourceware.org References: <1666353538-15846-1-git-send-email-vanekt@fbl.cz> <8c72008e-6151-846d-77dd-7da642b1489f@arm.com> <38d21d64-b116-be98-c085-084996f97140@fbl.cz> From: Luis Machado In-Reply-To: <38d21d64-b116-be98-c085-084996f97140@fbl.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0096.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2bc::14) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|GV2PR08MB8487:EE_|AM7EUR03FT065:EE_|PAXPR08MB6334:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a80c57d-83bf-49cf-da70-08dacc5afd9f x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 2jyQhVcJUPvKiyUnLUd9I7NUjaayzW55IM1CsPS+Ej2RHhdyASIZdr+DovCLee98JXXNGQiriqA16g78kdTYngPXKkKYdMc/WM+oSDjH2DDyQiExgD9PU5otkv1m6z680drOFy3gJXnXGqw84DlJVzMhO/Me//W0vdiWowBEnh8tJhXJi/7b0R5PKOZMD0YPEXI3EA1UfcoJUswu7sf114zSFF2ecw7riuiCc1TVehUfrjYwljxioi8FbMukFjLeE66gxF1EGcF+sFOTw0oTxe030V8x7x1Sv605ixfqk3fgY7jUWluAbZcS4zVuwJkVBLKtMk+N/GcBgdhNDfczp4XWZFMMwCOzA/enCzy8O8UmLbZzFQVbFh4a7Q1ZGnQpVBchI4cyx+M4LwnFGdIYNGkNYPE5cy7IAvC8nuE9S+/Z4t4bGCrunyJ0ZDJtxuLcSFw5pK3gqjp/CSd2H9OWMqS1wKPnlJV7IyufnOWlHu4agVe0Az42pBqJmiFy83I5ctJPEPZuhBS6M+JtBNihSxGbxqt0jeqhqMcz1vvWGoP7D3o9nAs617KF8sF0jh2w15y1RIGW+aFPhUXwvwoLjqmgnnvpf1H7RISsKaL/GHgtruvU9sMdQ+4RFBW8VnEq/gthsenRghEqjzrAlO4DXfxMRBlmLgAXIHaT94Jq/+wGgEYl2xXDS8R38+M9FJ5YNsUf3mVpGYV51+OV4GCcH5Tqj9cQxEOnXBshA9M1jfpUsPklFHOJAwgzZaCqXRbl X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(39860400002)(366004)(376002)(396003)(451199015)(31696002)(86362001)(36756003)(2616005)(53546011)(41300700001)(66946007)(66556008)(186003)(66476007)(6486002)(5660300002)(8936002)(8676002)(6666004)(966005)(26005)(478600001)(6512007)(44832011)(316002)(6506007)(38100700002)(2906002)(31686004)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8487 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 82243661-a57f-43e8-f832-08dacc5af631 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y7dB1l5zwwWgthHxuuLd73zu3y1KmhDPx588K/97/WGs5KM24yPtGj4RyWFDC5Jnwgw33Hfs+4rD71A+KY0TFWiobWVrJTJMET74N2KlyfO4SrFcDhD5z/c9SZsG5WcJERn5wP4U8sDPEmpmOW1+U9XikfDu5SWH90PGDFGwIFYmC+CYMd1bCCkVFSJ7U2tztS/IkRuVE863E6SlVp9WfDbOpb2NTCTIHNuYA1vAJGwMsy1zeUUNydLMExyjb02qLxxxJDvSIvzw3YSE87wPCWLcApDMvqSO4+ZySXKNLseRQ4EQ+HProGLiguRil3ooV4772RQJ0pCIIDwd2jsBzJW9G9VdDAd083O4dbKIPwXY2DP3j5Dp6E9WkXKmE2/29UojlwbSLOUHW26gKXNRDac6asntvZUmBULt6R2rsB4cJXgwT6uU24gECfrbMO2DCmUQFeFLjUIEPElpJlbEnxCxb5UOyza+4qd4OFPB2GFauFkZK06oaBJc2p58TCmfe9pk2Km5GWd5emK/x+E8N0oQL2FKaAzqPz04o0QNzyA8cvoAqh/jF+tT75YDIrzpWkHROPHJ9VRRRYYti+InT1KrZCNbS/ICY/aKe2OKCsb4nXFVc74rjgRN/rPuaPG86cFlKisp3OdhkrkfwJ6sfPy0539PdXs8xKueCrob+HbZ74ocXOpbJf9Bb8FEexJAaQAOU9IOyhygsgVDlDFgbyhWqPPeqPtENqpj3J8NFhB1jVx9pdbJ9fPXVKsRBD9I+AVBJVgFGMaL3WI4vupbhA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199015)(40470700004)(46966006)(36840700001)(6486002)(26005)(2906002)(356005)(81166007)(6506007)(82740400003)(6666004)(86362001)(36756003)(31696002)(83380400001)(478600001)(53546011)(6512007)(40460700003)(36860700001)(2616005)(47076005)(336012)(82310400005)(186003)(8936002)(44832011)(41300700001)(966005)(31686004)(40480700001)(8676002)(70586007)(5660300002)(70206006)(316002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2022 07:27:19.9643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a80c57d-83bf-49cf-da70-08dacc5afd9f X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6334 X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY 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: Hi Tomas, On 11/22/22 06:48, Tomas Vanek wrote: > On 27/10/2022 19:46, Tomas Vanek wrote: >> Hi Luis, >> >> On 27/10/2022 12:31, Luis Machado wrote: >>> Hi Tomas, >>> >>> On 10/21/22 12:58, Tomas Vanek wrote: >>>> This patch partially depends on >>>> gdb/arm: Terminate frame unwinding in M-profile lockup state >>>> (without it lockup state is unwound as if it were a normal >>>> stack frame). >>>> >>>> The commands 'advance' and 'until' try to set a breakpoint >>>> on the bogus return address derived from Arm M-profile magic >>>> address (actually EXC_RETURN or a PC value indicating lockup). >>>> >>>> The offending breakpoint should be set at the return address in >>>> the caller. The magic value 0xffffffff in LR indicates >>>> there is no caller (return to this address would lock up the CPU). >>>> >>>> Similar behaviour of 'advance' and 'until' is observed in >>>> an exception handler routine. In this case LR contains e.g. >>>> 0xfffffff1 (EXC_RETURN) and GDB tries to set a breakpoint at >>>> 0xfffffff0. It should use a return value stacked by the exception >>>> instead. >>>> >>>> Testbench setup: >>>> STM32G474, a Cortex-M4 device. Any Cortex-M device can be used. >>>> A test application (an ordinary blink) with a standard startup >>>> is loaded to the device flash. >>>> >>>> Steps to reproduce the problem: >>>> >>>> start GDB server >>>>   $ openocd -f interface/cmsis-dap.cfg -f target/stm32g4x.cfg >>>> >>>> start GDB in second terminal >>>>   $ arm-none-eabi-gdb blink.elf >>>> >>>>   (gdb) target extended-remote localhost:3333 >>>> >>>> Reset the device and halt it: >>>>   (gdb) monitor reset halt >>>>   target halted due to debug-request, current mode: Thread >>>>   xPSR: 0x01000000 pc: 0x08000e14 msp: 0x20020000 >>>> >>>> Step by one instruction to re-read GDB register cache: >>>>   (gdb) stepi >>>> >>>> Check registers, LR should be 0xffffffff after reset: >>>>   (gdb) info registers >>>>   ... >>>>   sp             0x20020000          0x20020000 >>>>   lr             0xffffffff          -1 >>>>   pc             0x8000e16           0x8000e16 >>>>   xPSR           0x1000000           16777216 >>>>   ... >>>> >>>>   (gdb) set debug remote >>>> >>>> Issue 'advance' command: >>>>   (gdb) advance main >>>>   [remote] Sending packet: $mfffffffe,2#fa >>>>   [remote] Packet received: 0000 >>>>   [remote] Sending packet: $mfffffffe,2#fa >>>>   [remote] Packet received: 0000 >>>>   [remote] Sending packet: $m8000526,2#30 >>>>   [remote] Packet received: 2046 >>>>   [remote] Sending packet: $Z1,8000526,2#7a >>>>   [remote] Packet received: OK >>>>   [remote] packet_ok: Packet Z1 (hardware-breakpoint) is supported >>>>   [remote] Sending packet: $Z0,fffffffe,2#43 >>>>   [remote] Packet received: E0E >>>>   [remote] packet_ok: Packet Z0 (software-breakpoint) is supported >>>>   Warning: >>>>   Cannot insert breakpoint 0. >>>>   Cannot access memory at address 0xfffffffe >>>> >>>>   Command aborted. >>>>   (gdb) >>>> >>>> Relevant messages from OpenOCD: >>>>   Error: Failed to read memory at 0xfffff000 >>>>   Error: can't add breakpoint: unknown reason >>>> >>>> This patch adds skipping over frames that are not suitable for >>>> guarding with a breakpoint inspired by 'finish' command. >>>> If no suitable frame is found, a momentary breakpoint is not set. >>>> >>>> v2: Comment fixes, bug reference. >>>> >>>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28683 >>>> Signed-off-by: Tomas Vanek >>>> --- >>>>   gdb/breakpoint.c | 22 +++++++++++++++++----- >>>>   1 file changed, 17 insertions(+), 5 deletions(-) >>>> >>>> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c >>>> index f6591d4..bb85342 100644 >>>> --- a/gdb/breakpoint.c >>>> +++ b/gdb/breakpoint.c >>>> @@ -10467,6 +10467,7 @@ enum async_reply_reason >>>>   until_break_command (const char *arg, int from_tty, int anywhere) >>>>   { >>>>     frame_info_ptr frame; >>>> +  frame_info_ptr caller_frame; >>>>     struct gdbarch *frame_gdbarch; >>>>     struct frame_id stack_frame_id; >>>>     struct frame_id caller_frame_id; >>>> @@ -10505,7 +10506,17 @@ enum async_reply_reason >>>>     frame = get_selected_frame (NULL); >>>>     frame_gdbarch = get_frame_arch (frame); >>>>     stack_frame_id = get_stack_frame_id (frame); >>>> -  caller_frame_id = frame_unwind_caller_id (frame); >>>> + >>>> +  caller_frame = get_prev_frame_always (frame); >>>> + >>>> +  while (caller_frame) >>>> +    { >>>> +      if (get_frame_type (caller_frame) != TAILCALL_FRAME >>>> +      && gdbarch_code_of_frame_writable (get_frame_arch (caller_frame), caller_frame)) >>>> +    break; >>>> + >>>> +      caller_frame = get_prev_frame_always (caller_frame); >>>> +    } >>>>       /* Keep within the current frame, or in frames called by the current >>>>        one.  */ >>>> @@ -10514,14 +10525,15 @@ enum async_reply_reason >>>>       gdb::optional lj_deleter; >>>>   -  if (frame_id_p (caller_frame_id)) >>>> +  if (caller_frame) >>>>       { >>>>         struct symtab_and_line sal2; >>>>         struct gdbarch *caller_gdbarch; >>>>   -      sal2 = find_pc_line (frame_unwind_caller_pc (frame), 0); >>>> -      sal2.pc = frame_unwind_caller_pc (frame); >>>> -      caller_gdbarch = frame_unwind_caller_arch (frame); >>>> +      sal2 = find_pc_line (get_frame_pc (caller_frame), 0); >>>> +      sal2.pc = get_frame_pc (caller_frame); >>>> +      caller_gdbarch = get_frame_arch (caller_frame); >>>> +      caller_frame_id = get_frame_id (caller_frame); >>>>           breakpoint_up caller_breakpoint >>>>       = set_momentary_breakpoint (caller_gdbarch, sal2, >>> >>> My understanding is that these changes are meant to prevent both commands (until/advance) from >>> attempting to place a breakpoint in a caller that doesn't really exist, right? >>> >> Yes. >> >>> The finish command, as you mentioned, seems to have a similar treatment in "skip_finish_frames". >>> >>> Would it be possible to factor out that code into a common function that we can call to determine >>> if we have a valid caller whose PC we can breakpoint? >> >> Of course it was also my original idea. >> >> Unfortunately skip_finish_frames() uses skip_tailcall_frames() and skip_unwritable_frames() >> which both call get_prev_frame(). get_prev_frame() stops if the current frame is main() or startup. >> This is probably sufficient for the 'finish' command (until the user requests to 'finish' the main() function: >> 'finish' refuses to do so with message "finish not meaningful in the outermost frame"). >> >> 'advance' places one breakpoint according to the user request. >> The second one is set as a safety measure for the case the first one is not reached. >> It is quite common to use 'advance' in the main() function and even to execute the startup code >> and stop at the main() begin. IMO gdb should treat main() as any other function and place the safety >> breakpoint at its return if possible. >> >> That's why I use get_prev_frame_always() instead of get_prev_frame(). >> And this is also the reason why there is no simple and elegant way to factor out a common function for >> both 'advance' and 'finish'. >> >> Tomas > > Luis, > > do you have more comments on this patch? I think the patch makes sense to me, according to what you explained. > Or do we need it reviewed by somebody else? Yes, global maintainers need to approve the generic parts of patches. It would be nice to get some feedback from others. > > Tomas