From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id F01A93858C50 for ; Mon, 28 Mar 2022 21:59:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F01A93858C50 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 22SLx3I4025849 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Mar 2022 17:59:08 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 22SLx3I4025849 Received: from [10.0.0.193] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (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 1A73D1E150; Mon, 28 Mar 2022 17:59:02 -0400 (EDT) Message-ID: <7afdf076-59f9-4655-0dc8-1ac2f9d07e70@polymtl.ca> Date: Mon, 28 Mar 2022 17:59:02 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCHv3] gdb/python: add gdb.format_address function Content-Language: tl To: Andrew Burgess , gdb-patches@sourceware.org Cc: Andrew Burgess References: <20220304105031.2706582-1-aburgess@redhat.com> <20220307123317.3966024-1-aburgess@redhat.com> <87o81yruo9.fsf@redhat.com> <87ils4sn3n.fsf@redhat.com> From: Simon Marchi In-Reply-To: <87ils4sn3n.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 28 Mar 2022 21:59:03 +0000 X-Spam-Status: No, score=-3033.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2022 21:59:12 -0000 > Hi Simon, > > Sorry for that. I can't reproduce these failures, but I suspect I know > what's going on. Could you try the patch below please and confirm that > this fixes the issues. > > Many thanks, > Andrew > > --- > > commit d6eb0c69d3919a1b3862d29c788415ca9f7bbeb4 > Author: Andrew Burgess > Date: Wed Mar 23 15:23:47 2022 +0000 > > gdb/testsuite: fix copy & paste error in gdb.python/py-format-address.exp > > The test gdb.python/py-format-address.exp, added in commit: > > commit 25209e2c6979c3838e14e099f0333609810db280 > Date: Sat Oct 23 09:59:25 2021 +0100 > > gdb/python: add gdb.format_address function > > Included 3 copy & paste errors where the wrong address was used in the > expected output patterns. > > The test compiles two almost identical test binaries (one function > changes its name, that's the only difference), if the two binaries are > laid out the same by the compiler, and loaded at the same locations in > memory, then the two addresses would have been the same. However, > this is not the case for everyone, and so some folk were seeing test > failures: > > https://sourceware.org/pipermail/gdb-patches/2022-March/186911.html > > This commit fixes the errors by using the correct addresses. Hi Andrew, I looked into this separately because I failed to see your message. In the end I came up with the same change, but the reason the addresses are different is that the executables are PIE. Inferior 1 is running, so the function address is relocated: print /x &foo^M $2 = 0x555555555129^M Inferior 2 is not running, so the function address is unrelocated: print /x &bar^M $3 = 0x1129^M So, the patch LGTM, but you can clarify the commit message if you want. Simon