LLDB icon indicating copy to clipboard operation
LLDB copied to clipboard

Advanced Apple Debugging Chapter 1: Getting Started script not working

Open 100mango opened this issue 4 years ago • 7 comments

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

100mango avatar Apr 22 '20 09:04 100mango

@DerekSelander I have the same problem :(

jonasz88 avatar May 10 '20 20:05 jonasz88

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.

aaronash avatar Jun 10 '20 15:06 aaronash

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

romero-ios avatar Mar 16 '22 15:03 romero-ios

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

Ho0lo0vo0 avatar Aug 09 '22 19:08 Ho0lo0vo0

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.

kasimok avatar Jan 10 '23 00:01 kasimok

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 avatar Jul 09 '23 17:07 tony-go

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

tony-go avatar Jul 09 '23 18:07 tony-go