{"id":21712529,"url":"https://github.com/youfoundron/lldb-basics","last_synced_at":"2026-01-31T18:04:52.780Z","repository":{"id":35632894,"uuid":"39906989","full_name":"youfoundron/lldb-basics","owner":"youfoundron","description":"A basic overview of lldb.","archived":false,"fork":false,"pushed_at":"2015-07-29T18:26:45.000Z","size":676,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T21:07:03.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/youfoundron.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}},"created_at":"2015-07-29T17:33:45.000Z","updated_at":"2019-05-07T10:36:13.000Z","dependencies_parsed_at":"2022-08-17T21:40:40.184Z","dependency_job_id":null,"html_url":"https://github.com/youfoundron/lldb-basics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/youfoundron/lldb-basics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youfoundron%2Flldb-basics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youfoundron%2Flldb-basics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youfoundron%2Flldb-basics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youfoundron%2Flldb-basics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youfoundron","download_url":"https://codeload.github.com/youfoundron/lldb-basics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youfoundron%2Flldb-basics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28949274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-25T23:39:47.636Z","updated_at":"2026-01-31T18:04:52.765Z","avatar_url":"https://github.com/youfoundron.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"#LLDB Basics\nA basic overview of lldb for personal reference.  \nOfficial documentation can be found here \u003ca href=\"http://lldb.llvm.org/\"\u003ehere\u003c/a\u003e.\n\n##Command Structure\nGeneral syntax  \n```\n\u003cnoun\u003e \u003cverb\u003e [-options [option-value]] [argument [argument...]]\n```  \n  \nOptions can be placed anywhere but if an argument begins with '-', you have to signifiy an option termination with '--'  \n```\n\u003cnoun\u003e \u003cverb\u003e [-options [option-value]] -- [argument [argument...]]\n```\n\n##Loading in a Program\nSpecify the file you wish to debug on start  \n```\n$ lldb /nilisp.c\n```  \n  \nOr after with the file command  \n```\n(lldb) file /nilisp.c\n```  \n  \n##Starting or Attaching to Your Program  \nTo launch a program use the \"process launch\" command or one of its aliases\n```\n(lldb) process launch\n(lldb) run\n(lldb) r\n```  \n  \nYou can also attach to a process by pid or name  \n```\n(lldb) process attach --pid 123\n(lldb) process attach -p 123\n(lldb) process attach --name Nihilisp\n```  \n  \nThe 'waitfor' option attaches debugging to the next process with given name  \n```\n(lldb) process attach --name Nihilisp --waitfor\n```\n\n##Breakpoints##\nTo see all the options for breakpoint setting  \n```\n(lldb) help breakpoint\n```  \n\n**List** out breakpoints you've set  \n```\n(lldb) breakpoint list\n(lldb) br l\n```\n\n**Delete** a breakpoint  \n```\n(lldb) breakpoint delete 1\n(lldb) br del 1\n```\n\nSet a breakpoint on a **file** and **line**  \n```\n(lldb) breakpoint set --file nilisp.c --line 666\n(lldb) breakpoint set -f nilisp.c -l 666\n```\n\nSet a breakpoint on a **function** named 'do_stuff'\n```\n(lldb) breakpoint set --name do_stuff\n(lldb) breakpoint set -n do_stuff\n```\n\nSet a breakpoint on a **set of functions**  \n```\n(lldb) set --name do_stuff --name do_more_stuff\n```\n\nSet a breakpoint on all **methods** named 'do_stuff'  \n```\n(lldb) set --method do_stuff\n(lldb) set -M do_stuff\n```\n\nAdd a **command** on a breakpoint  \n```\n(lldb) breakpoint command add 1.1\nEnter your debugger command(s). Type 'DONE' to end.\n\u003e bt // prints a backtrace when we hit a breakpoint\n\u003e DONE\n```\n\nCommands by default take \u003ca href=\"http://lldb.llvm.org/lldb-gdb.html\"\u003elldb command line commands\u003c/a\u003e  \nUse **--script** if you want to implement a command using Python instead  \n  \nTo add a **set of commands** to a breakpoint\n```\nbreakpoint command add \u003ccmd-options\u003e \u003cbreakpt-id\u003e\n```\n\n##Watchpoints\nTo see all the options for watchpoint setting  \n```\n(lldb) help watchpoint\n```\n\n**List** out watchpoints you've set  \n```\n(lldb) watchpoint list\n(lldb) watch l\n```\n\n**Delete** a watchpoint  \n```\n(lldb) watchpoint delete 1\n(lldb) watch del 1\n```\n\nSet a watchpoint on a **variable** when it is written to  \n```\n(lldb) watchpoint set variable my_variable\n(lldb) wa s v my_variable\n```\n\nSet a **condition** on a watchpoint  \n```\n(lldb) watchpoint modify -c '(my_variable==)'\n```\n\n##Control\nContinue\n```\n(lldb) process continue\n```\n\nProgram stepping  \n```\n(lldb) thread step-in    // The same as gdb's \"step\" or \"s\"\n(lldb) thread step-over  // The same as gdb's \"next\" or \"n\"\n(lldb) thread step-out   // The same as gdb's \"finish\" or \"f\n```\n\n##Frame State\n\nShow the **arguments and local variables** for the current frame  \n```\n(lldb) frame variable\n(lldb) fr v\n```\n\nShow **just local variables**  \n```\n(lldb) frame variable --no-args\n(lldb) fr v -a\n```\n\nShow the **contents of local variable** 'my_variable'  \n```\n(lldb) frame variable my_variable\n(lldb) fr v my_variable\n(lldb) p my_variable\n```\n\nShow the **contents of global variable** 'my_global_variable'  \n```\n(lldb) target variable my_global_variable\n(lldb) ta v my_global_variable\n```\n\n##Aliases\nGeneral syntax  \n```\ncommand alias \u003calias_name\u003e \u003cnoun\u003e \u003cverb\u003e [-options [option-value]] [symbolic-argument [argument...]]\n```\n\nExample  \n```\n(lldb) breakpoint set --file foo.c --line 12   // Let's shorten this\n(lldb) command alias bfl breakpoint set -f %1 -l %2\n(lldb) bfl foo.c 12\n```\n\nTo get rid of an alias  \n```\n(lldb) command unalias \u003calias_name\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoufoundron%2Flldb-basics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoufoundron%2Flldb-basics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoufoundron%2Flldb-basics/lists"}