2013-03-09 22 views
5

gdb'de bir sonraki n kesme noktasını "continue n" ile atlayabilir veya sonraki n satırlarını "next n" ile atlayabilirim. Lldb'deki eşdeğer nedir?lldb'deki sonraki n kesme noktalarını atla

Ve eğer hiç olmasaydı, lldb python uzantısında kendimi nasıl oluşturabilirim? Böyle bir şey denedim, ama işe yaramadı, eklediğim komutu yazdığımda lldb kilitleniyor.

def cc(debugger, args, result, dict): 
    target = debugger.GetSelectedTarget() 
    process = target.GetProcess() 
    process.Continue() 

cevap

4

process continue komut şu anda geçerli iş parçacığı üzerinde durdu olduğunuz kesme noktası için bir sonraki i eşleşmeleri yok sayacak bir -i seçeneği kabul eder. Örneğin.

Process 13559 stopped 
* thread #1: tid = 0xb7da5, 0x0000000100000f21 a.out`main + 49 at a.c:7, stop reason = breakpoint 2.1 
    #0: 0x0000000100000f21 a.out`main + 49 at a.c:7 
    4  int i; 
    5  for (i = 0; i < 100; i++) 
    6  { 
-> 7   printf ("%d\n", i); 
    8  } 
    9 } 
(lldb) c -i 5 
Process 13559 resuming 
0 
1 
2 
3 
4 
5 
Process 13559 stopped 
* thread #1: tid = 0xb7da5, 0x0000000100000f21 a.out`main + 49 at a.c:7, stop reason = breakpoint 2.1 
    #0: 0x0000000100000f21 a.out`main + 49 at a.c:7 
    4  int i; 
    5  for (i = 0; i < 100; i++) 
    6  { 
-> 7   printf ("%d\n", i); 
    8  } 
    9 } 
(lldb) 

Ayrıca breakpoint modify -i count bpnum ile doğrudan kesme noktası görmezden-sayımını ayarlayabilirsiniz.

+0

Harika cevap. Çok teşekkürler! – Rick

+0

Bir şey daha. Sonraki n satırları atlamaya ne dersiniz? (Gdb'de "next n" gibi). Lldb'de, 'process'' step-over' alt-komutuna sahip değildir. 'thread' 'step-over' var, ama '-i' seçeneğini almıyor gibi görünüyor. – Rick

+0

İplik adımına sahip (aka 'n') bir' -i' seçeneğine sahip olmak iyi bir geliştirme olurdu, bunu önereceğim. Tbr 'lldb' ye eklendiğinde hatırlayamıyorum da, "tbr" komut dizisiyle geçici bir kesme noktası (bir "tek çekim" kesme noktası) ekleyebilirsiniz (yalnızca setin kesme noktasıdır). Henüz yayınlanmış bir versiyonda olmak. –

İlgili konular