> On Jul 24, 2019, at 7:23 AM, Scott Funkenhauser
> wrote:
>
> I've tried with LLVM 4, 7 and 8. They all fail to evaluate 'sizeof(foo)'.
>
The fundamental problem is that DWARF doesn't represent templates per se. It
only represents template instantiations. So there's nothing in the debug
I've tried with LLVM 4, 7 and 8. They all fail to
evaluate 'sizeof(foo)'.
I'm also building with '-g' which might be why 'sizeof(foo)' succeeds
for me, but fails for you.
On Tue, Jul 23, 2019 at 9:07 PM Jim Ingham wrote:
> Interesting... What lldb & clang were you using? With current TOT clan
Interesting... What lldb & clang were you using? With current TOT clang &
lldb I see:
(lldb) run
Process 83732 launched: '/tmp/template2' (x86_64)
Process 83732 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x00010fad template2`main at
I built with both clang and gcc, the behavior is the same (lldb fails to
evaluate the expression, gdb succeeds).
Trying to evaluate a template type that hasn't been instantiated fails in
both lldb and gdb.
ie.
(gdb) p sizeof(foo)
No symbol "foo" in current context.
(lldb) p sizeof(foo)
error: impl
lldb can't currently create new template instantiations. It can only access
ones that were generated in the binary you were debugging. The debug
information doesn't have any code, so we can't create new instantiations from
there. Having the debugger try to include headers into the expression