Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to enter an objective-C for loop as an LLDB expression?

I've seen passing statements that you can enter complex statements like a for loop in an LLDB command (in the language of the program you're debugging - in this case Objective-C)

I would really like to be able to do this. I've never learned Python, and would prefer not to invest the time to do so in order to use the available python LLDB support - there just aren't enough hours in the day for that.

like image 546
Duncan C Avatar asked Dec 03 '13 17:12

Duncan C


1 Answers

You can enter Objective-C statements using expr -- ..., for example:

(lldb) po myArray

(
foo,
bar
)

(lldb) expr -- for (NSString *s in myArray) { (void)NSLog(@"%@", s) ; }

2013-12-03 18:29:03.637 myapp[1373:70b] foo
2013-12-03 18:29:03.639 myapp[1373:70b] bar
like image 159
Martin R Avatar answered Oct 07 '22 15:10

Martin R