[llvm-bugs] [Bug 32549] New: Code not executed when using "n"

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 6 03:26:08 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=32549

            Bug ID: 32549
           Summary: Code not executed when using "n"
           Product: lldb
           Version: 3.3
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: fpc at microbizz.nl
                CC: llvm-bugs at lists.llvm.org

Created attachment 18236
  --> https://bugs.llvm.org/attachment.cgi?id=18236&action=edit
Test code to reproduce (requires fpc if you want to build it yourself)

This really weird. It looks like a piece of code is not executed when using "n"
to step through code. When setting multiple breakpoints and "c", the code does
get executed. The not-executed code (I assume, but it could be something else)
assigns an object field to a local variable

    a3Dpt := f3DPt;

but the variable never gets it value when using "n" to step through the code.
Below are the complete terminal proceedings. Note that things work fine when
using GDB instead of LLDB.


[G20:~] adriaan% cd Desktop/Test-LLDB/build/Test-Debug-i386/

[G20:Test-LLDB/build/Test-Debug-i386] adriaan% ls -l
total 416
drwxr-xr-x  7 adriaan  staff     238  4 apr 12:23 Objects
-rwxr-xr-x  1 adriaan  staff  212876  4 apr 12:23 Test
drwxr-xr-x  3 adriaan  staff     102  4 apr 12:23 Test.dSYM

[G20:Test-LLDB/build/Test-Debug-i386] adriaan% lldb -v
lldb-330.0.48

[G20:Test-LLDB/build/Test-Debug-i386] adriaan% lldb Test

(lldb) target create "Test"
Current executable set to 'Test' (i386).

(lldb) process launch --stop-at-entry -o stdout.txt
Process 424 launched:
'/Users/adriaan/Desktop/Test-LLDB/build/Test-Debug-i386/Test' (i386)
Process 424 stopped
* thread #1: tid = 0x116c, 0x8fe01000 dyld`_dyld_start, stop reason = signal
SIGSTOP
    frame #0: 0x8fe01000 dyld`_dyld_start
dyld`_dyld_start:
->  0x8fe01000 <+0>: popl   %edx
    0x8fe01001 <+1>: pushl  $0x0
    0x8fe01003 <+3>: movl   %esp, %ebp
    0x8fe01005 <+5>: andl   $-0x10, %esp

(lldb) breakpoint set --file UDrawObject.pas --line 78
Breakpoint 1: where = Test`DOTEST + 25 at UDrawObject.pas:78, address =
0x0002a4e9

(lldb) c
Process 424 resuming
Process 424 stopped
* thread #1: tid = 0x116c, 0x0002a4e9 Test`DOTEST(this=0x00350020) + 25 at
UDrawObject.pas:78, queue = 'com.apple.main-thread', stop reason = breakpoint
1.1
    frame #0: 0x0002a4e9 Test`DOTEST(this=0x00350020) + 25 at
UDrawObject.pas:78
   75      a3Dpt: t3DPoint;
   76   
   77     BEGIN
-> 78       SetValue;
   79       a3Dpt := f3DPt;
   80   
   81       WRITELN('DoTest');

(lldb) n
Process 424 stopped
* thread #1: tid = 0x116c, 0x0002a50b Test`DOTEST(this=0x00350020) + 59 at
UDrawObject.pas:79, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x0002a50b Test`DOTEST(this=0x00350020) + 59 at
UDrawObject.pas:79
   76   
   77     BEGIN
   78       SetValue;
-> 79       a3Dpt := f3DPt;
   80   
   81       WRITELN('DoTest');
   82       WRITELN('  thePbject.f3Dpt  = ',f3Dpt.x:12:3, f3Dpt.y:12:3,
f3Dpt.z:12:3);

(lldb) frame variable 
error: need to add support for DW_TAG_base_type 'FormalDef' encoded with DW_ATE
= 0x7, bit_size = 0
(TDRAWOBJECT) this = 0x00350020
(T3DPOINT) A3DPT = (X = 2.3942266318434001E-309, Y = -1.9375095375144227, Z =
1.16819093729663E-307)

(lldb) p *this
(TDRAWOBJECT) $0 = {
  FID = 10
  F3DPT = (X = 20, Y = 10, Z = 5)
  FQDPT = {
    V = 0
    H = 0
    VH = ([0] = 0, [1] = 0)
  }
}

(lldb) n
Process 424 stopped
* thread #1: tid = 0x116c, 0x0002a51b Test`DOTEST(this=0x00350020) + 75 at
UDrawObject.pas:81, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: 0x0002a51b Test`DOTEST(this=0x00350020) + 75 at
UDrawObject.pas:81
   78       SetValue;
   79       a3Dpt := f3DPt;
   80   
-> 81       WRITELN('DoTest');
   82       WRITELN('  thePbject.f3Dpt  = ',f3Dpt.x:12:3, f3Dpt.y:12:3,
f3Dpt.z:12:3);
   83       WRITELN('  a3Dpt  = ',a3Dpt.x:12:3, a3Dpt.y:12:3, a3Dpt.z:12:3);
   84     END;

(lldb) frame variable
(TDRAWOBJECT) this = 0x00350020
(T3DPOINT) A3DPT = (X = 2.3942266309882071E-309, Y = -1.9375095375144227, Z =
1.16819093729663E-307)

(lldb) c
Process 424 resuming
Process 424 exited with status = 0 (0x00000000) 

(lldb) q

[G20:Test-LLDB/build/Test-Debug-i386] adriaan% cat stdout.txt 
DoTest
  thePbject.f3Dpt  =       20.000      10.000       5.000
  a3Dpt  =        0.000      -1.938       0.000

[G20:Test-LLDB/build/Test-Debug-i386] adriaan% lldb Test

(lldb) target create "Test"
Current executable set to 'Test' (i386).

(lldb) process launch --stop-at-entry -o stdout.txt
Process 473 launched:
'/Users/adriaan/Desktop/Test-LLDB/build/Test-Debug-i386/Test' (i386)
Process 473 stopped
* thread #1: tid = 0x1786, 0x8fe01000 dyld`_dyld_start, stop reason = signal
SIGSTOP
    frame #0: 0x8fe01000 dyld`_dyld_start
