Questions about attaching DWARF source code debugging information to generated LLVM-IR.

I upgraded my versions of llvm, clang and compiler-rt to the top-of-tree versions from last night (r180162, April 24).

I recompiled debug versions of llvm, clang and my code.

I then regenerated my test case and the results were the same - I can list lines of dwarf1.lsp in lldb but I can't set break-points or do anything else (what else should I be able to do?).

The updated file that describes the test case is at: https://dl.dropboxusercontent.com/u/6229900/dwarf1_new.txt

I did have to make a few changes to my code to make it work with the latest llvm.
In particular DIBuilder::createCompileUnit required an additional parameter "SplitName".
But when I added that parameter and fixed a few other things the results were the same.

I think I'm generating the DWARF compile_unit, subprogram, lexical-block, and line-number information correctly but I can't seem to get it to work with lldb.

If anyone can take a look at it and suggest what I'm doing wrong or suggest tools that I can use to debug this problem - I'd greatly appreciate it.

Best,

.Chris.

One other thing that may or may not illuminate the situation.

When I run under gdb (on OS X 10.8.3 this is an ancient version of gdb 6.3.5 - but it works with clang compiled C++ code) I get the following error when I try to list a line in dwarf1.lsp:

Dwarf Error: Cannot handle DW_FORM_<unknown> in DWARF reader [in module /Users/meister/Development/cando/src/tests/core/dwarf1.bundle]
(gdb)

---------- full gdb transcript follows ----------

(gdb) run
Reading symbols for shared libraries ++++++++++++++++++++++.............................. done
Using lisp-source-directory --> /Users/meister/Development/cando/src/lisp
../../src/core/lisp.cc:206 BRIDGE-COMMON-LISP startup
../../src/core/corePackage.cc:393 - exported symbol[*LOAD-VERBOSE*]
../../src/core/foundation.cc:627 - The symbol[LOGIOR] has already been assigned a function and will not be redefined
../../src/core/foundation.cc:627 - The symbol[NAN] has already been assigned a function and will not be redefined
Loading interpreted file: /Users/meister/Development/cando/src/lisp/brcl/cmp/jit-setup.lsp
Currently the (LOG x) macro is: ( LOG X )
Compiler LOG macro will slow down compilation

Useful commands:
(load-boot stage &key :interp t ) - Load the minimal system
(compile-boot stage &key :reload t) - Compile whatever parts of the system have changed
(clean-boot stage) - Remove all boot files after after-file
Available modules: ( LSP/FOUNDATION LSP/EXPORT LSP/DEFMACRO LSP/HELPFILE LSP/EVALMACROS LSP/LOGGING LSP/MAKEARRAY :TINY :PRE-CMP CMP/CMPSETUP CMP/CMPGLOBALS CMP/CMPVAR CMP/COMPILE-MAIN CMP/LLVM-IR CMP/EXCEPTION-HANDLING CMP/DEBUGINFO CMP/LAMBDA-LIST CMP/COMPILE-VAR-LOOKUPS CMP/CMPQUOTE CMP/COMPILER CMP/COMPILE-FILE CMP/COMPILE-BUNDLE CMP/CMPWALK LSP/SETF LSP/SETFREST LSP/LISTLIB :CMP :STAGE1 LSP/PREDLIB LSP/SHARPMACROS LSP/CMUUTIL LSP/SEQMACROS LSP/SEQLIB LSP/SEQ LSP/ASSERT LSP/DEFSTRUCT LSP/IOLIB LSP/MODULE LSP/TRACE LSP/LOOP2 LSP/PACKLIB LSP/DEFPACKAGE LSP/FORMAT :STAGE2 CLOS/PACKAGE CLOS/HIERARCHY CMP/CMPREPL CLOS/CPL CLOS/STD-SLOT-VALUE CLOS/SLOT CLOS/BOOT CLOS/KERNEL CLOS/METHOD CLOS/COMBIN CLOS/STD-ACCESSORS CLOS/DEFCLASS CLOS/SLOTVALUE CLOS/STANDARD CLOS/BUILTIN CLOS/CHANGE CLOS/STDMETHOD CLOS/GENERIC CLOS/FIXUP :FRONT CLOS/CONDITIONS CLOS/PRINT CLOS/STREAMS LSP/PPRINT :CLOS )

BRIDGE-COMMON-LISP (copyright Christian E. Schafmeister 2013) - 1.0

(defun gdb () (break "break"))

; --> #<INTERPRETED :name GDB :llh #<LAMBDA-LIST-HANDLER :ClassifiedSymbols Cons_O::nil :comment ""> :environment #[VALUE-ENVIRONMENT :id 27874
      ----NO METADATA----
       ]
:declares Cons_O::nil :docstring """" :code ((BLOCK GDB ( BREAK "break" ) ) ) >

(load-bundle "dwarf1.bundle")

Reading symbols for shared libraries .... done
Found function ___user_dwarf1 at address 0x1057ab7d0

("First line x -->" 1 )
"second line" break
../../src/core/primitives.cc:354 af_debug --> nil
  Frame 9, file "-StringInStream-", line 1, col 16, iL-Func, in BREAK
       ( BREAK "break" )
The following restarts are available:
ABORT a Abort to REPL
Frame-9-Dbg(+ENV)[1]>
Program received signal SIGINT, Interrupt.
0x00007fff95666ffa in read ()
(gdb) l dwarf1.lsp:1
Dwarf Error: Cannot handle DW_FORM_<unknown> in DWARF reader [in module /Users/meister/Development/cando/src/tests/core/dwarf1.bundle]
(gdb)

Oh, and I cooked up a bogus function type for all of the functions - it returns an i32 and takes no arguments.
I was hoping that I could defer dealing with types until later down the road.

Could that be my problem here?

Best,

.Chris.