public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26594] New: 'info line' does not print all corresponding addresses
@ 2020-09-09 22:23 trass3r at gmail dot com
  2020-09-10 13:08 ` [Bug gdb/26594] " trass3r at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: trass3r at gmail dot com @ 2020-09-09 22:23 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26594
           Summary: 'info line' does not print all corresponding addresses
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: trass3r at gmail dot com
  Target Milestone: ---

#include <string>

template <typename T>
int foo(T t)
{
        return 0;
}

int main(int argc, const char* argv[])
{
        return foo(0.5f) + foo(5);
}

$ info line test.cpp:6
Line 6 of "test.cpp" starts at address 0x55555555516c <foo<float>(float)+13>
and ends at 0x555555555171 <foo<float>(float)+18>.

It should also give the address inside foo<int> which it does know about:

$ -symbol-list-lines test.cpp
lines:
[{pc=0x0000555555555129,line=10},{pc=0x000055555555513d,line=11},{pc=0x000055555555514c,line=11},{pc=0x0000555555555156,line=11},{pc=0x0000555555555158,line=12},{pc=0x000055555555515f,line=0},{pc=0x000055555555515f,line=4},{pc=0x000055555555516c,line=6},{pc=0x0000555555555171,line=7},{pc=0x0000555555555173,line=0},{pc=0x0000555555555173,line=4},{pc=0x000055555555517e,line=6},{pc=0x0000555555555183,line=7},{pc=0x0000555555555185,line=0}]


This is necessary to properly implement jump support in IDEs
as a simple jump test.cpp:6 fails: "Unreasonable jump request"
https://github.com/bminor/binutils-gdb/blob/6d2f9adc6709572e9ef70f11961819e27b918568/gdb/infcmd.c#L1083-L1086

Interestingly the code is written with multiple matches in mind but passes the
DECODE_LINE_LIST_MODE flag:
https://github.com/bminor/binutils-gdb/blob/a3d674e0226291747cbfac9c73250e5193c06a57/gdb/source.c#L1465-L1474


Also the info line functionality is totally missing from MI.
https://sourceware.org/bugzilla/show_bug.cgi?id=13687

-- 
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:[~2024-04-04 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09 22:23 [Bug gdb/26594] New: 'info line' does not print all corresponding addresses trass3r at gmail dot com
2020-09-10 13:08 ` [Bug gdb/26594] " trass3r at gmail dot com
2024-04-04 17:18 ` tromey at sourceware dot org
2024-04-04 18:54 ` trass3r at gmail dot com

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).