dyld`_dyld_start:
->  0x8fe01000 <+0>: popl   %edx
    0x8fe01001 <+1>: pushl  $0x0
    0x8fe01003 <+3>: movl   %esp, %ebp
    0x8fe01005 <+5>: andl   $-0x10, %esp

(lldb) breakpoint set --file UDrawObject.pas --line 78
Breakpoint 1: where = Test`DOTEST + 25 at UDrawObject.pas:78, address =
0x0002a4e9

(lldb) breakpoint set --file UDrawObject.pas --line 81
Breakpoint 2: where = Test`DOTEST + 75 at UDrawObject.pas:81, address =
0x0002a51b

(lldb) c
Process 473 resuming
Process 473 stopped
* thread #1: tid = 0x1786, 0x0002a4e9 Test`DOTEST(this=0x00350020) + 25 at
UDrawObject.pas:78, queue = 'com.apple.main-thread', stop reason = breakpoint
1.1
    frame #0: 0x0002a4e9 Test`DOTEST(this=0x00350020) + 25 at
UDrawObject.pas:78
   75      a3Dpt: t3DPoint;
   76   
   77     BEGIN
-> 78       SetValue;
   79       a3Dpt := f3DPt;
   80   
   81       WRITELN('DoTest');

(lldb) frame variable 
error: need to add support for DW_TAG_base_type 'FormalDef' encoded with DW_ATE
= 0x7, bit_size = 0
(TDRAWOBJECT) this = 0x00350020
(T3DPOINT) A3DPT = (X = 2.3942266318434001E-309, Y = -1.9375095375144227, Z =
1.16819093729663E-307)

(lldb) p *this
(TDRAWOBJECT) $0 = {
  FID = 10
  F3DPT = (X = 20, Y = 10, Z = 5)
  FQDPT = {
    V = 0
    H = 0
    VH = ([0] = 0, [1] = 0)
  }
}

(lldb) c
Process 473 resuming
Process 473 stopped
* thread #1: tid = 0x1786, 0x0002a51b Test`DOTEST(this=0x00350020) + 75 at
UDrawObject.pas:81, queue = 'com.apple.main-thread', stop reason = breakpoint
2.1
    frame #0: 0x0002a51b Test`DOTEST(this=0x00350020) + 75 at
UDrawObject.pas:81
   78       SetValue;
   79       a3Dpt := f3DPt;
   80   
-> 81       WRITELN('DoTest');
   82       WRITELN('  thePbject.f3Dpt  = ',f3Dpt.x:12:3, f3Dpt.y:12:3,
f3Dpt.z:12:3);
   83       WRITELN('  a3Dpt  = ',a3Dpt.x:12:3, a3Dpt.y:12:3, a3Dpt.z:12:3);
   84     END;

(lldb) frame variable 
(TDRAWOBJECT) this = 0x00350020
(T3DPOINT) A3DPT = (X = 20, Y = 10, Z = 5)

(lldb) c
Process 473 resuming
Process 473 exited with status = 0 (0x00000000) 

(lldb) q

[G20:Test-LLDB/build/Test-Debug-i386] adriaan% cat stdout.txt
DoTest
  thePbject.f3Dpt  =       20.000      10.000       5.000
  a3Dpt  =       20.000      10.000       5.000

[G20:Test-LLDB/build/Test-Debug-i386] adriaan%

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170406/b0ad95ec/attachment-0001.html>


More information about the llvm-bugs mailing list