From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id 1F4F13858D28 for ; Sat, 27 Jan 2024 09:24:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F4F13858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nefkom.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1F4F13858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.18.0.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706347492; cv=none; b=Qu5eWnB+UfJ6Ksi+Gq0q9U9e6HnNbtrtYwQyBXIPBgR6HisBL9cFlMDi8N+LsgBti+av4ifqgZzHPz6bXWAU8PY8mOKWezV9nE1wzO8GY6r/zkn23POlzKaoDCgp3AExoiUMObc0J+1shiLj9DSkhpgr8O7pS6AIaxYPf5iRV4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706347492; c=relaxed/simple; bh=vcccq03cUotnUph6KnBPuXXlsvPsZTJywTo4eWmfVBw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=S2eYwbkCutCuaPs/CThQGQ01uqOLsguoJpQWq68Fy83llUMCpQxYk+0cqsTBsKqrd22I3o6MoxgxQqSjVxaAm3KIoZqcMJO6zHQGS6mVt9KDUCaV/2b7rTZmqd/tV475iLURA8J8yP5sfW0wJqfZPMspW7yhWP6Idbjt1tOkVbw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4TMTfn3fHNz1qsPW; Sat, 27 Jan 2024 10:24:49 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4TMTfn3Dxyz1qqlS; Sat, 27 Jan 2024 10:24:49 +0100 (CET) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id EiGWQRCc-BYb; Sat, 27 Jan 2024 10:24:48 +0100 (CET) X-Auth-Info: NkSlVVt4bc3kBqyjmEO5ZK4cTaK6LVK0Q9+EC1K34CjFtXm90+rhRE+HTctyq/nF Received: from tiger.home (aftr-62-216-202-105.dynamic.mnet-online.de [62.216.202.105]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sat, 27 Jan 2024 10:24:48 +0100 (CET) Received: by tiger.home (Postfix, from userid 1000) id 97B14252082; Sat, 27 Jan 2024 10:24:47 +0100 (CET) From: Andreas Schwab To: Carl Love Cc: gdb-patches@sourceware.org Subject: Re: Help with break in printf function In-Reply-To: <4c92aa19-ca28-44e4-97c6-3b0b4d9da512@linux.ibm.com> (Carl Love's message of "Fri, 26 Jan 2024 14:37:05 -0800") References: <4c92aa19-ca28-44e4-97c6-3b0b4d9da512@linux.ibm.com> X-Yow: Why was I BORN? Date: Sat, 27 Jan 2024 10:24:47 +0100 Message-ID: <87cytn2ko0.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Jan 26 2024, Carl Love wrote: > I then single step to the print statement in main. > > > gdb) s > 23 printf ("value is %d\n", value); > (gdb) s > Downloading source file /usr/src/debug/glibc-2.37-16.fc38.ppc64le/stdio-common/../sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf.c > ___ieee128_printf (format=0x100008f0 "value is %d\n") > at ../sysdeps/ieee754/ldbl-128ibm-compat/ieee128-printf.c:29 > 29 done = __vfprintf_internal (stdout, format, ap, > > I can see that it stepped into an ieee128-printf.c file. But when I print out the location of the breakpoints > > (gdb) maint info breakpoints > Num Type Disp Enb Address What > 1 breakpoint keep y 0x00007ffff7a6f8b8 in __printf at printf.c:28 inf 1 > 1.1 y 0x00007ffff7a6f8b8 in __printf at printf.c:28 inf 1 > 2 breakpoint keep y 0x0000000010000788 in main > at /.../gdb/testsuite/gdb.base/annota1.c:15 inf 1 > > I see the breakpoint is set in a different file printf.c. That's because nothing in the program actually calls the printf function, it calls ___ieee128_printf instead. The function in printf.c implements the pre-ieee128 printf function, and due to compiler magic the printf call in the source is rewritten to __ieee128_printf. > So, it would seem that GDB doesn't know that the test is compiled to use the print routine in ieee128-printf.c? Probably GDB needs to implement some magic to know that printf and __ieee128_printf are somewhat related. Similar issues exist with __isoc99_ and __isoc23_ prefixed symbols for all architectures. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."