From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4DF9A3858D35; Fri, 11 Nov 2022 06:52:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DF9A3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668149555; bh=vzJrEPKvzY0JJM8BKtkV+3du06e5uuV9GO591l0p/og=; h=From:To:Subject:Date:From; b=sa+xb9uAp7IdMURJcue+rc5SUx+SBuHocrEoN/SVv6X09S3LxOT9r/S97uN2SBSZM p2hHOFoO7lS2oQGK/1X3KV9S/ELk5GM1Lgj9m54q5ivQodb+OpiAcWKzz+hZ6SN0Gk Z+GSksItd0zjmxwdvxTCN6Nnb/C+8RM3nQ2Rxd2E= From: "yangyibiao at nju dot edu.cn" To: gdb-prs@sourceware.org Subject: [Bug backtrace/29775] New: An valid address cannot be reached in instruction-level stepping Date: Fri, 11 Nov 2022 06:52:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: backtrace X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: yangyibiao at nju dot edu.cn X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29775 Bug ID: 29775 Summary: An valid address cannot be reached in instruction-level stepping Product: gdb Version: unknown Status: UNCONFIRMED Severity: normal Priority: P2 Component: backtrace Assignee: unassigned at sourceware dot org Reporter: yangyibiao at nju dot edu.cn Target Milestone: --- $ cat small.c /* { dg-do run } */ /* { dg-require-ifunc "" } */ /* { dg-options "" } */ static int implementation (void) { __builtin_printf ("'ere I am JH\n"); return 0; } static __typeof__ (implementation)* resolver (void) { return implementation; } extern int magic (void) __attribute__ ((ifunc ("resolver"))); int main () { return magic () !=3D 0; } $ gcc -O0 -g small.c; gdb a.out GNU gdb (GDB) 13.0.50.20221107-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from a.out... (gdb) b main Breakpoint 1 at 0x40115a: file small.c, line 20. (gdb) r Starting program: /root/DeVIL/a.out Breakpoint 1, main () at small.c:20 20 return magic () !=3D 0; (gdb) si 0x0000000000401030 in *ABS*+0x40114b@plt () (gdb) implementation () at small.c:6 6 { (gdb) 0x0000000000401137 6 { (gdb) 7 __builtin_printf ("'ere I am JH\n"); (gdb) 0x000000000040113f 7 __builtin_printf ("'ere I am JH\n"); (gdb) $ gdb a.out GNU gdb (GDB) 13.0.50.20221107-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from a.out... (gdb) b main Breakpoint 1 at 0x40115a: file small.c, line 20. (gdb) r Starting program: /root/DeVIL/a.out Breakpoint 1, main () at small.c:20 20 return magic () !=3D 0; (gdb) bt -frame-info location-and-address #0 0x000000000040115a in main () at small.c:20 (gdb) s implementation () at small.c:7 7 __builtin_printf ("'ere I am JH\n"); (gdb) bt -frame-info location-and-address #0 0x000000000040113a in implementation () at small.c:7 #1 0x000000000040115f in main () at small.c:20 (gdb) (gdb) maint info line-table objfile: /root/DeVIL/a.out ((struct objfile *) 0x2d42120) compunit_symtab: small.c ((struct compunit_symtab *) 0x2d385b0) symtab: /root/DeVIL/small.c ((struct symtab *) 0x2d38630) linetable: ((struct linetable *) 0x2d92ae0): INDEX LINE ADDRESS IS-STMT PROLOGUE-END 0 6 0x0000000000401136 Y 1 7 0x000000000040113a Y 2 8 0x0000000000401144 Y 3 9 0x0000000000401149 Y 4 12 0x000000000040114b Y 5 13 0x000000000040114f Y 6 14 0x0000000000401154 Y 7 19 0x0000000000401156 Y 8 20 0x000000000040115a Y 9 21 0x0000000000401167 Y 10 END 0x0000000000401169 Y (gdb) We can found that is a valid address, when stepping this program at source level, the address 0x000000000040113a can be reached. However, when stepping at instruction level, the address cannot be reached. --=20 You are receiving this mail because: You are on the CC list for the bug.=