public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30351] New: An vaid address cannot be reached in instruction-level stepping
@ 2023-04-14  2:59 yangyibiao at nju dot edu.cn
  2023-04-14  3:00 ` [Bug gdb/30351] " yangyibiao at nju dot edu.cn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: yangyibiao at nju dot edu.cn @ 2023-04-14  2:59 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30351

            Bug ID: 30351
           Summary: An vaid address cannot be reached in instruction-level
                    stepping
           Product: gdb
           Version: 13.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: yangyibiao at nju dot edu.cn
  Target Milestone: ---

Created attachment 14824
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14824&action=edit
triggering source code

$ cat small.c
__attribute__((always_inline))
inline void foo(int *x) {
  *x = 0;
}

int main() {
  int x;
  foo(&x);
  return x;
}


$ gdb -q a.out
Reading symbols from a.out...
(gdb) start
Temporary breakpoint 1 at 0x401112: file small.c, line 8.
Starting program: /root/devil/batch/a.out 

Temporary breakpoint 1, main () at small.c:8
8         foo(&x);
(gdb) s
foo (x=0x7fffffffe384) at small.c:3
3         *x = 0;
(gdb) bt -frame-info location-and-address
#0  0x0000000000401112 in foo (x=0x7fffffffe384) at small.c:3
#1  0x0000000000401112 in main () at small.c:8
(gdb) 



$ gdb -q a.out
Reading symbols from a.out...
(gdb) start
Temporary breakpoint 1 at 0x401112: file small.c, line 8.
Starting program: /root/devil/batch/a.out 

Temporary breakpoint 1, main () at small.c:8
8         foo(&x);
(gdb) si
0x0000000000401116 in foo (x=0x7fffffffe384) at small.c:3
3         *x = 0;
(gdb) si
4       }
(gdb) si
main () at small.c:9
9         return x;
(gdb) si
10      }
(gdb) si
0x0000000000401121      10      }
(gdb)



$ readelf --debug-dump=decodedline a.out
Contents of the .debug_line section:

small.c:
File name                            Line number    Starting address    View   
Stmt
small.c                                        6            0x401106           
   x
small.c                                        3            0x401112           
   x
small.c                                        4            0x40111c           
   x
small.c                                        9            0x40111d           
   x
small.c                                       10            0x401120           
   x
small.c                                        -            0x401122


/******************************
We can found that the address is hit in source-level stepping. However, it was
missed in the instruction-level stepping. I was wondering that this might be a
bug of GDB. We can found that this address is an valid address which has debug
information. 
*******************************/

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-git/configure --enable-languages=c,c++
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20221107 (experimental) (GCC) 


$ gdb -v
GNU gdb (GDB) 13.0.50.20221107-git
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/30351] An vaid address cannot be reached in instruction-level stepping
  2023-04-14  2:59 [Bug gdb/30351] New: An vaid address cannot be reached in instruction-level stepping yangyibiao at nju dot edu.cn
@ 2023-04-14  3:00 ` yangyibiao at nju dot edu.cn
  2023-04-14  3:02 ` yangyibiao at nju dot edu.cn
  2023-04-14  4:55 ` yangyibiao at nju dot edu.cn
  2 siblings, 0 replies; 4+ messages in thread
From: yangyibiao at nju dot edu.cn @ 2023-04-14  3:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30351

Yibiao Yang <yangyibiao at nju dot edu.cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org,
                   |                            |vries at gcc dot gnu.org,
                   |                            |yangyibiao at nju dot edu.cn

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/30351] An vaid address cannot be reached in instruction-level stepping
  2023-04-14  2:59 [Bug gdb/30351] New: An vaid address cannot be reached in instruction-level stepping yangyibiao at nju dot edu.cn
  2023-04-14  3:00 ` [Bug gdb/30351] " yangyibiao at nju dot edu.cn
@ 2023-04-14  3:02 ` yangyibiao at nju dot edu.cn
  2023-04-14  4:55 ` yangyibiao at nju dot edu.cn
  2 siblings, 0 replies; 4+ messages in thread
From: yangyibiao at nju dot edu.cn @ 2023-04-14  3:02 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30351

--- Comment #1 from Yibiao Yang <yangyibiao at nju dot edu.cn> ---
command for compilation is :

$ gcc -O0 -g small.c

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/30351] An vaid address cannot be reached in instruction-level stepping
  2023-04-14  2:59 [Bug gdb/30351] New: An vaid address cannot be reached in instruction-level stepping yangyibiao at nju dot edu.cn
  2023-04-14  3:00 ` [Bug gdb/30351] " yangyibiao at nju dot edu.cn
  2023-04-14  3:02 ` yangyibiao at nju dot edu.cn
@ 2023-04-14  4:55 ` yangyibiao at nju dot edu.cn
  2 siblings, 0 replies; 4+ messages in thread
From: yangyibiao at nju dot edu.cn @ 2023-04-14  4:55 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30351

Yibiao Yang <yangyibiao at nju dot edu.cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #2 from Yibiao Yang <yangyibiao at nju dot edu.cn> ---
Sorry. This might be not a bug. When the program stopped at the 'start' the
program, the address of 0x0000000000401112 is reached. 

However, I am curious why both line 8 and line 3 mapped to the address of
0x0000000000401112 as Line 8 has no debug information.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-14  4:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-14  2:59 [Bug gdb/30351] New: An vaid address cannot be reached in instruction-level stepping yangyibiao at nju dot edu.cn
2023-04-14  3:00 ` [Bug gdb/30351] " yangyibiao at nju dot edu.cn
2023-04-14  3:02 ` yangyibiao at nju dot edu.cn
2023-04-14  4:55 ` yangyibiao at nju dot edu.cn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).