The LLDB command-line debugger provides underlying debugging services for development on all Apple platforms.

Posts under LLDB tag

40 Posts
Sort by:
Post marked as solved
1 Replies
320 Views
I watched a WWDC talk on LLDB, and they showed a nice trick of calling CATransaction.flush() from the debugger, to push changes to a UIView to the screen, even when the program was paused. Is there is a similar thing we can do with Metal? I'm using MTKView, but I can change to a lower level if that's required. The MTKView is paused, so I'm using setNeedsDisplay. As usual, I implement the draw delegate method to encode and commit a command buffer. If I do this from LLDB: metalView.setNeedsDisplay() CATransaction.flush() I can see that causes my draw function to run, but nothing shows up on screen. Is there something else we can do to flush those metal commands to the GPU and see them on screen while stepping through the program with the debugger?
Posted
by
Post not yet marked as solved
1 Replies
443 Views
I have used Xcode 12.4, lldb in Xcode 12.4 work ok, it can Add Expression or Use p or po in LLDB command Line. but After I upgrade my OS and Xcode, p or po will trigger LLDB RPC server crash ."The LLDB RPC server has crashed. You may need to manually terminate your process. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log." lldb-rpc-server_2021-10-28-145717_chenxi.crash OS:macOS Big Sur 11.6 Xcode: 13.0 download from AppStore or 13.2beta download from https://developer.apple.com/download/all/ please refer to the attachment for more details. and tell me how to slove this problem 。 thanks
Posted
by
Post marked as solved
3 Replies
433 Views
xcode latest version 13.1 i have installed....additional tools also installed ...but not working debug console "Po" ,"v" and "p"command how to resource solution
Posted
by
Post not yet marked as solved
2 Replies
660 Views
Now more than ever, it would really help if it were S.O.P. for Apple was to simultaneously release each KDK with each system update. System volume sealing makes the work-arounds for missing KDKs quite painful.
Posted
by
Post not yet marked as solved
0 Replies
458 Views
I try to run the game in xcode simulator but it always crashes. HELP pls... on android works fine. Warning: Error creating LLDB target at path '/Users/vylegalovi/Library/Developer/Xcode/DerivedData/Unity-iPhone-efppyotdzukdtyampzmbagbszvbv/Build/Products/Release-iphonesimulator/VRMetroEscape.app'- using an empty LLDB target which can cause slow memory reads from remote devices. W0929 23:53:04.273332 1 commandlineflags.cc:1311] Ignoring RegisterValidateFunction() for flag pointer 0x12ffae050: no flag found at that address CrashReporter: initialized 2021-09-29 23:53:04.485 VRMetroEscape[25809:2206250] Built from '2019.3/staging' branch, Version '2019.3.0f6 (27ab2135bccf)', Build type 'Development', Scripting Backend 'il2cpp' -> applicationDidFinishLaunching() PlayerConnection initialized from /Users/vylegalovi/Library/Developer/CoreSimulator/Devices/D4E84443-11FF-4B7D-8EBD-01895B9BA6B1/data/Containers/Bundle/Application/F8344320-D856-41B5-8AC5-639E39AC54AB/VRMetroEscape.app/Data (debug = 0) PlayerConnection initialized network socket : 0.0.0.0 55000 Multi-casting "[IP] 192.168.201.3 [Port] 55000 [Flags] 2 [Guid] 2011080506 [EditorId] 0 [Version] 1048832 [Id] iPhonePlayer(David-MacBook-Air.local):56000 [Debug] 0 [PackageName] iPhonePlayer [ProjectName] <no name>" to [225.0.0.222:54997]... Started listening to [0.0.0.0:55000] PlayerConnection already initialized - listening to [0.0.0.0:55000] 2021-09-29 23:53:04.816017+0200 VRMetroEscape[25809:2206250] Cannot find executable for CFBundle 0x7fc14c4bbee0 </System/Library/Frameworks/Metal.framework> (not loaded) 2021-09-29 23:53:04.971547+0200 VRMetroEscape[25809:2206250] Cannot find executable for CFBundle 0x7fc14df51ab0 </System/Library/Frameworks/QuartzCore.framework> (not loaded) -> applicationDidBecomeActive() [Subsystems] Discovering subsystems at path /Users/vylegalovi/Library/Developer/CoreSimulator/Devices/D4E84443-11FF-4B7D-8EBD-01895B9BA6B1/data/Containers/Bundle/Application/F8344320-D856-41B5-8AC5-639E39AC54AB/VRMetroEscape.app/Data/UnitySubsystems GfxDevice: creating device client; threaded=1 gfx device intialization failed
Posted
by
Post not yet marked as solved
7 Replies
3.2k Views
I am using Xcode 13 on a Macbook Pro (Intel/2019) with macOS Big Sur 11.6 I am building and launching the app on a connecting iPhone X running iOS 15.0, I am also running a UI test suite based on XCUITest while I do that. The app takes extremely long to launch (2+ minutes), then it sits on the splash screen for another 2-3 minutes. Meanwhile, Xcode shows the alert attached: I have 2 questions: Is this a widespread Xcode 13 / iOS 15 issue? Can someone please explain what the message in the alert means "LLDB is likely reading from device memory to resolve symbols"? Is there anything I can do to reduce or avoid this wait?
Posted
by
Post not yet marked as solved
1 Replies
1.7k Views
I'm using Xcode 12 with iPhone 12 Pro. Everything worked fine on iOS 14. But after I updated my device to iOS 15 I’m getting the app's splash screen for more than a minute every time I build the app. I've also tried to use Xcode 13 with the iOS 15 device, and it also seems to be broken!  Moreover, when I use a breakpoint and it stops I need to wait for 30-50 seconds to step over or to continue program execution. Does anyone have these problems too?
Posted
by
Post not yet marked as solved
3 Replies
701 Views
Hello: I'm linking my Swift app against an Objective-c framework. I can call all the methods within the class in the framework, except for one. When I try and call it, I get an exception: #0 0x00007fff2037b829 in objc_msgSend () #1 0x000000010f856df4 in ___lldb_unnamed_symbol147$$MyFramework () I don't think it's the signature of the method, I can jump to the definition in the header file and the definition of the parameters the method needs. And even if it was a signature mismatch, that's a compile error. So what would cause an error like this. Thanks in advance for your time John
Posted
by
Post not yet marked as solved
1 Replies
499 Views
Hello. I'm just studying C programming, and I have a trouble with impossibility to implement logic operation to pointer with NULL value. For example: int * ptr; ptr = NULL: if (ptr) { printf("Ptr isn't NULL\n"); } else { printf("Ptr is NULL\n"); } I get exception = EXC_BAD_ACCESS (code=1, address=0x10). The real case in lldb debugger in picture. Please, help me. This issue really breaks programming principles which I must learn.
Posted
by
Post not yet marked as solved
0 Replies
323 Views
In an Objective C project for MacOS using XCode 12.3 I define variables of various types including NSRect and CGFloat at the start of a class implementation region so that they are accessible from all methods. When I add a breakpoint in a method, some of the variables can be displayed by hovering the cursor over the variable in the code window or examining the variables window. However, some class-level variables are not shown in the variables window or by hovering over them. Attempting to examine then using po in the debugger console shows an undeclared variable error. Class-level variables of type CGFloat which are assigned are visible but not variables that do not have values assigned. None of the objects class NSRect appearing on the RHS of assignments are visible when hovering over the or by using po in the debugger console.
Posted
by
Post marked as solved
2 Replies
732 Views
My team and I have been working on production iOS apps since 2014, but today in 2021 we have an issue we can't figure out. We have been working on a major feature which we are now at the point of internal alpha testing. We have two test apps: one of the specific section of the app the feature is in, and one of the entire app. In both of these apps, our local builds work without issue in both Debug and Release configurations. However, all of our TestFlight builds (we only do TestFlight builds of the complete app) are crashing all on devices we try it with as soon as the new feature is used. The crash reports point to a 3rd party library we are using regarding buffer sizes (it is an audio feature, using low level I/O AudioUnits). This doesn't really help us track down the issue though because, try as we might, we have never been able to reproduce this in a local build. There it always works without failure. I don't actually understand how this is possible. What could possibly be different between a Release build run locally compared to what is available on TestFlight? Another side of this is, can we somehow debug the TestFlight build on our devices with lldb in order to track down what is going on here?
Posted
by
Post not yet marked as solved
2 Replies
598 Views
Hello, We have an endpoint security daemon which also uses some system extensions (network content filtering, file notifications). When building on debug with the correct entitlements (get-task-allow) we cannot attach with the debugger. More precisely, after attach, instead of displaying thread information, the daemon just stops (in logs appears a SIGKILL with no source). Before this happens, the system freezes for about 15-20 seconds, so I'm guessing it's some kind of watchdog that kills the app before the debugger can completely attach. The same happens with a custom built GDB, as well as various versions of LLDB. How can we find out what kills the daemon and maybe increase the timeout or some other solution like that?
Posted
by
Post not yet marked as solved
0 Replies
1.4k Views
Library not found for -lFirebaseDynamicLinks is the real issue that I am facing in my Xcode 12.4~ followed by linker command. THE SPECIFIC ERROR CODE. : Library not found for -lFirebaseDynamicLinks : Linker command failed with exit code 1 (use -v to see invocation) THE PACKAGE JSON FILE { "name": "Sample Project Name", "version": "0.0.1", "private": true, "engines": { "node": "&gt;=8.15.1" }, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start --reset-cache", "reset": "rm -rf node_modules/ &amp;&amp; npm cache clear &amp;&amp; watchman watch-del-all &amp;&amp; yarn install", "test:file": "jest", "test": "jest --verbose --coverage", "test:coverage": "jest --verbose --coverage --coverageDirectory=coverage --colors", "test:update": "jest --verbose --coverage --updateSnapshot", "test:watch": "jest --verbose --watch", "tsc": "tsc", "lint:fix": "tslint --project tsconfig.json --fix", "tslint-check": "tslint-config-prettier-check ./tslint.json", "postinstall": "node tools/checkNodeVersion.js &amp;&amp; npx jetify", "android": "react-native run-android", "android:apk:debug": "cd android &amp;&amp; ./gradlew assembleDebug &amp;&amp; open ./app/build/outputs/apk/", "android:apk:install": "cd android &amp;&amp; ./gradlew installDebug", "android:apk:release": "cd android &amp;&amp; ./gradlew assembleRelease &amp;&amp; open ./app/build/outputs/apk/", "android:build-bundle": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/", "android:device": "adb reverse tcp:8081 tcp:8081 &amp;&amp; npm run android", "android:log": "react-native log-android", "ios": "react-native run-ios", "ios:log": "react-native log-ios", "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { "@invertase/react-native-apple-authentication": "^2.1.2", "@notifee/react-native": "^1.3.1", "@react-native-community/async-storage": "^1.12.1", "@react-native-community/clipboard": "^1.2.3", "@react-native-community/datetimepicker": "^3.0.2", "@react-native-community/google-signin": "^4.0.3", "@react-native-community/masked-view": "^0.1.10", "@react-native-community/netinfo": "^5.9.7", "@react-native-community/viewpager": "^4.1.6", "@react-native-firebase/analytics": "^12.1.0", "@react-native-firebase/app": "^12.1.0", "@react-native-firebase/auth": "^12.1.0", "@react-native-firebase/dynamic-links": "^12.1.0", "@react-native-firebase/storage": "^12.1.0", "@react-navigation/bottom-tabs": "^5.7.3", "@react-navigation/drawer": "^5.8.7", "@react-navigation/material-top-tabs": "^5.2.16", "@react-navigation/native": "^5.7.2", "@react-navigation/stack": "^5.8.0", "@twotalltotems/react-native-otp-input": "1.3.7", "axios": "^0.20.0", "moment": "^2.27.0", "react": "16.13.1", "react-native": "0.63.0", "react-native-autolink": "^4.0.0", "react-native-countdown-component": "^2.7.1", "react-native-country-picker-modal": "^2.0.0", "react-native-create-thumbnail": "^1.2.1", "react-native-device-info": "^5.6.5", "react-native-dropdownalert": "^4.3.0", "react-native-elements": "^2.1.0", "react-native-fs": "^2.16.6", "react-native-gesture-handler": "^1.8.0", "react-native-image-picker": "^2.3.4", "react-native-keyboard-aware-scroll-view": "^0.9.4", "react-native-localize": "^1.4.1", "react-native-modal": "^11.5.6", "react-native-modal-datetime-picker": "^8.9.3", "react-native-modal-selector": "^2.0.3", "react-native-progress": "^4.1.2", "react-native-reanimated": "^1.10.1", "react-native-responsive-screen": "^1.4.2", "react-native-safe-area-context": "^3.1.1", "react-native-screens": "^2.9.0", "react-native-share": "^3.7.1", "react-native-splash-screen": "^3.2.0", "react-native-super-grid": "^4.0.3", "react-native-svg": "^12.1.0", "react-native-swipe-gestures": "^1.0.5", "react-native-switch-selector": "^2.0.6", "react-native-tab-view": "^2.15.1", "react-native-vector-icons": "^7.0.0", "react-native-video": "^5.1.0-alpha8", "react-native-video-cache": "^2.0.5", "react-native-videoeditorsdk": "^2.5.0", "react-navigation": "^4.4.0", "react-navigation-stack": "^2.8.2", "react-navigation-tabs": "^2.9.0", "react-redux": "^7.2.0", "redux": "^4.0.5", "redux-saga": "^1.1.3", "reflect-metadata": "^0.1.13" }, "devDependencies": { "@babel/core": "^7.8.4", "@babel/runtime": "^7.8.4", "@react-native-community/cli-debugger-ui": "^4.9.0", "@react-native-community/eslint-config": "^1.1.0", "@types/jest": "^25.2.3", "@types/react-native": "^0.63.1", "@types/react-native-vector-icons": "^6.4.5", "@types/react-test-renderer": "^16.9.2", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "babel-jest": "^25.1.0", "eslint": "^6.5.1", "jest": "^25.1.0", "metro-react-native-babel-preset": "^0.59.0", "prettier": "^2.0.4", "react-native-svg-transformer": "^0.14.3", "react-test-renderer": "16.13.1", "typescript": "^3.8.3" }, "jest": { "preset": "react-native", "moduleFileExtensions": [ "ts", "tsx", "js", "jsx", "json", "node" ] } } If I remove the React Native Firebase Dynamic Links library the project works fine otherwise it is dropping this error up above. I have tried all previous versions the same error occurs. I have tried Build Active Architecture also didn't work. And a couple of Xcode settings also. I also tried resetting the derived data and whole Xcode but no fix. I want to use RNDynamicLinks library in my project.
Posted
by
Post not yet marked as solved
10 Replies
4.1k Views
I keep running into this error when using po expression produced error: error: Couldn't realize type of self. Try evaluating the expression with -d run-target It typically seems to happen during breakpoints in tests. My Build Configuration is Debug as well. Any ideas?
Posted
by
Post not yet marked as solved
2 Replies
3.4k Views
Hi everybody, I’m the maintainer of GNU Prolog (gprolog). I try to port it to the new arm64/darwin apple architecture since a contributor gave me an ssh access to its machine (I can thus only execute commands via command-line bash). I can compile gprolog (it uses a classical unix-style procedure ./configure + make using gcc (clang)). The machine is pretty fast ! However, at run-time I obtain a segmentation violation which I’d like to debug using lldb. I initially obtained this error:  error: process exited with status -1 (developer mode is not enabled on this machine and this is a non-interactive debug session.) I asked the owner of the machine to enable the developer mode. But now I obtain: error: process exited with status -1 (this is a non-interactive debug session, cannot get permission to debug processes.) I saw several posts mentioning entitlements (I’m sorry I’m not an expert of Mac). Here is what I obtain with my executable (I created a simple test case executable called ./t): codesign -d -vvv --entitlements :- ./t Executable=/Users/ddiaz/GP/src/BipsPl/t Identifier=t Format=Mach-O thin (arm64) CodeDirectory v=20400 size=8410 flags=0x20002(adhoc,linker-signed) hashes=260+0 location=embedded Hash type=sha256 size=32 CandidateCDHash sha256=c0ddf4ad6672b7c65b2a90d274bb29783625d502 CandidateCDHashFull sha256=c0ddf4ad6672b7c65b2a90d274bb29783625d5021b6e1d67c6be5c7774c265b5 Hash choices=sha256 CMSDigest=c0ddf4ad6672b7c65b2a90d274bb29783625d5021b6e1d67c6be5c7774c265b5 CMSDigestType=2 CDHash=c0ddf4ad6672b7c65b2a90d274bb29783625d502 Signature=adhoc Info.plist=not bound TeamIdentifier=not set Sealed Resources=none Internal requirements=none I saw, in some posts, a permission com.apple.security.get-task-allow which should be enable. Do you think the problem comes from this permission ? How can I add it using command-line console ? Thanks you for your help Didou
Posted
by
Post marked as solved
5 Replies
949 Views
We define an event handler for OpenURL NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager]; [appleEventManager setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; And we handle it here: (void)handleGetURLEvent:(NSAppleEventDescriptor *)event            withReplyEvent:(NSAppleEventDescriptor *)replyEvent { // Handler type stuff } If I'm debugging in Xcode, I see a SIGCONT before the handler is called. When I continue from the SIGCONT, I enter the handler and everything is fine. This causes automated tests to break, and is generally a pain in the you-know-where. Outside of Xcode it's fine. How can I make it stop doing this? Is there some Xcode setting I've overlooked?
Posted
by
Post not yet marked as solved
6 Replies
2.9k Views
Xcode 12.4 on Big Sur, a very basic attempt to launch and debug a process. Little-Net:host-osx minfrin$ lldb ./tmp_firefox/Library/Google/Chrome/NativeMessagingHosts/chrome-token-signing.app/Contents/MacOS/chrome-token-signing (lldb) target create "./tmp_firefox/Library/Google/Chrome/NativeMessagingHosts/chrome-token-signing.app/Contents/MacOS/chrome-token-signing" Current executable set to '/Users/minfrin/src/redwax/open-eid/chrome-token-signing-trunk/host-osx/tmp_firefox/Library/Google/Chrome/NativeMessagingHosts/chrome-token-signing.app/Contents/MacOS/chrome-token-signing' (x86_64). (lldb) process launch -i cert.native  error: process exited with status -1 (attach failed (Not allowed to attach to process.  Look in the console messages (Console.app), near the debugserver entries when the attached failed.  The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)) Why would lldb, running as my local user, be unable to launch a process also running as my local user? Is there any way to convince lldb to log error messages instead of referring me to the console, which contains a continuous stream of noise?
Posted
by
Post marked as solved
4 Replies
1.9k Views
similiar to Error when debugging: Cannot creat… | Apple Developer Forums - https://developer.apple.com/forums/thread/651375 Xcode 12 beta 1 po command in de… | Apple Developer Forums - https://developer.apple.com/forums/thread/651157 which do not resolve this issue that I am encountering Description of problem I am seeing an error which prevents using lldb debugger on Swift code/projects. It is seen on any Swift or SwiftUI project that I've tried. This is the error displayed in lldb console when first breakpoint is encountered: Cannot create Swift scratch context (couldn't create a ClangImporter)(lldb)  Xcode Version 12.3 (12C33) macOS Big Sur Intel M1 Troubleshooting I originally thought this was also working on an Intel Mac running Big Sur/Xcode 12.3, but was mistaken. Using my customized shell environment on the following setups, I encounter the same couldn't create a ClangImporter. M1 Mac mini, main account (an "Admin" account) same M1 Mac mini, new "dev" account (an "Admin" account) Intel MBP, main account They are all using an Intel Homebrew install, and my customized shell environment if that provides a clue? I captured some lldb debugging info by putting expr types in ~/.lldbinit but the outputs were basically identical (when discounting scratch file paaths and memory addresses) compared to the "working clean" account log (described below) log enable -f /tmp/lldb-log.txt lldb expr types works in a "clean" user account I created a new, uncustomized "Standard" testuser account on the M1 Mac mini, and launched the same system Xcode.app. There was no longer this error message, and was able to inspect variables at a swift program breakpoint in Swift context, including po symbol. Impact Effectively this makes the debugger in Swift on Xcode projects on my systems essentially unable to inspect Swift contexts' state.
Posted
by
Post not yet marked as solved
37 Replies
7.4k Views
When I run my app from Xcode 12b1 and hit a break point, LLDB says "Cannot create Swift scratch context (couldn't load the Swift stdlib)" and any subsequent commands like "po" seem to do nothing. Who can I fix this?
Posted
by