1
例如,與源代碼main.c
:LLDB:一個行輸出`print`和`display`
#include <stdio.h>
int main()
{
int a[10] = {0,1,2,3,4,5,6,7,8,9};
int b = 2;
printf("line 7\n");
printf("line 8\n");
return 0;
}
隨着LLDB
調試器,print a
農產品:
(int [10]) $0 = {
[0] = 0
[1] = 1
[2] = 2
[3] = 3
[4] = 4
[5] = 5
[6] = 6
[7] = 7
[8] = 8
[9] = 9
}
問題0 :我怎樣才能得到一個更緊湊的打印上一個行print
,像GDB
:
$1 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
隨着LLDB
調試器,display a
和display b
農產品:
- Hook 1 (expr -- a)
(int [10]) $0 = {
[0] = 0
[1] = 1
[2] = 2
[3] = 3
[4] = 4
[5] = 5
[6] = 6
[7] = 7
[8] = 8
[9] = 9
}
- Hook 2 (expr -- b)
(int) $1 = 2
問題1:我怎樣才能在兩行的小型印刷爲display
,像GDB
:
2: b = 2
1: a = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
我不知道答案,但你爲什麼你要嗎? –
BTW,問題(S)的漂亮的索引... :-) –
@SouravGhosh我調試代碼並希望顯示17個變數。在GDB中,12行中的輸出。在LLDB,很多線路,這是很難讀,我必須滾動我的屏幕 – user744629