public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15369] New: 3.4.0 Compiler emits wrong linenumbers
@ 2004-05-11 19:03 nikolay at etnus dot com
  2004-05-11 19:07 ` [Bug c++/15369] " nikolay at etnus dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: nikolay at etnus dot com @ 2004-05-11 19:03 UTC (permalink / raw)
  To: gcc-bugs

Consider this program compiled with 
g++ -g tx_linenumber.cxx -o tx_linenumber
-Wl,-rpath,/home/compilers/gnu/gcc/3.4.0/i386-linux/lib:/home/compilers/gnu/gcc/3.4.0/i386-linux/lib
------------------------------------------
#include <iostream>
#include <string>
#include <vector>

using namespace std;

class test {
public:
  test(int a) {_a = a;_b = a*a;};
  void break_point() { int b=_b; }
  ~test() { };
private:
  int _a;
  int _b;
};

int main()
{

  test t1(1);
  t1.break_point();
  return 0;
}
-------------------------------------------
If you set a breakpoint in any debugger (ddt, Totalview) and run to it, 
the linenumber would be wrong. The readelf -wl shows, that compiler emitted 
wrong linenumber: 

Set File Name to entry 55 in the File Name Table (--> This is wrong file)
  Advance Line by -68 to 9
  Copy
  Extended opcode 2: set Address to 0x80488ca
  Special opcode 11: advance Address by 0 to 0x80488ca and Line by 1 to 10

The problem is, that PC 0x80488ca corresponds to _GLOBAL__I_main() that can be
in file 55.

-- 
           Summary: 3.4.0 Compiler emits wrong linenumbers
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nikolay at etnus dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux
  GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15369


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

end of thread, other threads:[~2005-01-14  3:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-11 19:03 [Bug c++/15369] New: 3.4.0 Compiler emits wrong linenumbers nikolay at etnus dot com
2004-05-11 19:07 ` [Bug c++/15369] " nikolay at etnus dot com
2004-05-11 19:12 ` nikolay at etnus dot com
2004-05-11 19:40 ` [Bug debug/15369] [3.4 Regression] " pinskia at gcc dot gnu dot org
2004-06-21 21:23 ` mmitchel at gcc dot gnu dot org
2004-08-29 18:53 ` mmitchel at gcc dot gnu dot org
2004-10-15  7:39 ` [Bug c++/15369] "Wrong" line number for static constructor function rth at gcc dot gnu dot org
2005-01-14  3:00 ` pinskia at gcc dot gnu dot org

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