DerekSelander / LLDB

A collection of LLDB aliases/regexes and Python scripts to aid in your debugging sessions
GNU General Public License v2.0
1.78k stars 199 forks source link

Advanced Apple Debugging Chapter 1: Getting Started script not working #28

Open 100mango opened 4 years ago

100mango commented 4 years ago

Thanks

(lldb) sys echo "$(dclass -t swift)" | grep -v _ | grep "\." | cut -d. - f1 | uniq | wc -l
error: error: error: use of undeclared identifier 'objc_copyClassList'
error: while importing modules:
error: Header search couldn't locate module ObjectiveC
jonasz88 commented 4 years ago

@DerekSelander I have the same problem :(

aaronash commented 4 years ago

It looks like Apple changed the default language context from Objective-C to Swift in a recent Xcode build :(. You can change the current context with: settings set target.language objc If you add that at the end of your ~/.lldbinit I believe it should set it on every run. I was running into a similar error and this worked for me.

romero-ios commented 2 years ago

I am having the same issue, even after following @aaronash's suggestion

Ho0lo0vo0 commented 2 years ago

Allowed value for target.language is objective-c not objc However, afterwards, there comes new issue: Multilple interal symbols found for 'count'

kasimok commented 1 year ago

Allowed value for target.language is objective-c not objc However, afterwards, there comes new issue: Multilple interal symbols found for 'count'

Actually, settings set target.language objc and settings set target.language objetive-c are the same.

tony-go commented 1 year ago

Hey people 👋🏼

I got a similar issue:

➜  ~ lldb
(lldb) dclass -t swift
Dumping classes
error: error: expression failed to parse:
error: <user expression 0>:15:23: use of undeclared identifier 'objc_copyClassList'
  Class *allClasses = objc_copyClassList(&count);
                      ^
error: while importing modules:
error: Header search couldn't locate module ObjectiveC

Also, try to add settings set target.language objective-c and it didn't fix it.

I just opened the last edition of the book, so I'm not enough familiar with all of this to suggest a solution :/

tony-go commented 1 year ago

I'll take a deeper look at the script tomorrow to see what I could do.