Hello Andrew,
I am able fix 2 issues out 3, related to debug information.
Issues:
1. Source code line no info - wrong source code line no displayed with -g.
2. Function names - debug label names displayed instead of function name.
3. source file paths - always absolute path is used, even input to gcc is
relative path.
Issue (1) and (2) are addressed by defining the macros related to DWARF2.
But issue (3) is not fixed.
With native gcc:
===
> gcc align/1.c -g -O2
/tmp/ccgzM4xR.o: In function `main':
align/1.c:5: undefined reference to `one'
---
With crx-elf-gcc:
> cr16-elf-gcc 1.s -g
/tmp/ccC7nNl1.o: In function `main':
/scratch/user/swami/align/1.c:3: undefined reference to `_one'
^^^^^^^^^^^^^^^^^^^
----
NOTE: marked with "^^^^" is expected to wrong.
Could you please suggest reason for the above issue? Thanks in advance.
Thanks
Swami
-------- Original Message --------
Subject: Re: incorrect debug information with -O2 and above options
Date: Thu, 13 Nov 2008 20:54:30 +0530
From: M R Swami Reddy <MR.Swami.Reddy@xxxxxxx>
To: Andrew Haley <aph@xxxxxxxxxx>, "gcc-help@xxxxxxxxxxx" <gcc-help@xxxxxxxxxxx>
References: <491C1DF1.1000908@xxxxxxx> <491C1F84.6040907@xxxxxxxxxx>
Hello Andrew,
Thanks for the reply.
OK. I will fill a PR for this issue.
And the test case is:
===
extern one();
main () { one(); }
===
I tried with all GCC 4.1.x and 4.2.x version. The same problem seen.
Btw, this issue is not seen with native (ie i386) gcc compiler.
Is there any macro definition missing for crx target port?
Thanks
Swami
Andrew Haley wrote:
M R Swami Reddy wrote:
I am using the crx target (ie crx-elf-gcc) compiler. When I compile a
simple
testcase with -g, its showing correct debug information. If I compile the
same testcase with "-g -O2" (-O2 or above optimizations), then compiler
generates wrong debug info. Could you please advise on this issue?
Please file a bug report, with the test case attached.
You have a much better chance of getting the bug fixed if you test with
the latest gcc sources. http://gcc.gnu.org/snapshots.html
Andrew.