From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#13336: [External] : Re: bug#13336: `next-frame' should not choose the *Backtrace* frame while debugging Date: Mon, 23 Aug 2021 15:20:26 +0000 Message-ID: References: <1776CE98469A44C484752764DD29E2DE@us.oracle.com> <878s0srzup.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29937"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "13336@debbugs.gnu.org" <13336@debbugs.gnu.org> To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 23 17:21:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mIBl8-0007Xg-W0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Aug 2021 17:21:11 +0200 Original-Received: from localhost ([::1]:49722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIBl7-0003nd-Km for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Aug 2021 11:21:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIBl1-0003ma-2v for bug-gnu-emacs@gnu.org; Mon, 23 Aug 2021 11:21:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIBl0-0002Uk-Ri for bug-gnu-emacs@gnu.org; Mon, 23 Aug 2021 11:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mIBl0-0002vI-Nf for bug-gnu-emacs@gnu.org; Mon, 23 Aug 2021 11:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Aug 2021 15:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13336 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 13336-submit@debbugs.gnu.org id=B13336.162973203511150 (code B ref 13336); Mon, 23 Aug 2021 15:21:02 +0000 Original-Received: (at 13336) by debbugs.gnu.org; 23 Aug 2021 15:20:35 +0000 Original-Received: from localhost ([127.0.0.1]:42398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIBkZ-0002tl-AT for submit@debbugs.gnu.org; Mon, 23 Aug 2021 11:20:35 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:36790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIBkV-0002ta-Gz for 13336@debbugs.gnu.org; Mon, 23 Aug 2021 11:20:34 -0400 Original-Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17NEdkIv025000; Mon, 23 Aug 2021 15:20:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=9PmSYmnEWoQhc6GPKUtoE02CseJn9JekT2hbTamLGyo=; b=rvJzUGrbxZFAW911EOfkC7c7WR7u0s7isJiPqMSfpTIgVJlwGnLOszeFC/75issnPfgL C24wpO6YidOlCaTE42YtQIuaybh4DgjHaAuXvhQu6KXl9hocKXDteYN0JrtLcmF5qZT4 F3Wj3CHQ82ss+FFLs0dcVtKyfpdBbu8gbrBS7z+VQlHnmGolPLcze/98+UNuEfu65w21 9RHpcx1TtNmWxh8U+RX1+9gwSUCoqr81N5nlTtogBBnW7cSulk40QhP4jLOYKyYyac9s n+w2ULsfLoBR89/PxHXB9UXNP0laX0EH/40n/hs6uUyZIpjTThi2CdRwXOfQshLFcKwm hA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=9PmSYmnEWoQhc6GPKUtoE02CseJn9JekT2hbTamLGyo=; b=WeLu23YS0fgDNtQ3apDe104L1woCC2e/zI4msoUslibon6Y4uMYRvXnOpQHJROlC3u4r Pp2drQxNDvet7oCBQK0juN97aaWZtPmDt5zJ4oRNJbRxAHS7Cx8Pggjudlbpq9Y0abwR ntw6tGDqGmTBLGYxVA182mD36gM5Og5g582qdA0e9TVn9JfhvOsYL3gID0Pg9DcGGUE9 OskRhY4lCL5BN4kd9+iL+5dUX7nAUsquSB8Ckr4d8R0KjCtZarxAAfCpMy/p8w25H5XW dUDcTJhgizy3sBCobFs7oOC5J4km3QaVk3sMwaPbWMmYZpqUbTWHti+jXxkmK44Gg9ZZ Ew== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3akwfm1ucu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Aug 2021 15:20:30 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 17NFFIM1118954; Mon, 23 Aug 2021 15:20:29 GMT Original-Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2047.outbound.protection.outlook.com [104.47.66.47]) by aserp3030.oracle.com with ESMTP id 3ajqhcug0u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Aug 2021 15:20:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ec7td6rnCCncqB8+diK8bAfp/KXx87S1b1UHR1Wz9Ik53RZoyQ0e7rMfnbsm6hL3ApD4M/kJ+uaMUiRlURFapzfr9eIADIU9tvmi7ROR6JOyuxg+C1zxMozZRQPj2KzrglK5apqE2dpueRLTZsihLYAx0i7JbgkkPbOz6q5hcTrwqrb5BgIVToWG3RrMg7kiS3SL9ZJWsXIgFpn/f3gKZk9+CRI5SJpfwQqZ9TvcDoAPxU62bpP6Sp7ywByAKcxQ8LyMvZ1WhrN1mh3nx0jk37MIeUjk+pX9wKP9I8nQWibAni+868P5qDJRif5TYAUyOzlFCdbCAmFtLFbVxHGtsw== 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-SenderADCheck; bh=9PmSYmnEWoQhc6GPKUtoE02CseJn9JekT2hbTamLGyo=; b=NqPIuJxdo8joE6JbGs+PCnh+JUyxsbb4THLLtL8XAHsyOXUFV413hzGkPN2MzKT3lapoxnWNpfNG40njHLIQkRD/rPggFvOOxrPNHZX8vy1HHZflwqkDzoAulQzDD+7E6jsNpOscUfe9T5UEMTYyfUzf1jFis48hh3a5pp+Wlq3ph28HJqj8Z7jJ+X3HEUktyRKvleO/Cc3ldp1tx70WXk2wQp5EvESeuRBTthGEFqqEDUhEvL9Eg+UzWQfkqEYA+/CJZRHMEcmcF8N2/u/cSyOs3bop6n9VTF2H8PjlNroXFRmgMnAeE2JHM5XQg5ou7pEi7SAt1Z+xFHMY/Hnjhw== 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=9PmSYmnEWoQhc6GPKUtoE02CseJn9JekT2hbTamLGyo=; b=EVRRvL87pOmmkuWP7VdMz+hEneBv4XDkatvJtPsRPbpuGo72dDVisCCzTeXi3Ik347NDtyR6M8FLZCRu/3y13h0sTp0Rv1VHooLDd7QWkCiPMl/CjeUH1VDKljz7zkjkzotic3umntMs0IaPwcYH4EUSLQNCGfDzQh7/pVHBAkw= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BY5PR10MB4036.namprd10.prod.outlook.com (2603:10b6:a03:1b0::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Mon, 23 Aug 2021 15:20:27 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::a59e:fa26:ffe4:615b]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::a59e:fa26:ffe4:615b%3]) with mapi id 15.20.4436.024; Mon, 23 Aug 2021 15:20:26 +0000 Thread-Topic: [External] : Re: bug#13336: `next-frame' should not choose the *Backtrace* frame while debugging Thread-Index: AQHXmCx72IoXC6bbMUyL1GNFUosS1KuBLACg In-Reply-To: <878s0srzup.fsf@gnus.org> Accept-Language: en-US Content-Language: en-US authentication-results: gnus.org; dkim=none (message not signed) header.d=none;gnus.org; dmarc=none action=none header.from=oracle.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d1eb984a-4593-49da-17c6-08d96649891e x-ms-traffictypediagnostic: BY5PR10MB4036: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pBmDe5Qr+fMs1nhDG+pLNSpwjiOUz5ekITqxbqfC543zi0ERacIwJPXjnDXyPhmKOgpEAQSv44vlJY948+ENP5RzAfHngAPY790omeYURRRXbcn0nIzW2mGjNxkOlwyJMm5cCOdX4vX83QL1975wmDxD06r9TYg7sTcQEEv5r/x4dkV7tXoGLR5m757aW3j6IINk8OM3wwuFyLUqCV+C46FHOb9HXTEpZxnnnvdE6IR7Fiq5PAlOVFq5xDyjIzUbQC3tVe6817M6DdUeTlRM3tQM4h0/BMmPD8KamI9be+PA/0TvdXCsLX7+EYBqolid3B16iJ2UgdkWCaM0qn3MuriJpAGHX1zPjyCJi5jZJRJJs9UhfKQcG5tlhy7Ps35A0Uuuox3ITDxCgg3RyJShUSigzooBJT+Q9Uyo4FItogsUYHo157NMO/wrwH9gVjMUEb7Prxrgnj9Ddu1scNoYYEGR8udXgV+Bd8o7B5OhjSVwr4PfKUaa+++Gv+T+NDdH01hPR9EbORmbmDqrwuW/0kearvDc2cQmrRVpmKL9TUUifMn5EAAKRcz4nKqnkWMM/s2TbR2wRfRRtLIB+cvbOM15MROv2DCqZAgyGmXdv8lehvPA/PLQmJqQhELY5Rkbm9GEhYV9MwJ9Z2agD9Nkr31jjk22lqXNDC5FOsNMIOI1kU9y3U+pdiPfol6OVUqIAWQkbkS3xWy35jKvswqxGfk/wlEJC2bht7EEVp0xt9k= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(136003)(39860400002)(346002)(366004)(396003)(71200400001)(6506007)(64756008)(66476007)(122000001)(8936002)(6916009)(66446008)(66556008)(66946007)(478600001)(316002)(83380400001)(86362001)(44832011)(76116006)(7696005)(26005)(9686003)(4326008)(186003)(55016002)(38070700005)(33656002)(52536014)(8676002)(38100700002)(2906002)(5660300002)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: RkOdyndUagpa+5WSe4Ka5ZXR1pCxQAmcBuhIk3IpjvK+qHr3WHeOC2XTGAjnzHGRBk2E8Exr4BHXYtJ/TWDRGrqXClpno2iENno5f0tPSclx9O6l8Z0nj3BM19fR/vptbkpc3RHXr4Gf16GbYOOchjjEqpanS+3rO8k1iyVplcM+OnHJ4YKjEubWTtU+7tdhxmoORIrciaqrjZr/33RFLNfNDk3WkUyRd31/XQgJql6mEJWsVVfo6LCxsvVD1CoTMC3ceyte5vYyYJ02+QXqoudEkovaCYULjTdwd2w+NwbO2uWGpVc4Kd5upk4WE2dY+jgopXx3/UJcjACCFrbSiiX92iZfJrTdQYRoHVZMRaU++64Z0Kz1yyNhlFvEG0Xb/z/xOR+JiLiY9543FHApqMHRBcLYm3Y+Yynlg805jqSYU76ZORu+cFNIBT9nD/BYSm3Qm/AqJc/8U1NVhLmmp2vI0Lud27zgPgckCWVh49WHGivpvFABccyLWWsz+mI1MA7gJECd1Hgqm0Ub22euB7YUCWKj5aDngiFGBxldl9jPlqRLJY18EdZkRttQ2yxoagR3Nx8ASv/JnJrpcbbln3CH3VQRTk6g3yMQFBG8KXcvxisl4Xfu2TobMKiWVxI83m/3MAvCV2IgHn8vt2kkJiJlbOpz/tqexgjRXTnrcBU08OmQGfZ80+Um3WCx1/5/thKF5OnOhj5MKolxzf8P8N1NHAnA3PbLb4Q6YsIcNMvJw9X80akmRDpubr PGdQxzgvZp6Htilksa6Sds+9V0jDrPEO2lseYhXDTgvrIGzuTar77L4cI7PgiEFvJNoIeKkqBfDjtBVwA3o+6zV+BMn4zZQ9sQ x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1eb984a-4593-49da-17c6-08d96649891e X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Aug 2021 15:20:26.7448 (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: gCTeF8vXG7oe2dlndC+r7v1uePP/xuxDHhajvElLwcZPZeqVGbB9bOcE54fCt00cMWt06F5ahRWuT5fq6Vyyfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4036 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10085 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108230106 X-Proofpoint-ORIG-GUID: avGF8hjUvVZ2TUlv492kc3vB1V2Zc1oj X-Proofpoint-GUID: avGF8hjUvVZ2TUlv492kc3vB1V2Zc1oj X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212494 Archived-At: > > Set `special-display-regexps' or other so that `*Backtrace*' gets > > displayed in its own (special-display) frame. > > > > Evaluate the source code for `next-frame', then > > M-x debug-on-entry next-frame, then C-x o. > > > > When stepping through the debugger, the next frame should never be > > *Backtrace* (unless a *Backtrace* frame existed before invoking `next > > frame'), but it can be. This is a bug IMO. >=20 > I don't think so. There's a gazillion things you can do while > edebugging that will make stepping through the code not behave like it > would otherwise (moving frames to different terminals, closing frames, > opening new frames, etc). Adding something special here for *Backtrace* > would just be confusing, so I'm closing this bug report. There is plenty of special treatment for *Backtrace*, involving the current buffer, selected window, frame, vars, etc. Otherwise it wouldn't work at all. Trying to examine/debug the execution of code that involves the use of `next-frame' etc. requires that a separate *Backtrace* frame not confuse things, just as the debugger tries to keep other *Backtrace* state out of the displayed debugger evaluation. (FWIW, the recipe does not use `edebug', though I doubt that's important here. It uses `debug-on-entry', which I think just uses `debug', not `edebug'.) The recipe didn't include doing any other things, let alone a gazillion of them. But the recipe incorrectly said `C-x o' instead of `C-x 5 o', which is bound to `other-frame'. And, as the backtrace in the bug report showed, the recipe should have said to evaluate the source def of `other-frame', not `next-frame' (which is defined in C), but this too really isn't necessary. It's pretty simple, really: ___ emacs -Q (setq special-display-regexps '("[ ]?[*][^*]+[*]")) M-x debug-on-entry other-frame ___ In Emacs 27.2 (and older): Debugger entered--returning value: # next-frame(#) * (setq frame (next-frame frame)) * (while (> arg 0) (setq frame (next-frame frame)) (while (and (not (eq fra= me sframe)) (not (eq (frame-visible-p frame) t))) (setq frame (next-frame f= rame))) (setq arg (1- arg))) * (let ((sframe (selected-frame)) (frame (selected-frame))) (while (> arg 0= ) (setq frame (next-frame frame)) (while (and (not (eq frame sframe)) (not = (eq (frame-visible-p frame) t))) (setq frame (next-frame frame))) (setq arg= (1- arg))) (while (< arg 0) (setq frame (previous-frame frame)) (while (an= d (not (eq frame sframe)) (not (eq (frame-visible-p frame) t))) (setq frame= (previous-frame frame))) (setq arg (1+ arg))) (select-frame-set-input-focu= s frame)) * (closure (frame-initial-frame-alist t) (arg) "Select the ARGth different = visible frame on curren..." (interactive "p") (let ((sframe (selected-frame= )) (frame (selected-frame))) (while (> arg 0) (setq frame (next-frame frame= )) (while (and (not (eq frame sframe)) (not (eq ... t))) (setq frame (next-= frame frame))) (setq arg (1- arg))) (while (< arg 0) (setq frame (previous-= frame frame)) (while (and (not (eq frame sframe)) (not (eq ... t))) (setq f= rame (previous-frame frame))) (setq arg (1+ arg))) (select-frame-set-input-= focus frame)))(1) * apply((closure (frame-initial-frame-alist t) (arg) "Select the ARGth diff= erent visible frame on curren..." (interactive "p") (let ((sframe (selected= -frame)) (frame (selected-frame))) (while (> arg 0) (setq frame (next-frame= frame)) (while (and (not (eq frame sframe)) (not (eq ... t))) (setq frame = (next-frame frame))) (setq arg (1- arg))) (while (< arg 0) (setq frame (pre= vious-frame frame)) (while (and (not (eq frame sframe)) (not (eq ... t))) (= setq frame (previous-frame frame))) (setq arg (1+ arg))) (select-frame-set-= input-focus frame))) 1) * other-frame(1) funcall-interactively(other-frame 1) call-interactively(other-frame nil nil) command-execute(other-frame) ___ Such behavior makes it pretty much impossible to follow code that itself invokes `next-frame'. That's the point. We jump through a number of hoops to ensure that the debugger state and its own display don't interfere with the state that we're trying to show of the code being debugged. It's not possible to do that completely, of course. But this is apparently just another case of Emacs not having paid enough attention to using separate frames with dedicated windows. An oversight, I expect.