From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by sourceware.org (Postfix) with ESMTPS id E45DE3858D20 for ; Tue, 20 Feb 2024 19:46:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E45DE3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E45DE3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708458378; cv=none; b=Wo2Y8FnkMaSqq8nEF0jquojDksigVVE6aT/NASF+zUDcmX9HiCnRj/0+kOev7ArVPXlFztxm2qXNSy/bE5Dad4SxEpFs6Mqcr4XzplO7utsjxqDwOB0uSf/6I7GmJK57NZ+p1eb/7PIoPigm6sS3QPSdsq0Ub1rnqKpBz4zgrcI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708458378; c=relaxed/simple; bh=MoGvo/ClrQX4zKNx5goaGWMVo/LFJNJBT90tbauA3Sg=; h=DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version:To; b=xowWSBDjjvNcHqW0ott1LnGXJyZ1BgkNwVZhvJ09XH4CGLGuG8BWRdA2hz2+pUNjTjaThgispPsl4WHxYajxDsQ/WoqgNusXVPMadqPo+uwz18B8I8WQdAlvCl8DgCVRAmEiQsoNpVmu4fsLpdT3VY4OZFu6r57dauSQENSTjec= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7baa8097064so387092739f.3 for ; Tue, 20 Feb 2024 11:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1708458374; x=1709063174; darn=sourceware.org; h=to:content-transfer-encoding:mime-version:message-id:date:subject :from:from:to:cc:subject:date:message-id:reply-to; bh=goJWL3lMCh7qsRo4xt0Wpy2E4+Ku9I8pRDdYLc4yDRc=; b=DpO8FR1cA70c3oD99VBaXIavPtRHeF8yJ11UYIBd7m9mF+DgKft3faVMkXNkovrwBz IjpTb7pgkM37Fm0YN7ofu6gKlbAcTtbUEX6jC3/+w9TpgDIZTSRnfRHodINIRLQdGm8p i0jjDk1B47xvxv6ktbA+cibePLPeufVRPrbgCtsE9HEIH00owzjlBWx1ihJ2MxxdhHXy 7wp4IqfaM/lLkd0WFfF3jWYmdDCqj8/zBeUmr/7eg1qivPuaXuhKeDU3Kuc+sI6hs9Ac C9tAQPSxE7N3xzyjA4XYUBU51HjrQlqebrjJ0FbtgzWBixgmzNWEz6TX2Mw5RIJe2t4h d9vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708458374; x=1709063174; h=to:content-transfer-encoding:mime-version:message-id:date:subject :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=goJWL3lMCh7qsRo4xt0Wpy2E4+Ku9I8pRDdYLc4yDRc=; b=xPGTcpChuRkCyHb2VDrrM4Z/tBYXRDMgM2K4X6f2q6WmgV4YkF5yvSOtY+7B7YSnn0 JKzU+/RX/O8iMUNE5ebq8Oz5fLv4SIUkv1LghZ/bGiF78zDGocoD0aY86zCg1HjOa511 6DtSRno/t7rcFD7IgAf6B7dDnijCi5WsWvSN1/SdMcRgkkhFdqssFSiiviXrAYK+HgCT r3nPBWwPgm2i8GnSkXKmcMetvk2QW1eFxBUQxKtS7broy2wNHQDsU+If/ol8Za+G495Y 83tThODc6LqJQ1kF4oJ7gT6NlhJu4UHFulbHxpANtA+0FabPDpBKxGURhdYzOxacxqYt 5uDQ== X-Gm-Message-State: AOJu0YznqtS+7IOUqQFEMSjU8S0dFiNZJB1q0z0SUvXq5+M2UYN+EgWV m7zpaAFIafkHc5q4MsCBKD1h4wSbOogU/nZU7Ugs4C4UpT+HZoNoUeu/1e5xoVowuI3s0ofg0uk = X-Google-Smtp-Source: AGHT+IH4fuy1tQsV5cYSu7TTuvPZJeMPfAKWXod9Y0R2Rem6rY5JsJzx6Qc2BU+oV4r7O7/Sx+/WSQ== X-Received: by 2002:a05:6602:e48:b0:7c7:439d:5417 with SMTP id gq8-20020a0566020e4800b007c7439d5417mr9160698iob.11.1708458373943; Tue, 20 Feb 2024 11:46:13 -0800 (PST) Received: from localhost.localdomain (71-211-170-195.hlrn.qwest.net. [71.211.170.195]) by smtp.gmail.com with ESMTPSA id q10-20020a02c8ca000000b00474284a0228sm1261811jao.61.2024.02.20.11.46.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 11:46:13 -0800 (PST) From: Tom Tromey Subject: [PATCH v3 0/5] Fix DAP pause bug Date: Tue, 20 Feb 2024 12:46:11 -0700 Message-Id: <20240220-py-simple-exc-v3-0-a2825caa4b74@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAIMB1WUC/3WNywrDIBQFf6W4rkVvzKur/kfpQs21EZoYNEhCy L9Xs2oLXQ6cObORgN5iINfTRjxGG6wbExTnE9G9HJ9IbZeYAAPBgFd0Wmmww/RCioumLW9ZoWV Tc1OS5EwejV2Ov/sjsZIBqfJy1H1+GWSY0edhb8Ps/Hp0I8/zf4nIKaMa6lJpo0oU8iY7qZ3Hi 3YDyZEIHz6wXx+yX9VgeNsIJbpvf9/3N27W8ycFAQAA To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: Tom de Vries pointed out that the DAP pause.exp test wasn't actually testing interruption of Python. Digging into this revealed that the "python" and "source" commands don't handle Python exceptions in the normal way (in gdb terms). This series changes how these are implemented and fixes the original problem that Tom pointed out. Tested on x86-64 Fedora 38. --- Changes in v3: - Fix style.exp failure when Pygments is missing, pointed out by CI - Link to v2: https://inbox.sourceware.org/gdb-patches/20240220-py-simple-exc-v2-0-c672f1984b4d@adacore.com Changes in v2: - Renamed new function in first patch - Link to v1: https://inbox.sourceware.org/gdb-patches/20240216-py-simple-exc-v1-0-c275bcfb5e4a@adacore.com --- Tom Tromey (5): Introduce read_remainder_of_file Fix formatting buglet in python.c kfail a FinishBreakpoint test Rewrite "python" command exception handling Use the .py file in gdb.dap/pause.exp gdb/python/lib/gdb/__init__.py | 27 ------ gdb/python/python.c | 111 +++++++++------------- gdb/testsuite/gdb.ada/tasks.exp | 8 +- gdb/testsuite/gdb.dap/pause.exp | 2 +- gdb/testsuite/gdb.python/py-arch.exp | 2 +- gdb/testsuite/gdb.python/py-block.exp | 4 +- gdb/testsuite/gdb.python/py-breakpoint.exp | 18 ++-- gdb/testsuite/gdb.python/py-connection.exp | 8 +- gdb/testsuite/gdb.python/py-disasm.exp | 32 +++---- gdb/testsuite/gdb.python/py-error.exp | 9 +- gdb/testsuite/gdb.python/py-finish-breakpoint.exp | 8 +- gdb/testsuite/gdb.python/py-format-address.exp | 28 +++--- gdb/testsuite/gdb.python/py-format-string.exp | 8 +- gdb/testsuite/gdb.python/py-frame.exp | 18 ++-- gdb/testsuite/gdb.python/py-inferior.exp | 24 ++--- gdb/testsuite/gdb.python/py-lazy-string.exp | 6 +- gdb/testsuite/gdb.python/py-mi-cmd.exp | 40 ++++---- gdb/testsuite/gdb.python/py-missing-debug.exp | 16 ++-- gdb/testsuite/gdb.python/py-objfile.exp | 2 +- gdb/testsuite/gdb.python/py-parameter.exp | 14 +-- gdb/testsuite/gdb.python/py-pp-registration.exp | 2 +- gdb/testsuite/gdb.python/py-progspace-events.exp | 2 +- gdb/testsuite/gdb.python/py-progspace.exp | 8 +- gdb/testsuite/gdb.python/py-record-btrace.exp | 4 +- gdb/testsuite/gdb.python/py-record-full.exp | 4 +- gdb/testsuite/gdb.python/py-template.exp | 2 +- gdb/testsuite/gdb.python/py-thrhandle.exp | 2 +- gdb/testsuite/gdb.python/py-type.exp | 20 ++-- gdb/testsuite/gdb.python/py-unwind.exp | 24 ++--- gdb/testsuite/gdb.python/py-value.exp | 36 +++---- gdb/testsuite/gdb.python/python.exp | 10 +- gdb/testsuite/gdb.python/tui-window-names.exp | 16 ++-- gdb/testsuite/gdb.python/tui-window.exp | 2 +- gdb/testsuite/lib/gdb-python.exp | 2 +- gdbsupport/filestuff.cc | 24 +++-- gdbsupport/filestuff.h | 4 + 36 files changed, 261 insertions(+), 286 deletions(-) --- base-commit: 94a75b0363b1e09416e9bd24cac72d98864688d8 change-id: 20240216-py-simple-exc-91903ca871f5 Best regards, -- Tom Tromey