Code Monkey home page Code Monkey logo

Comments (31)

mzF414 avatar mzF414 commented on July 26, 2024 26

TARGETS -> debug-objc -> Build Settings -> Enable Hardened Runtime = NO
It's works in my clone

from objc-runtime.

Shizai-Lin-Bose avatar Shizai-Lin-Bose commented on July 26, 2024 8

TARGETS -> debug-objc -> Build Settings -> Enable Hardened Runtime = NO
It's works in my clone

Good solution

from objc-runtime.

programingHaozi avatar programingHaozi commented on July 26, 2024 2

They are the same both pointing to "build" path. [image: image.png] [image: image.png]

On Wed, Apr 1, 2020 at 5:05 AM RetVal @.***> wrote: I don’t know how to use Xcode. I just did ‘’’ DYLD_INSERT_LIBRARIES=path/to/libobjc.A.dylib lldb path/to/debug-objc ‘’’ maybe you can check the build location of the runtime and your demo app, make sure the location of these two was same. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#20 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIWVZEYWZGYZ7JKVRUBJSDRKMUXVANCNFSM4LSEBUYA .

I have the same problem, try everything i can do but none of them worked, so I give up the newest version,and try compile 756.2 which Git commit is 20d965f,and it worked!hope it can help

from objc-runtime.

huainanzi avatar huainanzi commented on July 26, 2024 2

TARGETS -> debug-objc -> Build Settings -> Enable Hardened Runtime = NO
It's works in my clone

thanks

from objc-runtime.

lanza avatar lanza commented on July 26, 2024 1

_task_restartable_ranges_register

is a new macOS 10.15 symbol. I'm guessing you just need to update your OS + Xcode.

from objc-runtime.

RetVal avatar RetVal commented on July 26, 2024

add the breakpoint to function objc_alloc ? have a try.
image

from objc-runtime.

wsdwsd0829 avatar wsdwsd0829 commented on July 26, 2024

I tried that and not working. The only change i made is to change signing's Team and use "Automatically manage signing" and change target of debug-objc's min target version to 10.14 to match mine.

What's your tested os & xcode version? Maybe I need to update xcode and os?

from objc-runtime.

wsdwsd0829 avatar wsdwsd0829 commented on July 26, 2024

Unfortunately updating to Catalina did not fix it either.

from objc-runtime.

RetVal avatar RetVal commented on July 26, 2024

OSX 10.15.3, Xcode 11.4
I think maybe you can running the demo project, and set a breakpoint to pause the process, type 'image list' to the console and check the path of the runtime.
image

from objc-runtime.

wsdwsd0829 avatar wsdwsd0829 commented on July 26, 2024

This is the output:
(lldb) image list
[ 0] F2AC94E8-A1C2-30F5-8727-84D92AD89951 0x0000000100000000 /Users/maxwang/Library/Developer/Xcode/DerivedData/objc-dnbfetcywolbragldaprohldvehz/Build/Products/Debug/debug-objc
[ 1] 1F893B81-89A5-3502-8510-95B97B9F730D 0x0000000100009000 /usr/lib/dyld
[ 2] 20AC082F-2DB7-3974-A2D4-8C5E01787584 0x00007fff6e517000 /usr/lib/libobjc.A.dylib
[ 3] 9A74FA97-7F7B-3929-B381-D9514B1E4754 0x00007fff37dbc000 /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
[ 4] DB8310F1-272D-3533-A840-3B390AF55C26 0x00007fff6c6b7000 /usr/lib/libSystem.B.dylib
[ 5] 9E632A1E-9622-33D6-BCCE-23AC16DAA6B7 0x00007fff35706000 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
[ 6] 1C880020-396D-3F91-BE27-5A09A9239F68 0x00007fff6c9f0000 /usr/lib/libc++abi.dylib
[ 7] 08199809-33CA-321E-9B9D-FD5B2BC64580 0x00007fff6c99d000 /usr/lib/libc++.1.dylib
[ 8] 5F90FFCE-403B-3724-991D-BA32401D99C5 0x00007fff6f4b3000 /usr/lib/system/libcache.dylib
[ 9] C7A5E3F7-1E5A-3785-875A-B6647082B614 0x00007fff6f4b9000 /usr/lib/system/libcommonCrypto.dylib
[ 10] A517E149-2D25-3C04-BCEF-F69149C85B18 0x00007fff6f4c5000 /usr/lib/system/libcompiler_rt.dylib

from objc-runtime.

RetVal avatar RetVal commented on July 26, 2024

the path of the runtime told that your app loaded the system version of the binary, so the breakpoint didn't make sense, check the snapshot of my screen, you can see the demo loaded the binary which was compiled from the project.

maybe you can check the build location of the runtime and your demo app, make sure the location of these two was same.

from objc-runtime.

lanza avatar lanza commented on July 26, 2024

How are you doing this? The debug-objc binary has LC 13: LC_LOAD_DYLIB /usr/lib/libobjc.A.dylib. Are you manually install_name_tooling this to a relative path? I had to use DYLD_INSERT_LIBRARIES=path/to/built/libobjc.A.dylib. Not even sure why that worked given the load command is for the absolute path libobjc.A.dylib.

from objc-runtime.

wsdwsd0829 avatar wsdwsd0829 commented on July 26, 2024

I could not find install_name_tool or DYLD_INSERT_LIBRARIES in Build Setting of debug-objc or objc target.
I did not change any settings after git clone. Shouldn't it be setting the build use the debug build of runtime when I just clone the project (I just cloned without changing anything, except cert/signing)?
What setting do you suggest I can check and try to change. I am not really familiar with which path is related to point to the right objc dylib.

Screen Shot 2020-03-30 at 2 51 32 PM

