From patchwork Mon Sep 11 15:22:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 75650 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 70ACB385841B for ; Mon, 11 Sep 2023 15:24:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70ACB385841B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694445852; bh=yDwQohMJfOtUeZoBVo7Mf0lu718X4gkqz9L+RdZqeeg=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=AU55Thdo1Hb9GyzjVMmD6NQj1TEIKoY6ddHugFn7FE9tTR+hvSMzJm2zj3M9KY/2o pOF6mCBcZgRjSWh/ZngCHtJHXHCOe4oa3ZmT4m65EsVxUPMSYZanHZHRWBuRGvTv1n SA0MfhBvsqa+yGDTLn5t5KP0XfS3IcxJOXShTOwo= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by sourceware.org (Postfix) with ESMTPS id 8E2AE385770F for ; Mon, 11 Sep 2023 15:23:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E2AE385770F Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-792975085b2so166404839f.1 for ; Mon, 11 Sep 2023 08:23:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694445780; x=1695050580; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yDwQohMJfOtUeZoBVo7Mf0lu718X4gkqz9L+RdZqeeg=; b=Rs1eWyDQPWVnFEqKKz58UIXJh1Zis6AifBPK0OQfxdtOyN4Vs4PpaOhqSoYqOMB5eZ 4diEAkAmN0MY53wEC+3oubIIyoYlMvWXTK4DR6iHIZS31NvzsP1OESLQJ2y3liD2ib7Q agpOz7ytA7jMbpYSa1eOESq8O34q9CsKP6DBADRG8aY+J+CFFMco7qU+XaLPDq4zchJF 6INofKaPQvpGEF10IlKHdJCrEZfSJwpJ6fiJiAVLkCb/l9SwQPHe5+J7NWIVmKMvhfzU 6UBnuHdXVYgcXvQo0a36WFyGwPTxQCRDair5K3ikpwG1mk9cmwYJ3aAQ5qocsP/mlYwd CJOg== X-Gm-Message-State: AOJu0YyQe7Lt+efqBlPexk8cKfcS3sz8OCS1oUJXlIkuBUrcIRzm/nJi 8pasXvUZViPepFAOEkOA0gY4oqojkmCiXflb8m2z4g== X-Google-Smtp-Source: AGHT+IHaX2WVKwxVuuSt0N4DNUo/IMw2ITtseH0Y32xTNH/q5wiTwy3C6RO6XJXHea02G8hA1Dqyrg== X-Received: by 2002:a6b:e60b:0:b0:791:280:839e with SMTP id g11-20020a6be60b000000b007910280839emr11727551ioh.16.1694445779769; Mon, 11 Sep 2023 08:22:59 -0700 (PDT) Received: from localhost.localdomain (71-211-130-31.hlrn.qwest.net. [71.211.130.31]) by smtp.gmail.com with ESMTPSA id v24-20020a5ed718000000b0077e40979b41sm2377481iom.45.2023.09.11.08.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 08:22:59 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Update Python signal-handling documentation Date: Mon, 11 Sep 2023 09:22:50 -0600 Message-Id: <20230911152250.3434008-1-tromey@adacore.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: , X-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" I noticed a typo in the "Basic Python" node, and when fixing it realized that the paragraph could use a link to the block_signals function. This patch is the result. --- gdb/doc/python.texi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index e9936991c49..af6360ab3f8 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -247,12 +247,14 @@ Some care must be taken when writing Python code to run in @itemize @bullet @item -@value{GDBN} install handlers for @code{SIGCHLD} and @code{SIGINT}. +@value{GDBN} installs handlers for @code{SIGCHLD} and @code{SIGINT}. Python code must not override these, or even change the options using @code{sigaction}. If your program changes the handling of these signals, @value{GDBN} will most likely stop working correctly. Note that it is unfortunately common for GUI toolkits to install a -@code{SIGCHLD} handler. +@code{SIGCHLD} handler. When creating a new Python thread, you can +use @code{gdb.block_signals} or @code{gdb.Thread} to handle this +correctly; @xref{Threading in GDB}. @item @value{GDBN} takes care to mark its internal file descriptors as