From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 431243858C41 for ; Fri, 19 May 2023 21:28:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 431243858C41 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684531686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KV7Msbc7avb1wqkbD5DEXRS/Ynbvii2JIAKOTAY7tQ4=; b=gQ5eYwluwYe+wzRT7oYwDkGPvTB/saEVJE12y66eWUKrz6e0RSofb0sYa0JqJ25Wlcm/8Q haDXa26WrXLeLtL/6nge4Bl8qK4nuFe3M+pMQX+qYmoa88s4kiBXQgjLIOjAWmj7+tQTzf N+GGHvsTfTJ72KkxAQ4ENIvPInvrPvo= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-59-xJyS1WGXODCMMBqkbFBqDA-1; Fri, 19 May 2023 17:28:05 -0400 X-MC-Unique: xJyS1WGXODCMMBqkbFBqDA-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f422dc5ee5so21270235e9.0 for ; Fri, 19 May 2023 14:28:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684531684; x=1687123684; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KV7Msbc7avb1wqkbD5DEXRS/Ynbvii2JIAKOTAY7tQ4=; b=ASz/fnZZD73SElGLTHeNo9jowKtnsJ8aiO8CihT8R/2LJXXQ/N5WY1DNtk8JedTYsN HyhSTfUlRuQVv19e9gQywW4+VLU/OjsjXg18QZhvMvX4rdy3LhK1jwcV5Ng4qNJhTUW7 PoXAFt/NFx9PawEwo15Ag0IKu9kRhZNlSUJlR/SR8bWAt/7D3j3+KJLsDXDKxGw48vPx WJZkrZkQiRPNBfMSWSO7KW6ydCdIvgghTvls6v0eAhrByzum/Lw7g76b7lq6JicgF7hS 6LeWMBwqrCR6jLzXh8vXT60bW1oSqgeQBhnQZx0IGZMKnGoNuikYaDS91d4CIbO/3oW2 PNCA== X-Gm-Message-State: AC+VfDy0P+7cXAxWBuFopN3kReJIwwCxKFqCu9ehHP0nudn1Qmz1vpG0 4pwpsrc2RyguRD2hFhO+PpQ5p6h2wUhd2kHJlj82tY/6gOPR6DedyxgQQaVqZL1OOqcveZybeN1 3aoZzTPHnt4dH5rOnGR4v31oQqTb1xiwmjlV7CUpbJYwr+PsHU1idM2YbvgMQZFdaL9Eyemu90P rUm+A4qw== X-Received: by 2002:a7b:cd01:0:b0:3f1:72ec:4009 with SMTP id f1-20020a7bcd01000000b003f172ec4009mr2125543wmj.9.1684531683796; Fri, 19 May 2023 14:28:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+i/px2DwGqt9SS7BQUSfOPQX0eoz3aOjd55uc0cr9FsJ56wdJqVUbACmst4Lr0SnALVtvdA== X-Received: by 2002:a7b:cd01:0:b0:3f1:72ec:4009 with SMTP id f1-20020a7bcd01000000b003f172ec4009mr2125533wmj.9.1684531683420; Fri, 19 May 2023 14:28:03 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id o9-20020adfeac9000000b0030633152664sm42322wrn.87.2023.05.19.14.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 14:28:02 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv3 0/2] Add __repr__() implementation to a few Python types Date: Fri, 19 May 2023 22:27:56 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: <20230518033357.77174-1-dark.ryu.550@gmail.com> References: <20230518033357.77174-1-dark.ryu.550@gmail.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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: Matheus, Thanks for moving this forward. I took a look through, and I think this looks great. I noticed a few whitespace issues with the patch, so I fixed all of them. But during testing I ended up making a few more changes, so I figured I'd just post what I ended up with. The biggest change you'll see is a whole extra patch. It turns out that the way you were using mdict_size wasn't correct -- mdict_size doesn't always return the number of symbols! As a result the symbol list for block_func (in the py-block.exp test) would end up printed without comma's between the symbols. Anyway, the new first patch fixes this. While we're in py-block.c, I changed the output format. Rather than displaying the symbols one per line, they are now listed all on one line. The multi-line format looks great if all you are displaying is the one object's repr, but if the repr is printed as part of a larger string then I think the multi-line layout doesn't look as good. Now we're only printing a few symbols I figure we can afford to go with a one line layout. On the testing side I've tightened the patterns in py-block.exp, and extended the test to check the ouptut in block_func -- this exposes the mdict_size issue. I've added some tests for gdb.BreakpointLocation, which were missing. And I've made the patterns in py-breakpoint.exp more precise, and added some additional tests to catch more cases. Would be great to hear your thoughts on the updates, Thanks, Andrew --- Andrew Burgess (1): gdb: have mdict_size always return a symbol count Matheus Branco Borella via Gdb-patches (1): gdb: add __repr__() implementation to a few Python types gdb/dictionary.c | 13 +++- gdb/dictionary.h | 3 +- gdb/python/py-arch.c | 17 ++++- gdb/python/py-block.c | 37 ++++++++++- gdb/python/py-breakpoint.c | 67 ++++++++++++++++++- gdb/python/py-symbol.c | 15 ++++- gdb/python/py-type.c | 30 ++++++++- gdb/symmisc.c | 2 +- gdb/testsuite/gdb.python/py-arch.exp | 6 ++ gdb/testsuite/gdb.python/py-block.c | 31 +++++++++ gdb/testsuite/gdb.python/py-block.exp | 38 ++++++++++- gdb/testsuite/gdb.python/py-bp-locations.exp | 32 +++++++++ gdb/testsuite/gdb.python/py-breakpoint.exp | 69 +++++++++++++++++--- gdb/testsuite/gdb.python/py-symbol.exp | 2 + gdb/testsuite/gdb.python/py-type.exp | 4 ++ 15 files changed, 343 insertions(+), 23 deletions(-) base-commit: e84060b489746d031ed1ec9e7b6b39fdf4b6cfe3 -- 2.25.4