From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id ECC63385735D for ; Fri, 5 Jan 2024 13:31:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECC63385735D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ECC63385735D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704461496; cv=none; b=HgRrRF48XEMZFJrW9LAPyD/+mXVhlMBIDzAMyX2PV0YxxcHu3nOX+41TeIJ9Hu17PlYbgvC1VH0PKCClYNcwYTAmCkzcY0NqA/7/w813pts6kWcav7OVfPt468DuTh+D2we6TMBDZipA4H7+s/ThVodxq6QqPuNDv/1KbibavRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704461496; c=relaxed/simple; bh=x2GM/YKwmf2NLRGnaPYdZ+XIFXsscAs8m1xPKABE7Z4=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=hQCVVYFNn7fWpOhF6K3DVnE+XeUoa6f0ddwFYdNSBOcKdtT/pKInlZdwYDKenCeQZ8CiFZo0nyPoJrmkPbF4dQw7H1rrA1bBRsrt3+SM2OzWGwnKTTbL2MW1aO0oWX4EghUYAZGm/hQl+J7lIFhFEmoYfzMrhxb26YKdbhGZL9w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rLkIN-0005eH-G9; Fri, 05 Jan 2024 08:31:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=pjRcnuxGy1RxmRiwJmrmQV2kVY4ew+JLw/vzPwZU8KE=; b=P5Xy89jYbVur OaVxdqV89E3moQr2MGHjIOKfR/dvJO7qjupfsObK7fnhzCyt4JQbyjI6aXSrOP5kCS7Phs7dIOs0i JL8hdFBvrPsZ2rihf2yY+7UZKyE8ZR6xar4fSUUSb9LjjmOpPY6d1TZptNK9+QXML7p4mq32g584N IuSGzyyE6NguJnJK2Y7MaBjqBFqypOAQ+BIvJxK5HAhD2+Sb3BzTIAf/xBV/oFyuuDnHj9ZYhrCvA nAHUKK1wNsXXGFfnFTY8jU4ypk4cf+Kj/guh5mkqkhGq6lwT/Mc3Q/k/z7m05SPguvdNtg14ZL4a8 53oFevoRRiCH7IoNE8TKVg==; Date: Fri, 05 Jan 2024 15:31:20 +0200 Message-Id: <83jzonvrdj.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org, aburgess@redhat.com In-Reply-To: <6fdf97c5f147a7e71fc0ca4de9e49961c067bae1.1704455158.git.aburgess@redhat.com> (message from Andrew Burgess on Fri, 5 Jan 2024 11:48:35 +0000) Subject: Re: [PATCH 6/6] gdb/python: Add gdb.InferiorThread.__dict__ attribute References: <6fdf97c5f147a7e71fc0ca4de9e49961c067bae1.1704455158.git.aburgess@redhat.com> X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,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: > From: Andrew Burgess > Cc: Andrew Burgess > Date: Fri, 5 Jan 2024 11:48:35 +0000 > > diff --git a/gdb/NEWS b/gdb/NEWS > index 500d5ab7160..c4862a8beb6 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -96,6 +96,10 @@ show remote thread-options-packet > these will be stored in the object's new Inferior.__dict__ > attribute. > > + ** User defined attributes can be added to a gdb.InferiorThread > + object, these will be stored in the object's new > + InferiorThread.__dict__ attribute. This part is OK. > +@smallexample > +(gdb) python > +import datetime > + > +def thread_stopped(event): > + if event.inferior_thread is not None: > + thread = event.inferior_thread > + else: > + thread = gdb.selected_thread() > + thread._last_stop_time = datetime.datetime.today() > + > +gdb.events.stop.connect(thread_stopped) > +(gdb) file /tmp/hello > +Reading symbols from /tmp/hello... > +(gdb) start > +Temporary breakpoint 1 at 0x401198: file /tmp/hello.c, line 18. > +Starting program: /tmp/hello > + > +Temporary breakpoint 1, main () at /tmp/hello.c:18 > +18 printf ("Hello World\n"); > +(gdb) python print(gdb.selected_thread()._last_stop_time) > +2024-01-04 14:48:41.347036 > +@end smallexample When you have an @example that consists of more than just a couple of lines, and has empty lines in it, it is a good idea to divide it into separate parts using @group..@end group. This will make sure that in the printed manual such @group's will never be split across pages, thus making it easier to read the example. Thanks. Reviewed-By: Eli Zaretskii