From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aSuJInYCLWU0OS8AWB0awg (envelope-from ) for ; Mon, 16 Oct 2023 05:29:26 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2023-03-30 header.b=DDCXO3eH; dkim=pass (1024-bit key; unprotected) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com header.b=b7ku9fC8; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8228E1E0C1; Mon, 16 Oct 2023 05:29:26 -0400 (EDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 94D7D1E00F for ; Mon, 16 Oct 2023 05:29:23 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2CB18385771C for ; Mon, 16 Oct 2023 09:29:23 +0000 (GMT) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 88C283858418 for ; Mon, 16 Oct 2023 09:29:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 88C283858418 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 88C283858418 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697448549; cv=pass; b=Q2JnUOyX+i/PTpfBHwuuEsXuq1QbD7DWa6PJh25c5x02Zn/HBUqNWLCZcL8/oRKWjKTiNoiiYqhE7hfdugr9O2qC80/bpiSr+K1gwX49XI5n3AHumpXjtzcT+sDK1b6sTtwW/zoDvx495tJqvNEfdYrMdaw+F1XWLG3eTEWVY/s= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697448549; c=relaxed/simple; bh=s9vldfNaAXfPjHPzxKeo/0qQO9IrIjiiayF+mi3nROE=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:To:From:Subject: MIME-Version; b=Sv0DG8Jv9+VFVxxZcH59LzMF2acbXn1boXuWMd0KFIuVfzJt/nEpVz0hVa+X/2tk2tcRz8jL6e96UItOaOsatM8m3BUurQXCYhVEeSase3HZPCFYYSrieaqx/48Z6XLInC8t+rRStT4goki1oU3esjzs0cQbNoSFBb+MICV9gqg= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39G6nHw9017602 for ; Mon, 16 Oct 2023 09:29:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : to : from : subject : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=L5FYexiIE9a0z2LSg8gZAmKPH8J5huXB+ewIKGPA5Pg=; b=DDCXO3eHN7hUYoF3GrlGtJUdgidGCDXmoLRW2EkDFmOD/pYgy+xMSdkFGa+LwXEolZlL aaIXHKd2A2rY5/8x3a7S6V527agqMQ1b/xhe3ssh+HYS/5i/6aByRMofuh1wtIZRzAbw x70TOuAy/ZCdScGqG/3ssAbH123ufZ5IlQ/LMzLHeem1ulHhxnVcFCTbQeVTRxIQXn5B VQYbPjWAGn8xmpQMv34XzET6txvuMxLmN9BdI2LPRPe5dkPYVe+h049KJ2COWmOOlvpk ubuDE+TpTGj3VsZD9W/Rc/GMQfGrMzhHn7TzxFfAeQ2RXEcGI6AIZuv/v4zslgkLDrAF Qg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tqk28jb3d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 16 Oct 2023 09:29:00 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 39G8pW8Z027211 for ; Mon, 16 Oct 2023 09:28:59 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3trg5260xq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 16 Oct 2023 09:28:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mlLVgYSk2lSERz+Gtcq8ph4lWZ1LOt9RaOkOJJpe9+n6fF7Ae1BuqhpfQ4NS+nomuhEmfjwPADFrYvF5FpDPS1nGtNKDXPnURItZ/4n/BcNnKoRHwncNJvpdSknpII1xI4p+5GsgjBUZzGHe/YJJeTKMxc6PQ5YOoB1EJvhRvbBgp+L9OgDX6Pxh8pq94623n63XHltpgu/DNGhJEZ+k1N4nWN2nwCPX4f9VQno0jyT9GWqdrCQRucJGF2ot+//M+fAoRVO80VBlXEVVxETUDvKJr90Jq7NLhGuMwC22oVdoSEFRLTYci0oqwhnBxT+pHV9Ygt5zMf1yL5+HFfrZIg== 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=L5FYexiIE9a0z2LSg8gZAmKPH8J5huXB+ewIKGPA5Pg=; b=Lk1hr/vJ5iqWPyQRcBH5tjUQXoHV8+Z7DXlh0DBEGq/Kp59Qbb44OzV8aYVXnA+wqOohuA06YyLgT7RS4+JMCdkpe72mdYdJ6Zr2kuDhMyzjSWVXh8fHOf0ut0jshHfmEAklDU0yBE6+TN7cXpzViB/c+Lb9PWfOdmcVPZ1rwkOnR7jz9A+tDJxtd07E8l+SwYlzDOvVGYOY3vbuxOePZ9HYlLtWFw7oFoereudXqy6M1EqlgfYn29aGArznfWs6WGZKsxxYeppyOwehtCZZGwuNhquW40a6OASvIJXmC1eiOREX45ES9IXW93yEhDleQRsCqvD3nDAun2kL18CT5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L5FYexiIE9a0z2LSg8gZAmKPH8J5huXB+ewIKGPA5Pg=; b=b7ku9fC8oiNiVHUyvAOVqQ31rgtTw82yhO0ZPcsL81m89/TCb0iGyFxlBT4+brH6rmojJhl20hIN3XyzU7sP0d9AUeer0zLqhMyLQwWU5i990hH15SCboIYhvcl2ez9HcM6YChMexGIteA8KBrlF7NVnZXHS+7S0Or/2jCymu78= Received: from DS7PR10MB4861.namprd10.prod.outlook.com (2603:10b6:5:3a7::15) by LV8PR10MB7798.namprd10.prod.outlook.com (2603:10b6:408:1f7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Mon, 16 Oct 2023 09:28:57 +0000 Received: from DS7PR10MB4861.namprd10.prod.outlook.com ([fe80::4d02:7b63:f848:c817]) by DS7PR10MB4861.namprd10.prod.outlook.com ([fe80::4d02:7b63:f848:c817%7]) with mapi id 15.20.6886.034; Mon, 16 Oct 2023 09:28:57 +0000 Message-ID: Date: Mon, 16 Oct 2023 14:58:49 +0530 User-Agent: Mozilla Thunderbird Content-Language: en-US To: gdb-patches@sourceware.org, bert.barbe@oracle.com, rajesh.sivaramasubramaniom@oracle.com From: Partha Satapathy Subject: [PATCH] gdb : Signal to pstack/gdb kills the attached process. Organization: Oracle Corporation Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR01CA0003.apcprd01.prod.exchangelabs.com (2603:1096:4:191::16) To DS7PR10MB4861.namprd10.prod.outlook.com (2603:10b6:5:3a7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB4861:EE_|LV8PR10MB7798:EE_ X-MS-Office365-Filtering-Correlation-Id: a7dffe55-d9c4-4b78-8a38-08dbce2a523f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dRYWsF2pVZ1O0mfn9/lg0bwXzRGpJiRwEzLJ/uVbC55qYNrrYLS9pB+UQH4VNC6nOYFSai0+MWwgQ4a3QY6qGvsAtEX7Hf8zNtCazZq/CtZfHN/2UU/D4a7Z+9yI2mu0ExsLeqd2Pykpk62OUbhXz5FFnfdd0ROAkKze9qDyt9wXEQFqCC/qmyULQfQCuaONymN4PR/waVQCt3J2RutWyAUo1QwYBm6DpeVta1nC9OcQO/rvUg4gk1lzECdqwikau3RFQwdR4yAwKK2d20L0RJu03IoLKqif748LdYxsAzqUazdkMB0ImI3jXUZT1YzAgQutXuYxjDibUcL+4O+zBv1Yuge6OPjrKlS1zyGSn6ivgqtJued/lwfVfgyMULUO8/9Eq1exT/9kUsmi5SfMxTOkfInkYqqw+CG9mYQlGTGh6tDltydSN3aSwk+qG3OeAeO4ANv1/HUy6NMwOfrhwokqXRifu4yWjM2AdBO+hbwRTL6vxC29J/f2tzCPYG1IGoo56f4Exegc7SgOjQSi0now/QxEiSHg6QHl2RjVqXu613XBHogLzA/dHK9238+jrHmhEHWXRIRDkPUt4S0/JlkpquqMMmiBSOFhfWtuFZzfMpkkt7aNoTx55CNdrgcX3quTjurT/+8+B6wPUFVg1Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS7PR10MB4861.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(376002)(346002)(136003)(366004)(396003)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(6486002)(478600001)(66476007)(66556008)(66946007)(316002)(6636002)(2616005)(6506007)(26005)(6666004)(6512007)(36916002)(8676002)(8936002)(5660300002)(44832011)(2906002)(41300700001)(31696002)(86362001)(36756003)(83380400001)(38100700002)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?elAxUmRQRzM2UFBOUlVYaHFUZXd5dnMyYVdFNUZkOFdjVFBpd0kvMFUzTW1Q?= =?utf-8?B?VWhsaFYwOFFGZlJpeVlPOFlzbVF4SWFBOXdmdWJJY0JPMlBJVy91eWcwdS9H?= =?utf-8?B?WTVPZVFCc2NRd0RXaW42cWhOOTErRkh4bGFqNi9BekkwMXFJd0hLbjFnalV6?= =?utf-8?B?N2M4a3htZXQ3VzFCTGp6QVkzS0pNRG93UVdVeUhnMndwSDFjVkNIQnd3NHhW?= =?utf-8?B?Ti9hT0hYRzhLWE1RY0Y3S1BxclBQSXFUczJ4OWxCcHdTY2ZldGdmMWxJNzZi?= =?utf-8?B?Ky82UE4yb01mdEo2YkFBMDV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mtCaTRkSHRu?= =?utf-8?B?THhLaDUrR3Rzdi9OSU4xSmgzQUg5aE45dlJoZDNjRlQ2VGtFbXlMbCtFZGQv?= =?utf-8?B?RGc9PQ==?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: teJgi9n96YOWyHN+MTXfI5s+kOECzinlIZh5h+X/bUTsmMYYvbqrY4i2vZBh6bNyYP+8zR2Zgik/jcQ4fDvfKIL5u09028J50lm6i6PCcGnIZnOPtA5PwZ6HVopupHHopUNelpJyan7oOnVEA8cme7m0KLOx2IVrVxYYUiPUljG6V79o2sKwmxIXuL+DCrUeR5irqWO3bSG07P0K0g3nn9Jt2IKq8suoDljXgM7WHda2HF2MabQeMBM5xyDK8MHqBQHYvE/HIa4vlNBcdywEUnbEC81bQq0GjiqLzYl6D2tQbds/7Bjr9YDh/MGgoXF921qnAjMwjDn6v6A8aiKmHxhqAJPI4qHGsG1ea3TxMwmn9RsWo2xKPPa07gErg2aTynNnXRm7n5DF+imhBzY7cFjE9r8WZWAiSOKgmKEY0uZ1BomrQLq2mLGYtt8B6B1+m4MeP5p8h6ymBngpa1fTiI0r2cX1ypq0HHxZ+a8cIDFlE9U9H9406c8fbPiPfiIbhObOUFHup4OCE6edQRGRAnk8rfVCP6SdCAgcGE1410nwr9tlJd+iCkq9K9ePQa/n4RtPV3Pt3pFMDIXFFHqJ6QKb2OcfOvWb7O9ZKySgNKAuHwEl+mMA2mJbi/rrMLS9eDGC++Bo61Gptz7a5rCs9ZATRIDhaX2EVZaZWQM1dno4vCjrDgq+WomMrdA2qYZfaWpSTXDAiQhfZhqX0V0D/ZX/Gc69IykSeg5rK7wAmbgZnhXKEEOs+HqQawpF4ZNjl+46SD7rLW7OIWj2nBGRpg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7dffe55-d9c4-4b78-8a38-08dbce2a523f X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB4861.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 09:28:57.0049 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OlOJVK3SL1zihuSMihD+apyqB7PTQeNxpp5GO+9Of/s9fIAH/9RRtKLqW1qawFPB/r2dL6/6ZER/Kw0YP1U7OXZabsvppvQuUtJodljECGg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR10MB7798 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-16_03,2023-10-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 suspectscore=0 mlxlogscore=809 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310160082 X-Proofpoint-ORIG-GUID: _uCiVokddUVmyIW2FugVYSAYxmQpwfaR X-Proofpoint-GUID: _uCiVokddUVmyIW2FugVYSAYxmQpwfaR X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Problem : While gdb attaching a target, If ctrl-c pressed in the midst of the process attach, the sigint is passed to the debugged process. This triggers exit of the debugged. Let’s take the example of pstack, which dumps the stack of all threads in a process. In some cases printing of stack can take significant time and ctrl-c is pressed to abort pstack/gdb application. This in turn kills the debugged process, which can be critical for the system. In this case the intention of “ctrl+c” to kill pstack/gdb, but not the target application. Reproduction: The debugged application generally attached to process by: gdb -p <> or gdb /proc/<>/exe pid pstack uses the latter method to attach the debugged to gdb. If the application is large or process of reading symbols is slow, gives a good window to press the ctrl+c during attach. Spawning "gdb" under "strace -k" makes gdb a lot slower and gives a larger window to easily press the ctrl+c at the precise period i.e. during the attach of the debugged process. The above strace hack will enhance rate of reproduction of the issue. Testcase: With GDB 13.1 ps aux | grep abrtd root 2195168 /usr/sbin/abrtd -d -s #strace -k -o log gdb -p 2195168 Attaching to process 2195168 [New LWP 2195177] [New LWP 2195179] ^C[Thread debugging using libthread_db enabled] <<<< Note the ctrl+c is pressed after attach is initiated and it’s still reading the symbols from library >>>> Using host libthread_db library "/lib64/libthread_db.so.1". 0x00007fe3ed6d70d1 in poll () from /lib64/libc.so.6 (gdb) q A debugging session is active. Inferior 1 [process 2195168] will be detached Quit anyway? (y or n) y Detaching from program: /usr/sbin/abrtd, process 2195168 # ps aux | grep 2195168 <<<< Process exited >>>> Description: We are installing a signal handler in gdb that marks the Ctrl-c/sigint received by gdb. GDB passes this sigint to the debugged at some definite points during the window of process attach. The process of attaching debugged involves steps like PTRACE_ATTACH , reading symbols, getting the stop signal from the debugged and get ready with GDB prompt. Note: one of the example of this is sigint passing is: " - installs a SIGINT handler that forwards SIGINT to the inferior. Otherwise a Ctrl-C pressed just while waiting for the initial stop would end up as a spurious Quit. " There are few other places where sigint is passed to the debugged during attach of process to gdb. As the debugger and debugged are not fully attached during this period, the sigint takes its default action and terminates the process. Solution: While gdb attaches process, the target is not the current session leader. Hence, until attach is complete and GDB prompt is availed, the sigint should not be passed to the debugged. A similar approach is taken for "gdb) run &". In target_terminal::inferior() /* A background resume (``run&'') should leave GDB in control of the terminal. */ if (ui->prompt_state != PROMPT_BLOCKED) return; The passing of signal is skipped if the process ran in background. With this approach we can skip passing the sigint if the process is attached to gdb and process attach is not complete. Here is the proposed solution: Fix : While gdb attaching a target, If ctrl-c/sigint pressed in the midst of the process attach, the sigint is passed to the debugged process. This triggers exit of the debugged. This issue is evident while getting the process stack with ./gdb --quiet -nx -ex 'set width 0' -ex 'set height 0' -ex 'set pagination no' -ex 'set confirm off' -ex 'thread apply all bt' -ex quit /proc//exe and press the ctrl+c while attach. The above method is also used in pstack application which is a wrapper over gdb to print the process stack. A Ctrl+C intended to kill gdb or pstack, but kills the debugged even if it is attached and not spawned by gdb. --- gdb/inferior.h | 3 +++ gdb/target.c | 4 ++++ gdb/top.c | 2 ++ 3 files changed, 9 insertions(+) diff --git a/gdb/inferior.h b/gdb/inferior.h index 4d001b0ad50e..b7048d10bbe4 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -557,6 +557,9 @@ class inferior : public refcounted_object, /* True if this child process was attached rather than forked. */ bool attach_flag = false; + /* True if target process synced and gdb ui is out of block. */ bool + sync_flag = false; + /* If this inferior is a vfork child, then this is the pointer to its vfork parent, if GDB is still attached to it. */ inferior *vfork_parent = NULL; diff --git a/gdb/target.c b/gdb/target.c index d5bfd7d0849b..f7c115497451 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3826,6 +3826,10 @@ target_pass_ctrlc (void) through the target_stack. */ scoped_restore_current_inferior restore_inferior; set_current_inferior (inf); + if ((current_inferior()->attach_flag) && + !(current_inferior()->sync_flag)) { + return; + } current_inferior ()->top_target ()->pass_ctrlc (); return; } diff --git a/gdb/top.c b/gdb/top.c index 621aa6883233..26cc6caac0e5 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -542,6 +542,8 @@ wait_sync_command_done (void) while (gdb_do_one_event () >= 0) if (ui->prompt_state != PROMPT_BLOCKED) break; + + current_inferior()->sync_flag = true; } /* See top.h. */ -- 2.39.3