public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "yangyibiao at nju dot edu.cn" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/30351] New: An vaid address cannot be reached in instruction-level stepping
Date: Fri, 14 Apr 2023 02:59:43 +0000	[thread overview]
Message-ID: <bug-30351-4717@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2023-04-14  2:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14  2:59 yangyibiao at nju dot edu.cn [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30351-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).