From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by sourceware.org (Postfix) with ESMTPS id 59A8B385803B for ; Fri, 16 Feb 2024 18:37:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 59A8B385803B 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 59A8B385803B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d2b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708108674; cv=none; b=kdF4yIhLRpz56WPpUuaUeFjF3OwlXirDgCAgMDEzBQMkOrh0PPm2wjsL74IrJ+P/okJbzUio6ADWAy6bo3D4WzVjfHIALBVt74RLMZC18s5beMJpT/3nQ9s8UwKs74NXwVpSwG81lL6HzZ0Z6CKBwe/19eN4Ltxus8mPdhaaRKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708108674; c=relaxed/simple; bh=ClGaLoHjZtSpVmwZwi2Xrf0PcL+PBBCPvqlHGPa36Jk=; h=DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version:To; b=hWK7Jhp/WzxOLiRBom/6ZuO7sRb/xs/pkIrgFUTnuyKjM6SnIsBCpo+NEKKxWAHzPPhy3U5AFeU1EgZqf0+9PGHG5UMjfQ1ATagXrJrGWqQcuyRrCpbl3wsQrWvyqzWm5kT0Zs4Ig4QIPmDzfmhfTzLHiLb+oUSjrdd56BUwh3Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7beda6a274bso82818039f.2 for ; Fri, 16 Feb 2024 10:37:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1708108671; x=1708713471; 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=J8hXwsu34zI3xI6myASIytISBCiKGqvzcEVie4Ka4C8=; b=Xm0VTqs2GLXLMGyN15a9wQqwWe2XZtWBmC9dflWqB6c13zxMkaf7c3Pw3Epm3Vd+g8 dIkgDRRPgwSIdZ07p+bcmR2K9wm8+zrlVD2WvGAaGVJOJwbLkfIVhK+mUob2GfNL+jmU zn1xhGLpFgOhv1srsnTDJjBWgoPUcyEU6kV1aEcR++gz7ptcvt+V5ssdpD/jpJlDbnoN 0+dP6ETzDWyfqXo1Tt4//zJLeYs0hwKdP6z/urRBTRGKfPTPD2ICokyrxKNWsXr968ua BTXKIUNwaHdx1om8pujnpabCwKY+xKZDaeqbUXAMK0r6P05tCjULNfcYoHV2JlOXn/ks XKJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708108671; x=1708713471; 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=J8hXwsu34zI3xI6myASIytISBCiKGqvzcEVie4Ka4C8=; b=kMae1p981t5QrQaVbxQWMNIf/wbTMVHkMd8Z4LSFt7gHvJBrx0/qzEd+vfCd/kACRo SkvxdLwtawQlbVxt9WWb5muK/zUlZLjKQUInl0HAEIJWuxccI8G7lgIl7APUVd1b44EK fJoIHC1IvABchUF/9Sq64BZ17aciXCVFaHjmz79mvuO6H64IjY4rhe+mOjdZDRbKk8qz LwNGK4/ycG3TLhXOKGKRykPAzg+uornzRsqBAkUscOgBqgpbLMFIqlAVUDl9FFDbwje5 9l1KN4dzoEG0oGLYz8R7mH3nwQEkyz5+XiQBpmFySWtPvwM/U3Mdjxorrt7M/s63ipmA Vgww== X-Gm-Message-State: AOJu0Yxcw5wpIZbGGnUSebuZFgb2FsnmHRC40i66EMQhnS+0PbvYjIVU wzth7vA4pYBUxzjUKLG71ir92eUvgS3WetpDRmvR1SOKiPGHFbVAUaWjA+4X4BU/x2uEtZTd+lc = X-Google-Smtp-Source: AGHT+IGgkd0Kzj7gD+2X3RV5OvK87LEKgzP+AMWiCNsMhNqypzV4m5daUWw7W88tb2DStbH/yHLGEg== X-Received: by 2002:a6b:1502:0:b0:7c4:9479:33e5 with SMTP id 2-20020a6b1502000000b007c4947933e5mr6341344iov.3.1708108670871; Fri, 16 Feb 2024 10:37:50 -0800 (PST) Received: from localhost.localdomain (71-211-170-195.hlrn.qwest.net. [71.211.170.195]) by smtp.gmail.com with ESMTPSA id g20-20020a0566380bd400b00473eb9f9afcsm104724jad.61.2024.02.16.10.37.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 10:37:50 -0800 (PST) From: Tom Tromey Subject: [PATCH 0/5] Fix DAP pause bug Date: Fri, 16 Feb 2024 11:37:48 -0700 Message-Id: <20240216-py-simple-exc-v1-0-c275bcfb5e4a@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAHyrz2UC/x3MwQ6CMAyA4VchPdtkG4LiqxgPZRRpInNpjYEQ3 t3J8Tv8/wbGKmxwqzZQ/orJOxX4UwVxovRklKEYggtnF3yLeUWTOb8YeYnY+c7Vka4XPzZQmqw 8ynL87o/inoyxV0px+l9msg8r7PsPz/vcGXgAAAA= To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 X-Spam-Status: No, score=-5.4 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 Vriest 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. --- Tom Tromey (5): Introduce new overload of read_text_file_to_string 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 +- gdbsupport/filestuff.cc | 24 +++-- gdbsupport/filestuff.h | 4 + 35 files changed, 260 insertions(+), 285 deletions(-) --- base-commit: d9511b64b85296f39ded68f82f7f25ee7d6b25fb change-id: 20240216-py-simple-exc-91903ca871f5 Best regards, -- Tom Tromey