I found the solution to why my DWARF metadata was not visible to lldb

Folks,

A couple of days ago I posted that I was having problems accessing DWARF line-number metadata from lldb.

The solution turned out to be to declare my functions "internal" rather than "private" within the llvm-IR.

When my function is defined as follows it is debuggable (image dump line-table XXX works and I can set breakpoints).

define internal void @repl({ i32*, {}*, i32 }* %result-ptr, { i32*, {}* }* %activation-frame-ptr) {
entry:
  %exn.slot = alloca i8*, align 8
  %ehselector.slot = alloca i32, align 4
  store i32 0, i32* %ehselector.slot, align 4
  %LET = alloca { i32*, {}* }, align 8
  call void @newAFsp({ i32*, {}* }* %LET)
...

When my function is defined as below it is NOT debuggable:

define private void @repl({ i32*, {}*, i32 }* %result-ptr, { i32*, {}* }* %activation-frame-ptr) {
entry:
  %exn.slot = alloca i8*, align 8
  %ehselector.slot = alloca i32, align 4
  store i32 0, i32* %ehselector.slot, align 4
  %LET = alloca { i32*, {}* }, align 8
  call void @newAFsp({ i32*, {}* }* %LET)
  %call-args = alloca { i32*, {}* }, align 8
  call void @newAFsp({ i32*, {}* }* %call-args)
  %call-args1 = alloca { i32*, {}* }, align 8

Does anyone know why this is?

I can provide sample files for anyone who wants to verify this.

Best,

.Chris.