Re: [Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-04 Thread Joerg Sonnenberger via lldb-commits
On Wed, Feb 03, 2016 at 12:14:52AM +, Zachary Turner via lldb-commits wrote: > Shouldn't it be possible to force clang to generate code like this? If so > couldn't you write a test for this by stepping over a function call which > has this kind of code in it? Doesn't global inline assembler t

Re: [Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-04 Thread Pavel Labath via lldb-commits
+1 for using IR for hand-crafting tricky functions. On 3 February 2016 at 22:01, Adrian Prantl via lldb-commits wrote: > > On Feb 3, 2016, at 1:58 PM, Zachary Turner wrote: > > I was thinking of a really trivial function that just returned an int or > something. But then again, I don't really

Re: [Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-03 Thread Adrian Prantl via lldb-commits
> On Feb 3, 2016, at 1:58 PM, Zachary Turner wrote: > > I was thinking of a really trivial function that just returned an int or > something. But then again, I don't really know how to write LLVM IR myself > so I was just going off of what other people told me would be possible. I > could b

Re: [Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-03 Thread Zachary Turner via lldb-commits
I was thinking of a really trivial function that just returned an int or something. But then again, I don't really know how to write LLVM IR myself so I was just going off of what other people told me would be possible. I could be wrong :) Maybe not worth worrying about if clang never generates

Re: [Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-03 Thread Adrian Prantl via lldb-commits
For context, here are the relevant LLVM discussions: http://reviews.llvm.org/D16569 (D16569: Emit line 0 line information for interesting 'orphan’ instructions) http://reviews.llvm.org/D9887 [DebugInfo][FastISel] Prevent using debug

Re: [Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-03 Thread Zachary Turner via lldb-commits
I asked around a little bit, and it seems like you do this by hand-writing some LLVM IR (limiting yourself to a subset that is sufficiently platform independent) and having clang link that in alongside a regular executable. Then call your LLVM IR function from C++ and step over it. Would that work

Re: [Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-03 Thread Zachary Turner via lldb-commits
(Also, if clang is not generating code like this currently, maybe it's not a priority, but seems worth mentioning the technique anyway, since it could have a lot of use for these types of scenarios) On Wed, Feb 3, 2016 at 12:54 PM Zachary Turner wrote: > I asked around a little bit, and it seems

Re: [Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-02 Thread Jim Ingham via lldb-commits
I don't think Clang does this right now, but Adrian says they are considering doing it to solve some problems they have with keeping track of nested inlines. Swift does it, but the compiler makes no guarantees as to when this will happen. It isn't controlled by some pragma, builtin or whatever.

Re: [Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-02 Thread Zachary Turner via lldb-commits
Shouldn't it be possible to force clang to generate code like this? If so couldn't you write a test for this by stepping over a function call which has this kind of code in it? On Tue, Feb 2, 2016 at 4:11 PM Jim Ingham via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: jingham > Da

[Lldb-commits] [lldb] r259611 - The compiler may use "line number 0" to indicate compiler generated goo that it can't

2016-02-02 Thread Jim Ingham via lldb-commits
Author: jingham Date: Tue Feb 2 18:07:23 2016 New Revision: 259611 URL: http://llvm.org/viewvc/llvm-project?rev=259611&view=rev Log: The compiler may use "line number 0" to indicate compiler generated goo that it can't track a source for. When we are pushing breakpoints and stepping past funct