[lldb-dev] [Bug 23329] New: Disassemble with mixed source show more source code then reasonable
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Apr 23 07:14:15 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=23329
Bug ID: 23329
Summary: Disassemble with mixed source show more source code
then reasonable
Product: lldb
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: lldb-dev at cs.uiuc.edu
Reporter: tberghammer at google.com
Classification: Unclassified
LLDB displays 3 line of source code in each source block in assembly when the
display of the source code is requested inside the assembly code ("disassamble
-m").
Current result of a "disassamble -m" (source of Test-rdar-10449092.py on
android arm):
(lldb) dis -m
a.out`main at main.cpp:19
18 int main ()
19 {
20 struct foo mine = {0x001122AA, 0x1122BB44};
a.out`main:
0x2a0004d8 <+0>: push {r11, lr}
0x2a0004dc <+4>: add r11, sp, #4
0x2a0004e0 <+8>: sub sp, sp, #8
a.out`main + 12 at main.cpp:20
19 {
20 struct foo mine = {0x001122AA, 0x1122BB44};
21 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
0x2a0004e4 <+12>: ldr r2, [pc, #0x8c] ; <+160> at main.cpp:27
0x2a0004e8 <+16>: add r2, pc, r2
0x2a0004ec <+20>: sub r3, r11, #12
0x2a0004f0 <+24>: ldm r2, {r0, r1}
0x2a0004f4 <+28>: stm r3, {r0, r1}
a.out`main + 32 at main.cpp:21
20 struct foo mine = {0x001122AA, 0x1122BB44};
21 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
22 mine.first = 0xAABBCCDD; // Set break point at this line.
0x2a0004f8 <+32>: ldr r2, [r11, #-0xc]
0x2a0004fc <+36>: ldr r3, [r11, #-0x8]
0x2a000500 <+40>: ldr r1, [pc, #0x74] ; <+164> at main.cpp:27
0x2a000504 <+44>: add r1, pc, r1
0x2a000508 <+48>: mov r0, r1
0x2a00050c <+52>: mov r1, r2
0x2a000510 <+56>: mov r2, r3
0x2a000514 <+60>: bl 0x2a0003e0
a.out`main + 64 at main.cpp:22
21 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
22 mine.first = 0xAABBCCDD; // Set break point at this line.
23 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
0x2a000518 <+64>: ldr r3, [pc, #0x60] ; <+168> at main.cpp:27
-> 0x2a00051c <+68>: str r3, [r11, #-0xc]
a.out`main + 72 at main.cpp:23
22 mine.first = 0xAABBCCDD; // Set break point at this line.
23 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
24 mine.second = 0xFF00FF00;
0x2a000520 <+72>: ldr r2, [r11, #-0xc]
0x2a000524 <+76>: ldr r3, [r11, #-0x8]
0x2a000528 <+80>: ldr r1, [pc, #0x54] ; <+172> at main.cpp:27
0x2a00052c <+84>: add r1, pc, r1
0x2a000530 <+88>: mov r0, r1
0x2a000534 <+92>: mov r1, r2
0x2a000538 <+96>: mov r2, r3
0x2a00053c <+100>: bl 0x2a0003e0
a.out`main + 104 at main.cpp:24
23 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
24 mine.second = 0xFF00FF00;
25 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
0x2a000540 <+104>: ldr r3, [pc, #0x40] ; <+176> at main.cpp:27
0x2a000544 <+108>: str r3, [r11, #-0x8]
a.out`main + 112 at main.cpp:25
24 mine.second = 0xFF00FF00;
25 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
26 return 0;
0x2a000548 <+112>: ldr r2, [r11, #-0xc]
0x2a00054c <+116>: ldr r3, [r11, #-0x8]
0x2a000550 <+120>: ldr r1, [pc, #0x34] ; <+180> at main.cpp:27
0x2a000554 <+124>: add r1, pc, r1
0x2a000558 <+128>: mov r0, r1
0x2a00055c <+132>: mov r1, r2
0x2a000560 <+136>: mov r2, r3
0x2a000564 <+140>: bl 0x2a0003e0
a.out`main + 144 at main.cpp:26
25 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
26 return 0;
27 }
0x2a000568 <+144>: mov r3, #0
a.out`main + 148 at main.cpp:27
26 return 0;
27 }
28
0x2a00056c <+148>: mov r0, r3
0x2a000570 <+152>: sub sp, r11, #4
0x2a000574 <+156>: pop {r11, pc}
0x2a000578 <+160>: andeq r1, r0, r8, lsl #12
0x2a00057c <+164>: strheq r1, [r0], -r12
0x2a000580 <+168>: bge 0x28ef38fc
0x2a000584 <+172>: .long 0x00001594 ; unknown opcode
0x2a000588 <+176>: .long 0xff00ff00 ; unknown opcode
0x2a00058c <+180>: andeq r1, r0, r12, ror #10
Expected result (hand crafted, not exact):
(lldb) dis -m
19 {
a.out`main:
0x2a0004d8 <+0>: push {r11, lr}
0x2a0004dc <+4>: add r11, sp, #4
0x2a0004e0 <+8>: sub sp, sp, #8
20 struct foo mine = {0x001122AA, 0x1122BB44};
0x2a0004e4 <+12>: ldr r2, [pc, #0x8c] ; <+160> at main.cpp:27
0x2a0004e8 <+16>: add r2, pc, r2
0x2a0004ec <+20>: sub r3, r11, #12
0x2a0004f0 <+24>: ldm r2, {r0, r1}
0x2a0004f4 <+28>: stm r3, {r0, r1}
21 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
0x2a0004f8 <+32>: ldr r2, [r11, #-0xc]
0x2a0004fc <+36>: ldr r3, [r11, #-0x8]
0x2a000500 <+40>: ldr r1, [pc, #0x74] ; <+164> at main.cpp:27
0x2a000504 <+44>: add r1, pc, r1
0x2a000508 <+48>: mov r0, r1
0x2a00050c <+52>: mov r1, r2
0x2a000510 <+56>: mov r2, r3
0x2a000514 <+60>: bl 0x2a0003e0
22 mine.first = 0xAABBCCDD; // Set break point at this line.
0x2a000518 <+64>: ldr r3, [pc, #0x60] ; <+168> at main.cpp:27
-> 0x2a00051c <+68>: str r3, [r11, #-0xc]
23 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
0x2a000520 <+72>: ldr r2, [r11, #-0xc]
0x2a000524 <+76>: ldr r3, [r11, #-0x8]
0x2a000528 <+80>: ldr r1, [pc, #0x54] ; <+172> at main.cpp:27
0x2a00052c <+84>: add r1, pc, r1
0x2a000530 <+88>: mov r0, r1
0x2a000534 <+92>: mov r1, r2
0x2a000538 <+96>: mov r2, r3
0x2a00053c <+100>: bl 0x2a0003e0
24 mine.second = 0xFF00FF00;
0x2a000540 <+104>: ldr r3, [pc, #0x40] ; <+176> at main.cpp:27
0x2a000544 <+108>: str r3, [r11, #-0x8]
25 printf("main.first = 0x%8.8x, main.second = 0x%8.8x\n",
mine.first, mine.second);
0x2a000548 <+112>: ldr r2, [r11, #-0xc]
0x2a00054c <+116>: ldr r3, [r11, #-0x8]
0x2a000550 <+120>: ldr r1, [pc, #0x34] ; <+180> at main.cpp:27
0x2a000554 <+124>: add r1, pc, r1
0x2a000558 <+128>: mov r0, r1
0x2a00055c <+132>: mov r1, r2
0x2a000560 <+136>: mov r2, r3
0x2a000564 <+140>: bl 0x2a0003e0
26 return 0;
0x2a000568 <+144>: mov r3, #0
27 }
0x2a00056c <+148>: mov r0, r3
0x2a000570 <+152>: sub sp, r11, #4
0x2a000574 <+156>: pop {r11, pc}
0x2a000578 <+160>: andeq r1, r0, r8, lsl #12
0x2a00057c <+164>: strheq r1, [r0], -r12
0x2a000580 <+168>: bge 0x28ef38fc
0x2a000584 <+172>: .long 0x00001594 ; unknown opcode
0x2a000588 <+176>: .long 0xff00ff00 ; unknown opcode
0x2a00058c <+180>: andeq r1, r0, r12, ror #10
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150423/d7f8c344/attachment.html>
More information about the lldb-dev
mailing list