-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: types with protocol qualified are not built-ins #451
Conversation
Not sure this is a good test, because it's Foundation, but: (check out)
Might be time to start using regep vs. strings.Contains |
Okay, we have two problems:
|
I believe to have addressed the problems you listed. But, unrelated to this PR, I found that we are not representing some more obscure types properly.
@interface NSDecimalNumber : NSNumber {
/* instance variables */
unsigned int x :8 _exponent;
unsigned int x :4 _length;
unsigned int x :1 _isNegative;
unsigned int x :1 _isCompact;
unsigned int x :1 _reserved;
unsigned int x :1 _hasExternalRefCount;
unsigned int x :16 _refs;
unsigned short * _mantissa;
}
@interface NSDecimalNumber : NSNumber {
@private
signed int _exponent:8;
unsigned int _length:4;
unsigned int _isNegative:1;
unsigned int _isCompact:1;
unsigned int _reserved:1;
unsigned int _hasExternalRefCount:1;
unsigned int _refs:16;
unsigned short _mantissa[];
} |
Another example. ipsw: @interface _NSObserverList : NSObject {
/* instance variables */
id _owner;
id _observers;
atomic unsigned int _observerCount;
struct os_unfair_lock_s { unsigned int _os_unfair_lock_opaque; } _observersLock;
} Expected: @interface _NSObserverList : NSObject {
/* instance variables */
id _owner;
id _observers;
_Atomic unsigned int _observerCount;
struct os_unfair_lock_s { unsigned int _os_unfair_lock_opaque; } _observersLock;
} |
Is |
I believed this is fixed in |
replaced |
|
Just resolved the conflicts, PTAL |
Can you also rebase from |
|
|
I forgot to ask about this but in Maybe it doesn't make sense to have |
and |
I’ll try to address these problems this weekend. |
I'll have to fix some stuff in go-macho to make this work properly. I'll send the PR shortly. |
merged your go-macho PR and cut a release 👍 |
Okay, just tested against Foundation and the only thing weird I found was I'm reviewing these maps and will submit a PR there. Beyond spaces in "z": "size_t",
"Z": "int32",
"w": "wchar_t",
"%": "NXAtom",
"!": "vector",
"Vv": "void", I don't know if |
I can't remember where I saw some of those originally, they were added 3-4yrs ago. Do you know how 'gnu register' should be represented? |
Take a look at blacktop/go-macho#52. I've removed |
I pushed some fixes including some that you mentioned to go-macho and the output is looking pretty good to me now 👍 |
About Apparently, GCC also has I would love to have some code that actually uses these things. |
Let me rebase my PR in go-macho, there are some changes worth picking there. |
agreed |
nice find! |
Tested a few of my fav dylibs and it looks good 👍 |
I made a mistake in #443 and the code detects things like
id <OS_dispatch_queue>
as built-ins. Whileid
is a built-in,OS_dispatch_queue
is not.This patch addresses the problem by looking for built-ins only when we have an unqualified type. When we have a qualified type, we split the type in two and check both parts separately:
ipsw/internal/commands/macho/objc.go
Lines 1014 to 1017 in 7c77867