from objc-runtime.

lanza avatar lanza commented on July 26, 2024

I don’t know how to use Xcode.

I just did
‘’’
DYLD_INSERT_LIBRARIES=path/to/libobjc.A.dylib lldb path/to/debug-objc
‘’’

from objc-runtime.

RetVal avatar RetVal commented on July 26, 2024

I don’t know how to use Xcode.

I just did
‘’’
DYLD_INSERT_LIBRARIES=path/to/libobjc.A.dylib lldb path/to/debug-objc
‘’’

maybe you can check the build location of the runtime and your demo app, make sure the location of these two was same.

from objc-runtime.

wsdwsd0829 avatar wsdwsd0829 commented on July 26, 2024

from objc-runtime.

lanza avatar lanza commented on July 26, 2024

ld64 links against the dylibs install path. For the built libobjc.A.dylib this is /usr/lib/libobjc.A.dylib as set by the Installation Directory value of /usr/lib in Xcode. So ld64 will put that as the LD_LOAD_DYLIB for anything you link against the built library. However, Xcode also injects -frameword Foundation into the main.o objectfile as an LC_LINKER_OPTION which implicitly imports /usr/lib/libobjc.A.dylib. So the workaround for this whole thing seems ridiculous. I'd just stick to DYLD_INSERT_LIBRARIES=build/Debug/libobjc.A.dylib lldb debug-objc.

from objc-runtime.

wsdwsd0829 avatar wsdwsd0829 commented on July 26, 2024

ba21fe7 this commit worked for me on Mojave and Catalina. (756.2 20d965f did not).

Thanks @programingHaozi for the idea to try other commits.

from objc-runtime.

RetVal avatar RetVal commented on July 26, 2024

Maybe you can check the SIP status of your machine, typing csrutil status in your terminal, please make sure the status was disabled. I tested this using an empty machine and couldn't load the custom version of the runtime when the SIP was enabled, hope it make sense.

from objc-runtime.

programingHaozi avatar programingHaozi commented on July 26, 2024

Maybe you can check the SIP status of your machine, typing csrutil status in your terminal, please make sure the status was disabled. I tested this using an empty machine and couldn't load the custom version of the runtime when the SIP was enabled, hope it make sense.

After I set SIP disabled and compile, compile 799.1 an error occurred

image

dyld: lazy symbol binding failed: Symbol not found: _task_restartable_ranges_register
Referenced from: /Users/XXX/Library/Developer/Xcode/DerivedData/objc-durwwovfolhlzvbslduvjahbhifr/Build/Products/Debug/libobjc.A.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _task_restartable_ranges_register
Referenced from: /Users/XXX/Library/Developer/Xcode/DerivedData/objc-durwwovfolhlzvbslduvjahbhifr/Build/Products/Debug/libobjc.A.dylib
Expected in: /usr/lib/libSystem.B.dylib

and commit 20d965f compile successed which failed when SIP was enabled

by the way ,can I debug on iOS platform?

from objc-runtime.

RetVal avatar RetVal commented on July 26, 2024

Maybe you can check the SIP status of your machine, typing csrutil status in your terminal, please make sure the status was disabled. I tested this using an empty machine and couldn't load the custom version of the runtime when the SIP was enabled, hope it make sense.

@wsdwsd0829 any update?

from objc-runtime.

wsdwsd0829 avatar wsdwsd0829 commented on July 26, 2024

from objc-runtime.

huangwei4478 avatar huangwei4478 commented on July 26, 2024

They are the same both pointing to "build" path. [image: image.png] [image: image.png]

On Wed, Apr 1, 2020 at 5:05 AM RetVal @.***> wrote: I don’t know how to use Xcode. I just did ‘’’ DYLD_INSERT_LIBRARIES=path/to/libobjc.A.dylib lldb path/to/debug-objc ‘’’ maybe you can check the build location of the runtime and your demo app, make sure the location of these two was same. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#20 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIWVZEYWZGYZ7JKVRUBJSDRKMUXVANCNFSM4LSEBUYA .

I have the same problem, try everything i can do but none of them worked, so I give up the newest version,and try compile 756.2 which Git commit is 20d965f,and it worked!hope it can help

This worked for me. 799.1 and 756.2, but not for objc.750

from objc-runtime.

huainanzi avatar huainanzi commented on July 26, 2024

Mac OS 10.15.4,Xcode 11.4. I have the same problem,how to solved?

from objc-runtime.

 avatar commented on July 26, 2024

unfortunately�, it does not work for me. 😞
Mac OS 10.15.4,Xcode 11.4

from objc-runtime.

ma125125t avatar ma125125t commented on July 26, 2024

work for me by disable csrutil😀

from objc-runtime.

zhonglaoban avatar zhonglaoban commented on July 26, 2024

TARGETS -> debug-objc -> Build Settings -> Enable Hardened Runtime = NO
It's works in my clone

save my day time

from objc-runtime.

KeithMorning avatar KeithMorning commented on July 26, 2024

TARGETS -> debug-objc -> Build Settings -> Enable Hardened Runtime = NO
It's works in my clone

really really thanks, I almost give up...

from objc-runtime.

xieliying avatar xieliying commented on July 26, 2024

SIP

csrutil disable worked for me, thanks.

from objc-runtime.

Liaoworking avatar Liaoworking commented on July 26, 2024

TARGETS -> debug-objc -> Build Settings -> Enable Hardened Runtime = NO
It's works in my clone

It's worked on Catalina, but not on Big Sur.

from objc-runtime.

zjh171 avatar zjh171 commented on July 26, 2024

kyson老师的小专栏里说的很清楚了:https://xiaozhuanlan.com/runtime

from objc-runtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.