[lldb-dev] Line number resolution problem

Mario Zechner badlogicgames at gmail.com
Wed Oct 8 05:10:55 PDT 2014


Hi,

i'm currently trying to track down the following issue. We create LLVM IR
like this
compilation unit: JdwpThreads.java
   ; line 8
   %t16 = load %Object** %$r6, !dbg !{i32 8, i32 0, metadata !33, null}
    store %Object* %t16, %Object** %r4, !dbg !{i32 8, i32 0, metadata !33,
null}

    ; line 19
    call void @"llvm.dbg.declare"(metadata !{%Object** %r4}, metadata !38),
!dbg !{i32 19, i32 0, metadata !34, null}
    %t17 = load %Object** %r4, !dbg !{i32 19, i32 0, metadata !34, null}
    call void
@"[j]java.lang.Thread.start()V[Invokevirtual(com/robovm/debug/server/apps/JdwpThreads,java/lang/Thread)]"(%Env*
%p0, %Object* %t17), !dbg !{i32 19, i32 0, metadata !34, null}

    ; line 20
    %t18 = trunc i32 0 to i8, !dbg !{i32 20, i32 0, metadata !34, null}
    call void
@"[j]com.robovm.debug.server.apps.JdwpThreads.stopped(Z)[set]"(%Env* %p0,
i8 %t18), !dbg !{i32 20, i32 0, metadata !34, null}

    ; line 21
    %t19 = load %Object** %r4, !dbg !{i32 21, i32 0, metadata !34, null}
    call void
@"[j]java.lang.Thread.join()V[Invokevirtual(com/robovm/debug/server/apps/JdwpThreads,java/lang/Thread)]"(%Env*
%p0, %Object* %t19), !dbg !{i32 21, i32 0, metadata !34, null}

When setting a breakpoint for line 19 or 20 in that compilation unit, LLDB
resolves it to line 21

(lldb) br set -f JdwpThreads.java -l 19

Breakpoint 1: where =
JdwpThreadTest`[J]com.robovm.debug.server.apps.JdwpThreads.main([Ljava/lang/String;)V
+ 282 at JdwpThreads.java:21, address = 0x0028531f

(lldb) br set -f JdwpThreads.java -l 20

Breakpoint 2: where =
JdwpThreadTest`[J]com.robovm.debug.server.apps.JdwpThreads.main([Ljava/lang/String;)V
+ 282 at JdwpThreads.java:21, address = 0x0028531f

The functions being called are all inlined functions. I suspected that to
be the issue but don't know how to resolve it.

I'm a bit puzzled as to why that is and would appreciate any pointers. I
can provide a Mac OS X binary or a dwarfdump if required.

Thanks,
Mario
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20141008/bba72d8f/attachment.html>


More information about the lldb-dev mailing list