[llvm-dev] Why LLVM doesn't have debug information of function right parentheses?
Robinson, Paul via llvm-dev
llvm-dev at lists.llvm.org
Thu Aug 3 07:13:27 PDT 2017
I've had this request from my users as well, but it has never been high enough on the priority list to look at closely.
I think it would be feasible to have the actual ret instruction associated with the closing brace, while the load/computation of the return value would be associated with the `return` statement; but that's as far as I got when I looked at this before.
--paulr
P.S. The word "parenthesis" plural "parentheses" refers specifically to these characters: ( )
Generally [ ] are "square brackets" or sometimes just "brackets" while { } are called "braces" or "curly brackets."
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Frozen via llvm-dev
Sent: Wednesday, August 02, 2017 11:19 PM
To: llvm-dev at lists.llvm.org
Subject: [llvm-dev] Why LLVM doesn't have debug information of function right parentheses?
Simple Case:
1.int main()
2.{
3. int i = 0;
4. return 0;
5.}
compile command: clang -g a.c
In LLVM IR, we have one attribute named "scopeLine" to indicate the left parentheses. But we don't have one attribute to indicate the right parentheses (line 5 in this example).
So if we use gdb to debug it:
(gdb) b main
Breakpoint 1 at 0x100005c8: file a.c, line 3.
(gdb) r
Breakpoint 1, main () at a.c:3
3 int i = 0;
Missing separate debuginfos,
(gdb) n
4 return 0;
(gdb) n
0x00003fffb7db4580 in generic_start_main.isra.0
We can not stop at line 5.
But GCC can stop at line 5
(gdb) b main
Breakpoint 1 at 0x100005e0: file a.c, line 3.
(gdb) r
Breakpoint 1, main () at a.c:3
3 int i = 0;
Missing separate debuginfos
(gdb) n
4 return 0;
(gdb) n
5 }
(gdb)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170803/727d847d/attachment-0001.html>
More information about the llvm-dev
mailing list