# LLDB Reproducers

DevFeed: [LLDB Reproducers](<https://devfeed.tech/articles/lldb-reproducers-25399.md>)

Original publisher: [Read original article](<https://smileykeith.com/2020/09/29/lldb-reproducers/>)

Author: Keith Smiley

Published: 2020-09-30T02:39:00Z

Content type: tutorial

Language: en

Sources: [Keith Smiley](<https://devfeed.tech/sources/keith-smiley.md>)

Topics: [debugging](<https://devfeed.tech/topics/debugging.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [macOS](<https://devfeed.tech/topics/macos.md>), [Terminal](<https://devfeed.tech/topics/terminal.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [simulator](<https://devfeed.tech/topics/simulator.md>), [bug](<https://devfeed.tech/topics/bug.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [bug](<https://devfeed.tech/tags/bug.md>), [cli](<https://devfeed.tech/tags/cli.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [ios](<https://devfeed.tech/tags/ios.md>), [macos](<https://devfeed.tech/tags/macos.md>), [simulator](<https://devfeed.tech/tags/simulator.md>), [swift](<https://devfeed.tech/tags/swift.md>), [terminal](<https://devfeed.tech/tags/terminal.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

## AI overview

This article explains how LLDB reproducers capture debugging-session information so Swift developers can provide Apple with more useful and repeatable bug reports. It covers the limitation that launching LLDB from Xcode does not enable capture mode by default, privacy risks involving binaries and memory, and workflows for macOS programs and iOS apps running in the simulator.

## Source excerpt

Swift developers love to complain about LLDB. While there are many reasonable complaints, the important question is what can we do to make it better. Enter reproducers. Reproducers provide a way to run LLDB while also capturing information about your debugging session. With this information you can submit a more useful bug report to Apple with a reliable reproduction case. How? Although the steps to use reproducers are mostly straightforward, launching LLDB from Xcode does not enable --capture mode (FB7878562). This means if you want to provide a reproducer for an issue you've experienced in a Xcode debugging session, you need to reproduce it outside of Xcode instead. Update: the folks from PSPDFKit pointed out as of Xcode 12 there is a private default for enabling capture mode for debugging sessions launched from Xcode: defaults write com.apple.dt.Xcode IDEDebuggerEnableReproducerCapture -bool YES Note: to provide enough information to reproduce your issue, LLDB bundles all files the debugging session touched. This includes binaries with debug info that you may consider sensitive. As pointed out on Twitter this will also contain anything in memory at the time of capture. Be sure to verify what you're sharing with Apple before you send it. CLI / macOS app If you're debugging a program on your Mac, there are a few steps: Run the app in Xcode and stop it. This way you know the binary is up to date. In Terminal.app navigate to your DerivedData directory (you can find this by right clicking on your app in the "Products" section of Xcode's project navigator, and clicking "Show in Finder"). Run lldb --capture /path/to/Your.app. In the LLDB session run process launch --stop-at-entry. Now you're in a paused LLDB session. Here you can set the breakpoints you need to reproduce your issue. Often for me this means breaking at a specific place, and running some version of po foo that causes an issue. Once you're done reproducing the issue, run reproducer generate in LLDB. This w