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

Posts under LLDB tag

144 Posts

Post

Replies

Boosts

Views

Activity

LLDB fails to launch app from XCode 13
I'm getting the error: ** "Warning: Error creating LLDB target at path '/Users/tantan/Library/Developer/Xcode/DerivedData/Videe-bpukzfmjaxewiuaiolulcqllukjg/Build/Products/Debug-iphonesimulator/[AppName].app'- using an empty LLDB target which can cause slow memory reads from remote devices."** Is there anyone who can explain to me what the reason is and how can fix it? Thanks,
1
0
2.5k
Nov ’22
Xcode 14.1: “error: Couldn’t realize type of self”
I recently added Swift to my existing objective-c static library project and encountering issues when debugging Swift code. While in a breakpoint and entering po command to print a variable value I get: error: expression failed to parse: error: Couldn't realize type of self Note the following: The project is an objective-c static library with recently added Swift files. The error appears only when breakpoint is in a Swift file. There is no issues while debugging objective-c file (*.m file). Xcode version is 14.1 Project is using CocoaPods. There are no issues with compilation and runtime. The only issue is with debugging Swift code. When running swift-healthcheck from breakpoint, there are plenty of errors as follow: LoadOneModule() -- Missing Swift module or Clang module found for "Infra", "imported" via SwiftDWARFImporterDelegate. Hint: Register Swift modules with the linker using -add_ast_path. While Infra is the name of my static library. (I couldn't find any helpful instructions explaining how to register swift modules, while I'm not even sure it points to the actual issue). Any suggestions will be highly appreciated.
0
1
1.5k
Nov ’22
Crash debugging for translated x86_64 process under Rosetta
Hi all, I want to analyze the crash dump of translated x86_64 application under Rosetta emulation. After survey, I enable core dump at the start of my application, build application with DWARF and dSym config in XCode, and collect core dump from /cores/core.PID However, when I want to analyze core dump with lldb, I use the following command for backtracing: lldb -c /cores/core.PID (lldb) target create --core "/cores/core.PID" Core file '/cores/core.PID' (arm64) was loaded. (lldb) bt and I only got frame number with function address * thread #1, stop reason = ESR_EC_DABORT_EL0 (fault address: 0x0) * frame #0: 0x0000000102ae4c04 * frame #1: 0x0000000202d166ac Therefore, I try to add-sym but get the following error message: error: symbol file 'xxxxx.dSYM' does not match any existing module I know that macOS would generate crash report in ~/Library/Logs/DiagnosticReports/, but I need further analysis of crash dump. Is there any way to do post-mortem debugging for translated process under Rosetta? Thanks!
1
0
1.9k
Nov ’22
Swift LLDB fail
when i use po, alway show this error. (lldb) po viewModel error: warning: Failed to load linked library UIKit of module Login - errors: Looking for "@rpath/UIKit.framework/UIKit", error: (null) Failed to find framework for "UIKit" looking along paths:  /Users/name/Library/Developer/Xcode/DerivedData/Game-fbcssrnefpcutjgjoxicuabsatne/Build/Products/Debug-iphoneos/UIKit.framework/ Looking for "/Users/name/Library/Developer/Xcode/DerivedData/MegabilityInterface-hiqhsjxojjhqgudnbcwzmovnxrqu/Build/Intermediates.noindex/ArchiveIntermediates/MegabilityInterface/BuildProductsPath/Release-iphoneos/UIKit.framework/" ,  error: (null) error: <EXPR>:2:11: error: cannot find type '$__lldb_context' in scope extension $__lldb_context {      ^~~~~~~~~~~~~~~ error: <EXPR>:19:5: error: cannot find '$__lldb_injected_self' in scope   $__lldb_injected_self.$__lldb_wrapped_expr_10(   ^~~~~~~~~~~~~~~~~~~~~ (lldb)  I was try setting this config by SWIFT_OPTIMIZATION_LEVEL DEBUG_INFORMATION_FORMAT Still does't work. if i use IDE 'Print Description of "viewModel" ' Printing description of viewModel: (Game.ViewModel) viewModel = <Unable to determine byte size.> Still error of LLDB?
2
0
2.8k
Nov ’22
lldb sometimes doesn't stop at breakpoints
I have some python scripts that I'm using within lldb to track messages that I receive from Endpoint Security (I'm trying to track down an issue where I may not respond to an es_message_t). So I added breakpoints for es_retain_message, es_release_message, es_respond_auth_result and es_respond_flags_result. And it works great... Some of the time. But it--fairly frequently--won't trigger one of the breakpoints. I will see cases where the es_retain_message python code didn't run but the es_respond_auth_result and the es_release_message did. Or any combination thereof. And sometimes they will all be called and everything will work out fine. I'm thinking there may be something thread based. All of the breakpoints are within code blocks--one from Endpoint Security and the other as an application-specific one (a concurrent queue). The pseudo-code looks something like: // Within the ES code block ... es_retain_message(msg) ... dispatch_async(localConcurrentQueue, ^{ ... es_respond_auth_result(msg) // or es_respond_flags_result, depending... ... es_release_message(msg) } I feel like I see this happen more often when my python script prints, but I haven't measured it to see if that's really happening. I've tried removing some of the printing and tried various creative uses of lldb.SBDebugger.SetAsync to no avail. Is there a known issue in lldb that I'm missing?
2
0
1.9k
Nov ’22
Remote Debugging for Authorization Plugins
Hi all,We are developing a variety of login window plugins for macOS and are looking for greater control of the debugging process. I've followed the steps in Technical Note TN2108: Debugging An Authorization Plug-In With Xcode, but they don't seem to work on modern macOS, even with SIP disabled. It would seem that SecurityAgent has some anti-debug protection in it now as I can't connect to the running instance with lldb.As a work around we've resorted to caveman debugging with lots of log statements, but that's more than a bit of a pain to do as our products become more complex. Having debugging in Xcode would be best, but at this rate I'll even settle for lldb.Any ideas?Thanks,Josh
4
0
3.7k
Oct ’22
How do I use lldb with Playground?
I'm getting a runtime error in Playground that tells me to run an lldb command. I am not able to type anything in the debug area of Playground as I can in Xcode. How do I use lldb with Playground. Specifically, the error I'm getting is: error: Execution was interrupted, reason: shared-library-event. The process has been left at the point where it was interrupted, use "thread return "-x"" to return to the state before expression evaluation. I'm able to see some of the "stack trace", I think is what it is, when I click on the icon of an eye on the right side of the code editor in Playground, but it only shows a small portion it.
1
0
1.3k
Oct ’22
`po` command fails to work after importing XCFramework
We imported pure Swift XCFramework into Swift application. On setting the breaking point and trying the po command the following error is seen error: virtual filesystem overlay file '/Users/rakshitha/Library/Developer/Xcode/DerivedData/ABC-agkiherlqdmvaeakrqtfvsowceuq/Build/Intermediates.noindex/ArchiveIntermediates/ABCDE/IntermediateBuildFilesPath/ABC.build/Release-iphonesimulator/ABCDE.build/all-product-headers.yaml' not found error: virtual filesystem overlay file '/Users/rakshitha/Library/Developer/Xcode/DerivedData/ABC-agkiherlqdmvaeakrqtfvsowceuq/Build/Intermediates.noindex/ArchiveIntermediates/ABCDE/IntermediateBuildFilesPath/MoEngage.build/Release-iphonesimulator/ABCDE.build/all-product-headers.yaml' not found error: couldn't IRGen expression. Please check the above error messages for possible root causes. Solutions Tried: XCFramework was created with dsym and BCSymbolMaps XCFramework created without dsym and BCSymbolMaps Set the Other Swift Flags to -Xfrontend -no-serialize-debugging-options None of the above solutions worked Note: The XCFramework was generated in Xcode 13.4. The Swift version for generated XCFramework is Swift 5. XCFramework contains support for iOS and tvOS. The Sample application was tested in the same Xcode and swift version. Below is the script used to generate XCFramework XCFramework.sh
4
0
3k
Oct ’22
Network warning in iOS 16
In iOS 16, it always show -[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (some uuid interface: utun4, viable, assigned) does not specify local endpoint after call [NWListener start:]. This issue doesn't happen in iOS 15. Although it looks like a crash, the app keeps working and getting data. What does "specify local endpoint" mean? 2022-09-19 15:02:25.095386+0800 APP[9856:768096] [] -[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (BD6CB5B1-1461-4B1F-B321-3A382BD259CF, interface: utun4, viable, assigned) does not specify local endpoint 2022-09-19 15:02:25.096106+0800 APP[9856:768096] [] -[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (BD6CB5B1-1461-4B1F-B321-3A382BD259CF, interface: utun4, viable, assigned) does not specify local endpoint, dumping backtrace:         [arm64] libnetcore-3013.2.2     0   Network                             0x00000001b8d892f0 __nw_create_backtrace_string + 192     1   Network                             0x00000001b8e450f4 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 7389428     2   Network                             0x00000001b8a36d84 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3136900     3   Network                             0x00000001b8e35e60 nw_array_apply + 124     4   Network                             0x00000001b8a3433c F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3126076     5   Network                             0x00000001b8a47a54 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3205716     6   Network                             0x00000001b8a4775c F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3204956     7   Network                             0x00000001b9059788 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 9570184     8   Network                             0x00000001b90585fc F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 9565692     9   Network                             0x00000001b90708c4 nw_path_evaluator_force_update + 124     10  libdispatch.dylib                   0x0000000101610598 _dispatch_call_block_and_release + 32     11  libdispatch.dylib                   0x000000010161204c _dispatch_client_callout + 20     12  libdispatch.dylib                   0x000000010161c6f0 _dispatch_workloop_invoke + 2952     13  libdispatch.dylib                   0x0000000101627cac _dispatch_workloop_worker_thread + 740     14  libsystem_pthread.dylib             0x0000000204c7cdf8 _pthread_wqthread + 288     15  libsystem_pthread.dylib             0x0000000204c7cb98 start_wqthread + 8 2022-09-19 15:02:25.098250+0800 APP[9856:768096] [] __nwlog_err_simulate_crash simulate crash already simulated "-[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (BD6CB5B1-1461-4B1F-B321-3A382BD259CF, interface: utun4, viable, assigned) does not specify local endpoint" 2022-09-19 15:02:25.098871+0800 APP[9856:768096] [] -[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (BD6CB5B1-1461-4B1F-B321-3A382BD259CF, interface: utun4, viable, assigned) does not specify local endpoint, dumping backtrace:         [arm64] libnetcore-3013.2.2     0   Network                             0x00000001b8d892f0 __nw_create_backtrace_string + 192     1   Network                             0x00000001b8e450f4 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 7389428     2   Network                             0x00000001b8a36d84 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3136900     3   Network                             0x00000001b8e35e60 nw_array_apply + 124     4   Network                             0x00000001b8a3433c F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3126076     5   Network                             0x00000001b8a47a54 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3205716     6   Network                             0x00000001b8a4775c F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3204956     7   Network                             0x00000001b9059788 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 9570184     8   Network                             0x00000001b90585fc F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 9565692     9   Network                             0x00000001b90708c4 nw_path_evaluator_force_update + 124     10  libdispatch.dylib                   0x0000000101610598 _dispatch_call_block_and_release + 32     11  libdispatch.dylib                   0x000000010161204c _dispatch_client_callout + 20     12  libdispatch.dylib                   0x000000010161c6f0 _dispatch_workloop_invoke + 2952     13  libdispatch.dylib                   0x0000000101627cac _dispatch_workloop_worker_thread + 740     14  libsystem_pthread.dylib             0x0000000204c7cdf8 _pthread_wqthread + 288     15  libsystem_pthread.dylib             0x0000000204c7cb98 start_wqthread + 8
1
0
1.3k
Sep ’22
C++: Platform-independent development environment
Right now I am having a very difficult time trying to get CMake+LLVM (clang) working proper on macos. Microsoft Visual Studio doesn't seem to support C++ development on macos, XCode seems to want to completely ignore the ~/bin and /usr/bin folders when executing custom build commands (I wrote a script to call cmake and make in the proper directories), and VSCode just SKIPS all my breakpoints (and it appears LLVM is completely ignoring the -g and excluding debug symbols)... Has anyone been able to get a platform-independent toolset running on macos??? If so how have you been able to do this and what toolset + IDE are you using? If you were able to get XCode of VSCode to work how did you do it? maybe I'm doing somthing wrong. Here is my cmakelists.txt: (https://pastebin.com/RymrmUfk) Here is my build command: (https://pastebin.com/wbdpccZ6)
1
0
1.9k
Sep ’22
process exiting with SIGSEGV(-11) under lldb on M1 Ultra opens Problem Report instead of returning to the debugger
I've jumped through a couple of unexpected hoops to get here, following some suggestions online: I've used DevToolsSecurity -enalble, and I've used dseditgroup -o edit -a me -t user _developer to put myself in the _developer group. That has at least got lldb past the "process exited with status -1 (developer mode is not enabled on this machine and this is a non-interactive debug session.)" problem. I'm also running through VNC, rather than ssh, so that I can see pop-ups and new windows, but my preference is for ssh. The crash that I'm trying to debug is in some numpy function in a python program that is spawning multiple threads, so it's relatively hairy, but my past experience has been that running code under lldb results in return to lldb when the program segfaults, but with this code, on this machine, lldb just unhelpfully says that the workers exited with SIGSEGV(-11) and the Problem Report screen pops up to send the results to Apple. I don't want or expect Apple to debug this problem. I want to do it myself. How do I stop the Problem Report app from taking control? FWIW the python that I'm running is 3.8 installed from MacPorts, but the numpy is running from a venv and was installed by pip according to a project's requirements.txt.
0
0
1.5k
Sep ’22
Debugger crashes if breakpoint set in @objc func triggered by Notification
My BalanceManager object is called at app startup and after it fetches some data, it posts a notification. In the @objc implementation of the SplashScreenVC observer I am setting a breakpoint. The debugger crashes with the following log: Message from debugger: 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. I am using this SplashScreenVC that listens for this notification to fetch data, load some user defaults etc. The data fetch runs without problem and I don't have this kind of debugging problem in other views in my program. The debugger crashes only in this particular ViewController which is also my main program entry point Any ideas why this thing happens? override func viewDidLoad() {     super.viewDidLoad()     setupUI() NotificationCenter.default.addObserver(self, selector: #selector(balancesDidUpdate), name: .balancesUpdated, object: BalanceManager.shared)           //Fetch data     Task { await BalanceManager.shared.fetchData() }           }    @objc func balancesDidUpdate(_ notification: Notification) {     print("balancesDidUpdate in SplashScreenVC via notification")      //more code here    }
0
0
938
Sep ’22
Not able to connect to process neither from Xcode or lldb from terminal
Hi, I'm using macOS 12.5, Xcode 13.4.1 to develop system extension based app. When I'm trying to connect debugger to system extension(by pid, by name or choosing from list), process crashes every time, when I try to connect to it throught lldb I'm getting error Process 1098 stopped * thread #1, stop reason = signal SIGSTOP frame #0: 0xffffffffffffffff  Target 0: (No executable module.) stopped. Architecture set to: . Process 1098 exited with status = -1 (0xffffffff) debugserver died with an exit status of 0x00000000 Would be grateful for any suggestions
1
0
1.3k
Aug ’22
error: invalid target, create a target using the 'target create' command
The actual issue is that Xcode 13 does stop at breapoints, but using the debugger (po someObject) does not print but gives us an error: warning: Swift error in scratch context: error: /Path/To/OurApp/OurApp-Bridging-Header.h:14:9: error: 'SomeSucessfulyUsedDependency.h' file not found This issue happens on parts of our code, other parts work fine. This is reproducible. The same project works fine with Xcode 12 Starting with Xcode 13, when running our app in DEBUG config on sim or device (both iOS 15, but we have tested sims <iOS15 too), the first line in console is: error: invalid target, create a target using the 'target create' command It looks like Xcode 13 is unable to create a target in LLDB. But maybe the console output is misleading and unrelated. That obviously make debugging a none-nice process ... Any help appreciated.
13
1
4k
Aug ’22
Recommendation on How to Learn More on Using Various Xcode Debugging Panes
I don’t have a fundamental background in Computer Science or Computing Engineering. I want to learn more about how to do code debugging, but within the bounds of how Xcode provides various debugging panes. I’ve seen a number of WWDC session videos about Xcode and debugging. However I really need to learn more about the fundamentals of using Xcode panes like the stack trace pane, the variables pane, and the debugging console. I would greatly appreciate any advice on tutorials, videos, WWDC sessions, etc. that go to the basic levels of what these panes show, how to interpret the content, and how to interact with the information in various Xcode debugging-related panes. Thank you.
0
0
1.1k
Jun ’22
lldb fails to launch process: "Not allowed to attach to process"
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?
6
0
10k
Apr ’22
Xcode debugging tools fail to attach to app on launch. Getting "Terminated due to signal 9" error
Hello! When I update my source code then build and run my app, the debugger fails to attach. Xcode says it is "Attaching to Bowtie on iPhone 8" while the simulator shows my app launch screen (Bowtie is the name of my app target). After about 30 seconds, Xcode says it "Finished running" my app and my debugger says "Message from debugger: Terminated due to signal 9". After this, the app instance continues its launch in the simulator, but Xcode is not connected to the running process, so I get no debugging tools whatsoever. If I then re-run the app it launches fine: this only occurs if the source code changes. Any ideas here?
0
0
1.5k
Mar ’22
LLDB fails to launch app from XCode 13
I'm getting the error: ** "Warning: Error creating LLDB target at path '/Users/tantan/Library/Developer/Xcode/DerivedData/Videe-bpukzfmjaxewiuaiolulcqllukjg/Build/Products/Debug-iphonesimulator/[AppName].app'- using an empty LLDB target which can cause slow memory reads from remote devices."** Is there anyone who can explain to me what the reason is and how can fix it? Thanks,
Replies
1
Boosts
0
Views
2.5k
Activity
Nov ’22
Xcode 14.1: “error: Couldn’t realize type of self”
I recently added Swift to my existing objective-c static library project and encountering issues when debugging Swift code. While in a breakpoint and entering po command to print a variable value I get: error: expression failed to parse: error: Couldn't realize type of self Note the following: The project is an objective-c static library with recently added Swift files. The error appears only when breakpoint is in a Swift file. There is no issues while debugging objective-c file (*.m file). Xcode version is 14.1 Project is using CocoaPods. There are no issues with compilation and runtime. The only issue is with debugging Swift code. When running swift-healthcheck from breakpoint, there are plenty of errors as follow: LoadOneModule() -- Missing Swift module or Clang module found for "Infra", "imported" via SwiftDWARFImporterDelegate. Hint: Register Swift modules with the linker using -add_ast_path. While Infra is the name of my static library. (I couldn't find any helpful instructions explaining how to register swift modules, while I'm not even sure it points to the actual issue). Any suggestions will be highly appreciated.
Replies
0
Boosts
1
Views
1.5k
Activity
Nov ’22
Crash debugging for translated x86_64 process under Rosetta
Hi all, I want to analyze the crash dump of translated x86_64 application under Rosetta emulation. After survey, I enable core dump at the start of my application, build application with DWARF and dSym config in XCode, and collect core dump from /cores/core.PID However, when I want to analyze core dump with lldb, I use the following command for backtracing: lldb -c /cores/core.PID (lldb) target create --core "/cores/core.PID" Core file '/cores/core.PID' (arm64) was loaded. (lldb) bt and I only got frame number with function address * thread #1, stop reason = ESR_EC_DABORT_EL0 (fault address: 0x0) * frame #0: 0x0000000102ae4c04 * frame #1: 0x0000000202d166ac Therefore, I try to add-sym but get the following error message: error: symbol file 'xxxxx.dSYM' does not match any existing module I know that macOS would generate crash report in ~/Library/Logs/DiagnosticReports/, but I need further analysis of crash dump. Is there any way to do post-mortem debugging for translated process under Rosetta? Thanks!
Replies
1
Boosts
0
Views
1.9k
Activity
Nov ’22
Swift LLDB fail
when i use po, alway show this error. (lldb) po viewModel error: warning: Failed to load linked library UIKit of module Login - errors: Looking for "@rpath/UIKit.framework/UIKit", error: (null) Failed to find framework for "UIKit" looking along paths:  /Users/name/Library/Developer/Xcode/DerivedData/Game-fbcssrnefpcutjgjoxicuabsatne/Build/Products/Debug-iphoneos/UIKit.framework/ Looking for "/Users/name/Library/Developer/Xcode/DerivedData/MegabilityInterface-hiqhsjxojjhqgudnbcwzmovnxrqu/Build/Intermediates.noindex/ArchiveIntermediates/MegabilityInterface/BuildProductsPath/Release-iphoneos/UIKit.framework/" ,  error: (null) error: <EXPR>:2:11: error: cannot find type '$__lldb_context' in scope extension $__lldb_context {      ^~~~~~~~~~~~~~~ error: <EXPR>:19:5: error: cannot find '$__lldb_injected_self' in scope   $__lldb_injected_self.$__lldb_wrapped_expr_10(   ^~~~~~~~~~~~~~~~~~~~~ (lldb)  I was try setting this config by SWIFT_OPTIMIZATION_LEVEL DEBUG_INFORMATION_FORMAT Still does't work. if i use IDE 'Print Description of "viewModel" ' Printing description of viewModel: (Game.ViewModel) viewModel = <Unable to determine byte size.> Still error of LLDB?
Replies
2
Boosts
0
Views
2.8k
Activity
Nov ’22
lldb sometimes doesn't stop at breakpoints
I have some python scripts that I'm using within lldb to track messages that I receive from Endpoint Security (I'm trying to track down an issue where I may not respond to an es_message_t). So I added breakpoints for es_retain_message, es_release_message, es_respond_auth_result and es_respond_flags_result. And it works great... Some of the time. But it--fairly frequently--won't trigger one of the breakpoints. I will see cases where the es_retain_message python code didn't run but the es_respond_auth_result and the es_release_message did. Or any combination thereof. And sometimes they will all be called and everything will work out fine. I'm thinking there may be something thread based. All of the breakpoints are within code blocks--one from Endpoint Security and the other as an application-specific one (a concurrent queue). The pseudo-code looks something like: // Within the ES code block ... es_retain_message(msg) ... dispatch_async(localConcurrentQueue, ^{ ... es_respond_auth_result(msg) // or es_respond_flags_result, depending... ... es_release_message(msg) } I feel like I see this happen more often when my python script prints, but I haven't measured it to see if that's really happening. I've tried removing some of the printing and tried various creative uses of lldb.SBDebugger.SetAsync to no avail. Is there a known issue in lldb that I'm missing?
Replies
2
Boosts
0
Views
1.9k
Activity
Nov ’22
Remote Debugging for Authorization Plugins
Hi all,We are developing a variety of login window plugins for macOS and are looking for greater control of the debugging process. I've followed the steps in Technical Note TN2108: Debugging An Authorization Plug-In With Xcode, but they don't seem to work on modern macOS, even with SIP disabled. It would seem that SecurityAgent has some anti-debug protection in it now as I can't connect to the running instance with lldb.As a work around we've resorted to caveman debugging with lots of log statements, but that's more than a bit of a pain to do as our products become more complex. Having debugging in Xcode would be best, but at this rate I'll even settle for lldb.Any ideas?Thanks,Josh
Replies
4
Boosts
0
Views
3.7k
Activity
Oct ’22
How do I use lldb with Playground?
I'm getting a runtime error in Playground that tells me to run an lldb command. I am not able to type anything in the debug area of Playground as I can in Xcode. How do I use lldb with Playground. Specifically, the error I'm getting is: error: Execution was interrupted, reason: shared-library-event. The process has been left at the point where it was interrupted, use "thread return "-x"" to return to the state before expression evaluation. I'm able to see some of the "stack trace", I think is what it is, when I click on the icon of an eye on the right side of the code editor in Playground, but it only shows a small portion it.
Replies
1
Boosts
0
Views
1.3k
Activity
Oct ’22
`po` command fails to work after importing XCFramework
We imported pure Swift XCFramework into Swift application. On setting the breaking point and trying the po command the following error is seen error: virtual filesystem overlay file '/Users/rakshitha/Library/Developer/Xcode/DerivedData/ABC-agkiherlqdmvaeakrqtfvsowceuq/Build/Intermediates.noindex/ArchiveIntermediates/ABCDE/IntermediateBuildFilesPath/ABC.build/Release-iphonesimulator/ABCDE.build/all-product-headers.yaml' not found error: virtual filesystem overlay file '/Users/rakshitha/Library/Developer/Xcode/DerivedData/ABC-agkiherlqdmvaeakrqtfvsowceuq/Build/Intermediates.noindex/ArchiveIntermediates/ABCDE/IntermediateBuildFilesPath/MoEngage.build/Release-iphonesimulator/ABCDE.build/all-product-headers.yaml' not found error: couldn't IRGen expression. Please check the above error messages for possible root causes. Solutions Tried: XCFramework was created with dsym and BCSymbolMaps XCFramework created without dsym and BCSymbolMaps Set the Other Swift Flags to -Xfrontend -no-serialize-debugging-options None of the above solutions worked Note: The XCFramework was generated in Xcode 13.4. The Swift version for generated XCFramework is Swift 5. XCFramework contains support for iOS and tvOS. The Sample application was tested in the same Xcode and swift version. Below is the script used to generate XCFramework XCFramework.sh
Replies
4
Boosts
0
Views
3k
Activity
Oct ’22
Network warning in iOS 16
In iOS 16, it always show -[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (some uuid interface: utun4, viable, assigned) does not specify local endpoint after call [NWListener start:]. This issue doesn't happen in iOS 15. Although it looks like a crash, the app keeps working and getting data. What does "specify local endpoint" mean? 2022-09-19 15:02:25.095386+0800 APP[9856:768096] [] -[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (BD6CB5B1-1461-4B1F-B321-3A382BD259CF, interface: utun4, viable, assigned) does not specify local endpoint 2022-09-19 15:02:25.096106+0800 APP[9856:768096] [] -[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (BD6CB5B1-1461-4B1F-B321-3A382BD259CF, interface: utun4, viable, assigned) does not specify local endpoint, dumping backtrace:         [arm64] libnetcore-3013.2.2     0   Network                             0x00000001b8d892f0 __nw_create_backtrace_string + 192     1   Network                             0x00000001b8e450f4 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 7389428     2   Network                             0x00000001b8a36d84 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3136900     3   Network                             0x00000001b8e35e60 nw_array_apply + 124     4   Network                             0x00000001b8a3433c F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3126076     5   Network                             0x00000001b8a47a54 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3205716     6   Network                             0x00000001b8a4775c F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3204956     7   Network                             0x00000001b9059788 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 9570184     8   Network                             0x00000001b90585fc F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 9565692     9   Network                             0x00000001b90708c4 nw_path_evaluator_force_update + 124     10  libdispatch.dylib                   0x0000000101610598 _dispatch_call_block_and_release + 32     11  libdispatch.dylib                   0x000000010161204c _dispatch_client_callout + 20     12  libdispatch.dylib                   0x000000010161c6f0 _dispatch_workloop_invoke + 2952     13  libdispatch.dylib                   0x0000000101627cac _dispatch_workloop_worker_thread + 740     14  libsystem_pthread.dylib             0x0000000204c7cdf8 _pthread_wqthread + 288     15  libsystem_pthread.dylib             0x0000000204c7cb98 start_wqthread + 8 2022-09-19 15:02:25.098250+0800 APP[9856:768096] [] __nwlog_err_simulate_crash simulate crash already simulated "-[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (BD6CB5B1-1461-4B1F-B321-3A382BD259CF, interface: utun4, viable, assigned) does not specify local endpoint" 2022-09-19 15:02:25.098871+0800 APP[9856:768096] [] -[nw_ip_channel_inbox initWithPath:flow:parameters:delegate:] flow (BD6CB5B1-1461-4B1F-B321-3A382BD259CF, interface: utun4, viable, assigned) does not specify local endpoint, dumping backtrace:         [arm64] libnetcore-3013.2.2     0   Network                             0x00000001b8d892f0 __nw_create_backtrace_string + 192     1   Network                             0x00000001b8e450f4 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 7389428     2   Network                             0x00000001b8a36d84 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3136900     3   Network                             0x00000001b8e35e60 nw_array_apply + 124     4   Network                             0x00000001b8a3433c F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3126076     5   Network                             0x00000001b8a47a54 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3205716     6   Network                             0x00000001b8a4775c F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 3204956     7   Network                             0x00000001b9059788 F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 9570184     8   Network                             0x00000001b90585fc F9E2A765-5770-3360-AF20-CA5B923FCBF2 + 9565692     9   Network                             0x00000001b90708c4 nw_path_evaluator_force_update + 124     10  libdispatch.dylib                   0x0000000101610598 _dispatch_call_block_and_release + 32     11  libdispatch.dylib                   0x000000010161204c _dispatch_client_callout + 20     12  libdispatch.dylib                   0x000000010161c6f0 _dispatch_workloop_invoke + 2952     13  libdispatch.dylib                   0x0000000101627cac _dispatch_workloop_worker_thread + 740     14  libsystem_pthread.dylib             0x0000000204c7cdf8 _pthread_wqthread + 288     15  libsystem_pthread.dylib             0x0000000204c7cb98 start_wqthread + 8
Replies
1
Boosts
0
Views
1.3k
Activity
Sep ’22
C++: Platform-independent development environment
Right now I am having a very difficult time trying to get CMake+LLVM (clang) working proper on macos. Microsoft Visual Studio doesn't seem to support C++ development on macos, XCode seems to want to completely ignore the ~/bin and /usr/bin folders when executing custom build commands (I wrote a script to call cmake and make in the proper directories), and VSCode just SKIPS all my breakpoints (and it appears LLVM is completely ignoring the -g and excluding debug symbols)... Has anyone been able to get a platform-independent toolset running on macos??? If so how have you been able to do this and what toolset + IDE are you using? If you were able to get XCode of VSCode to work how did you do it? maybe I'm doing somthing wrong. Here is my cmakelists.txt: (https://pastebin.com/RymrmUfk) Here is my build command: (https://pastebin.com/wbdpccZ6)
Replies
1
Boosts
0
Views
1.9k
Activity
Sep ’22
process exiting with SIGSEGV(-11) under lldb on M1 Ultra opens Problem Report instead of returning to the debugger
I've jumped through a couple of unexpected hoops to get here, following some suggestions online: I've used DevToolsSecurity -enalble, and I've used dseditgroup -o edit -a me -t user _developer to put myself in the _developer group. That has at least got lldb past the "process exited with status -1 (developer mode is not enabled on this machine and this is a non-interactive debug session.)" problem. I'm also running through VNC, rather than ssh, so that I can see pop-ups and new windows, but my preference is for ssh. The crash that I'm trying to debug is in some numpy function in a python program that is spawning multiple threads, so it's relatively hairy, but my past experience has been that running code under lldb results in return to lldb when the program segfaults, but with this code, on this machine, lldb just unhelpfully says that the workers exited with SIGSEGV(-11) and the Problem Report screen pops up to send the results to Apple. I don't want or expect Apple to debug this problem. I want to do it myself. How do I stop the Problem Report app from taking control? FWIW the python that I'm running is 3.8 installed from MacPorts, but the numpy is running from a venv and was installed by pip according to a project's requirements.txt.
Replies
0
Boosts
0
Views
1.5k
Activity
Sep ’22
Debugger crashes if breakpoint set in @objc func triggered by Notification
My BalanceManager object is called at app startup and after it fetches some data, it posts a notification. In the @objc implementation of the SplashScreenVC observer I am setting a breakpoint. The debugger crashes with the following log: Message from debugger: 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. I am using this SplashScreenVC that listens for this notification to fetch data, load some user defaults etc. The data fetch runs without problem and I don't have this kind of debugging problem in other views in my program. The debugger crashes only in this particular ViewController which is also my main program entry point Any ideas why this thing happens? override func viewDidLoad() {     super.viewDidLoad()     setupUI() NotificationCenter.default.addObserver(self, selector: #selector(balancesDidUpdate), name: .balancesUpdated, object: BalanceManager.shared)           //Fetch data     Task { await BalanceManager.shared.fetchData() }           }    @objc func balancesDidUpdate(_ notification: Notification) {     print("balancesDidUpdate in SplashScreenVC via notification")      //more code here    }
Replies
0
Boosts
0
Views
938
Activity
Sep ’22
App Crashing with message: "Terminated due to memory issue."
My iOS app crashes with this popup: Message from debugger: Terminated due to memory issue In the debugger, I occasionally get this message as well: No error handler for XPC error: Connection interrupted This only happens on a certain iPad Pro (11-inch) and no other devices. It seems to be happening when I am saving data to a file.
Replies
7
Boosts
0
Views
4k
Activity
Aug ’22
Not able to connect to process neither from Xcode or lldb from terminal
Hi, I'm using macOS 12.5, Xcode 13.4.1 to develop system extension based app. When I'm trying to connect debugger to system extension(by pid, by name or choosing from list), process crashes every time, when I try to connect to it throught lldb I'm getting error Process 1098 stopped * thread #1, stop reason = signal SIGSTOP frame #0: 0xffffffffffffffff  Target 0: (No executable module.) stopped. Architecture set to: . Process 1098 exited with status = -1 (0xffffffff) debugserver died with an exit status of 0x00000000 Would be grateful for any suggestions
Replies
1
Boosts
0
Views
1.3k
Activity
Aug ’22
error: invalid target, create a target using the 'target create' command
The actual issue is that Xcode 13 does stop at breapoints, but using the debugger (po someObject) does not print but gives us an error: warning: Swift error in scratch context: error: /Path/To/OurApp/OurApp-Bridging-Header.h:14:9: error: 'SomeSucessfulyUsedDependency.h' file not found This issue happens on parts of our code, other parts work fine. This is reproducible. The same project works fine with Xcode 12 Starting with Xcode 13, when running our app in DEBUG config on sim or device (both iOS 15, but we have tested sims <iOS15 too), the first line in console is: error: invalid target, create a target using the 'target create' command It looks like Xcode 13 is unable to create a target in LLDB. But maybe the console output is misleading and unrelated. That obviously make debugging a none-nice process ... Any help appreciated.
Replies
13
Boosts
1
Views
4k
Activity
Aug ’22
Have you ever seen this debugger message?
build and run app not appear app, and not debug(like freeze app) finally, stop running appear this debugger message in debug area Message from debugger: Xcode has killed the LLDB RPC server to allow the debugger to detach from your process. You may need to manually terminate your process. how do i solve it?
Replies
1
Boosts
0
Views
3.0k
Activity
Jun ’22
Recommendation on How to Learn More on Using Various Xcode Debugging Panes
I don’t have a fundamental background in Computer Science or Computing Engineering. I want to learn more about how to do code debugging, but within the bounds of how Xcode provides various debugging panes. I’ve seen a number of WWDC session videos about Xcode and debugging. However I really need to learn more about the fundamentals of using Xcode panes like the stack trace pane, the variables pane, and the debugging console. I would greatly appreciate any advice on tutorials, videos, WWDC sessions, etc. that go to the basic levels of what these panes show, how to interpret the content, and how to interact with the information in various Xcode debugging-related panes. Thank you.
Replies
0
Boosts
0
Views
1.1k
Activity
Jun ’22
Where can I find headers for LLDB.framework shipped with Xcode?
I know there is https://github.com/apple/llvm-project but how can I know which commit was used to compile lldb that got shipped with Xcode?
Replies
1
Boosts
0
Views
1.4k
Activity
Apr ’22
lldb fails to launch process: "Not allowed to attach to process"
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?
Replies
6
Boosts
0
Views
10k
Activity
Apr ’22
Xcode debugging tools fail to attach to app on launch. Getting "Terminated due to signal 9" error
Hello! When I update my source code then build and run my app, the debugger fails to attach. Xcode says it is "Attaching to Bowtie on iPhone 8" while the simulator shows my app launch screen (Bowtie is the name of my app target). After about 30 seconds, Xcode says it "Finished running" my app and my debugger says "Message from debugger: Terminated due to signal 9". After this, the app instance continues its launch in the simulator, but Xcode is not connected to the running process, so I get no debugging tools whatsoever. If I then re-run the app it launches fine: this only occurs if the source code changes. Any ideas here?
Replies
0
Boosts
0
Views
1.5k
Activity
Mar ’22