public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61574] New: Confusing .debug_line generation by -g option
@ 2014-06-20 18:23 jamesgua at ca dot ibm.com
  2014-06-20 20:05 ` [Bug c++/61574] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jamesgua at ca dot ibm.com @ 2014-06-20 18:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61574

            Bug ID: 61574
           Summary: Confusing .debug_line generation by -g option
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamesgua at ca dot ibm.com

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char** argv)
{
  string str1 = "Hello";
  string str2;

  str2 = str1;
  cout << "str2: " << str2 << ", and same as str1: " << str1 << endl;

  str2 += "World!";
  cout << "Now str2: " << str2 << endl;

  return 0;
}

g++ -g -osample sample.cpp
gdb ./sample
...
Breakpoint 1, main (argc=1, argv=0x3ffffffff4f8) at sample.cpp:17
17        return 0;
(gdb) n
9         string str2;
(gdb)
17        return 0;
(gdb)
18      }
...
This is really confusing and out of sequential execution expectation. It
happens on x86_64/ppcl4le platform using g++ 4.8.2. 
Output from cmd: readelf --debug-dump=decodedline sample
...
sample.cpp                                    17          0x10000e90
sample.cpp                                     9          0x10000e94
sample.cpp                                    17          0x10000ea4
sample.cpp                                     9          0x10000ee4
sample.cpp                                    17          0x10000efc
...


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

end of thread, other threads:[~2014-06-23 11:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-20 18:23 [Bug c++/61574] New: Confusing .debug_line generation by -g option jamesgua at ca dot ibm.com
2014-06-20 20:05 ` [Bug c++/61574] " pinskia at gcc dot gnu.org
2014-06-22  1:32 ` jamesgua at ca dot ibm.com
2014-06-22  2:44 ` pinskia at gcc dot gnu.org
2014-06-23 11:52 ` jamesgua at ca dot ibm.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).