[Bug c++/15369] New: 3.4.0 Compiler emits wrong linenumbers
nikolay at etnus dot com
gcc-bugzilla@gcc.gnu.org
Tue May 11 19:03:00 GMT 2004
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
More information about the Gcc-bugs
mailing list