From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D19023858031 for ; Thu, 9 Feb 2023 19:52:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D19023858031 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.192] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5F6761E110; Thu, 9 Feb 2023 14:52:49 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1675972369; bh=GErmwrA073eABquqpjL0BImgPoXAB7Exmgp6VUWm548=; h=Date:Subject:To:References:From:In-Reply-To:From; b=fSSlX0hyKDHKBQMz5Uak+PqL3vwkFsOfPB0sY75eye4wBEg0ILliwZ0iqNxdTrspZ 5jC8fvCw2Lfo5jXa4djFAyiTs5zHfGQCM5wf3/rUDAVRKEFSnpZ1qX6WCQEAu5o7bV Fd1A9g5ZGHq3TGuBW6jwjeOzKnTwPpXaA4imF6+E= Message-ID: <50b79f54-f61b-f5aa-221c-6554ea53c001@simark.ca> Date: Thu, 9 Feb 2023 14:52:48 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] gdb: add HtabPrinter to gdb-gdb.py.in Content-Language: fr To: Simon Marchi , gdb-patches@sourceware.org References: <20230209195056.100681-1-simon.marchi@efficios.com> From: Simon Marchi In-Reply-To: <20230209195056.100681-1-simon.marchi@efficios.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_PASS,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 List-Id: > diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py.in > index 95b7d84966f0..31ce80bb1e44 100644 > --- a/gdb/gdb-gdb.py.in > +++ b/gdb/gdb-gdb.py.in > @@ -369,6 +369,40 @@ class IntrusiveListPrinter: > return self._children_generator() > > > +class HtabPrinter: > + """Pretty-printer for htab_t hash tables.""" > + > + def __init__(self, val): > + self._val = val > + self._entries = val["entries"] > + self._size = int(val["size"]) Just after sending, I realized that _entries and _size aren't necessary. I removed them locally. Simon