{"id":19096980,"url":"https://github.com/shoheiyokoyama/lldb-debugging","last_synced_at":"2025-10-26T12:33:47.883Z","repository":{"id":84731578,"uuid":"160385658","full_name":"shoheiyokoyama/LLDB-Debugging","owner":"shoheiyokoyama","description":"The LLDB Debugging in C, Swift, Objective-C, Python and Xcode","archived":false,"fork":false,"pushed_at":"2019-01-07T05:18:06.000Z","size":2656,"stargazers_count":42,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T14:28:59.644Z","etag":null,"topics":["c","debugging","debugging-tool","ios","lldb","llvm","objective-c","python","repl","swift","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shoheiyokoyama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-04T16:18:32.000Z","updated_at":"2025-02-27T22:45:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ef6e1cf-d124-4c08-88c3-87c26db587c7","html_url":"https://github.com/shoheiyokoyama/LLDB-Debugging","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoheiyokoyama%2FLLDB-Debugging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoheiyokoyama%2FLLDB-Debugging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoheiyokoyama%2FLLDB-Debugging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoheiyokoyama%2FLLDB-Debugging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shoheiyokoyama","download_url":"https://codeload.github.com/shoheiyokoyama/LLDB-Debugging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251721249,"owners_count":21632797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","debugging","debugging-tool","ios","lldb","llvm","objective-c","python","repl","swift","xcode"],"created_at":"2024-11-09T03:38:22.494Z","updated_at":"2025-10-26T12:33:47.786Z","avatar_url":"https://github.com/shoheiyokoyama.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLDB Debugging\n\n\u003cimg src=\"https://github.com/shoheiyokoyama/LLDBDebugging/blob/master/Assets/DragonFull.png\" width=\"300\" align=\"left\"\u003e\n\n# \u003ca name=\"the-lldb-debugger\"\u003e The LLDB Debugger\n\nThe LLDB Debugger (LLDB) is an open-source software debugger that is a next generation, high-performance. It features a REPL, along with C++ and Python plugins.\n\nA debugger allows you to pause a program at a specific moment of its execution, inspect the values of variables, execute custom instructions, and then manipulate the advancement of the program as you see fit. \n\nLLDB is the default debugger in Xcode on Mac OS X and supports debugging C, Objective-C and C++ on the desktop and iOS devices and simulator.\n\n# Contents\n\n- [The REPL and Debugger in Swift](https://github.com/shoheiyokoyama/LLDB-Debugging/tree/master/swift#the-repl-and-debugger-in-swift)\n- [The LLDB Debugging in C program](https://github.com/shoheiyokoyama/LLDBDebugging/tree/master/c#the-lldb-debugging-in-c-program)\n- [The Debugging with Xcode and LLDB](https://github.com/shoheiyokoyama/LLDBDebugging/tree/master/DBug#the-debugging-with-xcode-and-lldb)\n- [The LLDB Debugger](#the-lldb-debugger)\n  - [The LLDB command](#lldb-command)\n  - [Config file](#config-file)\n  - [Custom LLDB command using Python](#custom-lldb-command-ussing-python)\n  - [References](#references)\n  - [Platform support](#platform-support)\n  - [Author](#author)\n\n\n## \u003ca name=\"lldb-command\"\u003e The LLDB command\n\nThe LLDB commands are all of the form:\n\n```\n\u003cnoun\u003e \u003cverb\u003e [-options [option-value]] [argument [argument...]]\n```\n\nYou can see the debugger commands with the help command.\n\n```\n(lldb) help\nDebugger commands:\napropos           -- List debugger commands related to a word or subject.\nbreakpoint        -- Commands for operating on breakpoints (see 'help b' for\nshorthand.)\nbugreport         -- Commands for creating domain-specific bug reports.\ncommand           -- Commands for managing custom LLDB commands.\ndisassemble       -- Disassemble specified instructions in the current\ntarget.  Defaults to the current function for the\ncurrent thread and stack frame.\nexpression        -- Evaluate an expression on the current thread.  Displays\nany returned value with LLDB's default formatting.\nframe             -- Commands for selecting and examing the current thread's\nstack frames.\ngdb-remote        -- Connect to a process via remote GDB server.  If no host\nis specifed, localhost is assumed.\n\n...\n```\n\nAlso, can see more detailed commands by adding commands and subcommand options (`help \u003ccommand\u003e \u003csubcommand\u003e`).\n\n```\n(lldb) help breakpoint\nCommands for operating on breakpoints (see 'help b' for shorthand.)\n\nSyntax: breakpoint \u003csubcommand\u003e [\u003ccommand-options\u003e]\n\nThe following subcommands are supported:\n\nclear   -- Delete or disable breakpoints matching the specified source\nfile and line.\ncommand -- Commands for adding, removing and listing LLDB commands\nexecuted when a breakpoint is hit.\ndelete  -- Delete the specified breakpoint(s).  If no breakpoints are\nspecified, delete them all.\ndisable -- Disable the specified breakpoint(s) without deleting them.  If\nnone are specified, disable all breakpoints.\nenable  -- Enable the specified disabled breakpoint(s). If no breakpoints\nare specified, enable all of them.\n\n...\n```\n\nThere are more command sample at [GDB TO LLDB COMMAND MAP](https://lldb.llvm.org/lldb-gdb.html)\n\n## \u003ca name=\"config-file\"\u003e Config file\n\n`~/.lldbinit` is loaded when CLI is started. (for Xcode, `~/.lldbinit-Xcode` is loaded)\n\nIt's useful to set module import and alias settings in this file.\n\n- alias: `command alias b breakpoint`\n- unalias: `command unalias b`\n- file import: `command script import path/xxx.py`\n\n##  \u003ca name=\"custom-lldb-command-ussing-python\"\u003e Custom LLDB command using Python\n\nYou can create new commands by using python function.\n\nTo write a python function that implements a new LLDB command define the function to take four arguments as follows:\n\n```python\ndef command_function(debugger, command, result, internal_dict):\n    # Your code goes here\n```\n\nThe below function will get run when the module is loaded allowing you to add whatever commands you want into the current debugger. \n\n```python\ndef __lldb_init_module(debugger, internal_dict):\n    # Command Initialization code goes here\n```\n\n\u003e NOTE: this function will only be run when using the LLDB command command script import, it will not get run if anyone imports your module from another module. \n\nAdd the following script, to add a new command.\n\n```\ncommand script add -f filename.function_name command_name\n```\n\n| Argument | Type | Description |\n|---|---|---|\n| debugger | lldb.SBDebugger | The current debugger object |\n| command | python string | A python string containing all arguments for your command. If you need to chop up the arguments try using the shlex module's shlex.split(command) to properly extract the arguments. |\n| result | lldb.SBCommandReturnObject | A return object which encapsulates success/failure information for the command and output text that needs to be printed as a result of the command. The plain Python \"print\" command also works but text won't go in the result by default (it is useful as a temporary logging facility). |\n| internal_dict | python dict object | The dictionary for the current embedded script session which contains all variables and functions. |\n\nSee [LLDB Python Reference](https://lldb.llvm.org/python-reference.html) for more information.\n\n## \u003ca name=\"platform-support\"\u003e Platform support\n\n- Mac OS X desktop user space debugging for i386 and x86-64\n- iOS simulator debugging on i386\n- iOS device debugging on ARM\n- Linux local user-space debugging for i386, x86-64 and PPC64le\n- FreeBSD local user-space debugging for i386 and x86-64\n- Windows local user-space debugging for i386 (*)\n\n## \u003ca name=\"references\"\u003e References\n\n- [The LLDB Debugger](https://lldb.llvm.org/index.html)\n- [LLDB Quick Start Guide](https://developer.apple.com/library/archive/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/Introduction.html#//apple_ref/doc/uid/TP40012917-CH1-SW1)\n- [Advanced Debugging with Xcode and LLDB](https://developer.apple.com/videos/play/wwdc2018/412/)\n- [Dancing in the Debugger — A Waltz with LLDB](https://www.objc.io/issues/19-debugging/lldb-debugging/)\n- [lldb Python classes reference guide](https://lldb.llvm.org/python_reference/index.html)\n- [facebook/chisel](https://github.com/facebook/chisel)\n- [apple/swift-lldb](https://github.com/apple/swift-lldb)\n- [REPL and Debugger](https://swift.org/lldb/)\n- [Introduction to the Swift REPL](https://developer.apple.com/swift/blog/?id=18)\n\n## \u003ca name=\"author\"\u003e Author\n\nShohei Yokoyama\n\n- [GitHub](https://github.com/shoheiyokoyama)\n- [Facebook](https://www.facebook.com/shohei.yokoyama.96)\n- [Twitter](https://twitter.com/shoheiyokoyam)\n- Gmail: shohei.yok0602@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoheiyokoyama%2Flldb-debugging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshoheiyokoyama%2Flldb-debugging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoheiyokoyama%2Flldb-debugging/lists"}