{"id":17767088,"url":"https://github.com/kastiglione/lldb-helpers","last_synced_at":"2025-09-18T18:31:58.976Z","repository":{"id":141644482,"uuid":"136868830","full_name":"kastiglione/lldb-helpers","owner":"kastiglione","description":"Collection of helpers for more precise breakpoints","archived":false,"fork":false,"pushed_at":"2019-06-06T17:05:41.000Z","size":17,"stargazers_count":58,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-28T03:12:05.314Z","etag":null,"topics":["lldb"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kastiglione.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-11T03:15:59.000Z","updated_at":"2024-08-20T03:52:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"b59dfb98-db92-4dae-9218-f6bbf0b9136f","html_url":"https://github.com/kastiglione/lldb-helpers","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/kastiglione%2Flldb-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kastiglione%2Flldb-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kastiglione%2Flldb-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kastiglione%2Flldb-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kastiglione","download_url":"https://codeload.github.com/kastiglione/lldb-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233466582,"owners_count":18680564,"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":["lldb"],"created_at":"2024-10-26T20:42:37.000Z","updated_at":"2025-09-18T18:31:53.698Z","avatar_url":"https://github.com/kastiglione.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lldb-helpers\n\nA collection of functions that control when a breakpoint stops. These are especially useful for frequently called functions. The functions are also useful to catch programming mistakes, such as functions being called from the wrong thread.\n\nInspired by [GDB's convience functions](https://sourceware.org/gdb/current/onlinedocs/gdb/Convenience-Funs.html).\n\n## Breakpoint Criteria\n\nThese helper functions place various criteria on a breakpoint. A simple example is to make a breakpoint stop only when called by a certain function.\n\nThe types of criteria are:\n\n1. [Caller](#caller)\n2. [Stack](#stack)\n3. [Threads](#threads)\n\n### Caller\n\nThe `caller_is` and `caller_contains` helpers are used to make a breakpoint stop only when called by a specific function. Or, to stop when the caller is _not_ a specific function. Use `caller_is` for an exact caller name, and use `caller_contains` to stop based on substring. Prefix the function with `not` to stop when the caller _does not_ match the name.\n\nExamples:\n\n```\n(lldb) breakpoint command add -F 'caller_is(\"someFunction\")'\n(lldb) breakpoint command add -F 'not caller_is(\"someFunction\")'\n(lldb) breakpoint command add -F 'caller_is(\"-[SomeClass theMethod:]\")'\n(lldb) breakpoint command add -F 'caller_contains(\"SomeClass\")'\n(lldb) breakpoint command add -F 'caller_matches(\"OneClass|someFunction\")'\n(lldb) breakpoint command add -F 'not caller_matches(\"OneClass|someFunction\")'\n```\n\nIn some cases, you'll want a breakpoint to stop based on the library (module) of the caller. The `caller_from` helper does just this.\n\nExamples:\n\n```\n(lldb) breakpoint command add -F 'caller_from(\"UIKit\")'\n(lldb) breakpoint command add -F 'not caller_from(\"MyAppName\")'\n```\n\n### Stack\n\nThe `any_caller_is` and `any_caller_contains` helper functions are just like `caller_is` and `caller_contains`, except they stop if any function in the call stack matches. Use `any_caller_is` to require an exact match with one of the functions in the call stack, and use `any_caller_contains` to stop based on substring. Prefix the function with `not` to stop when the call stack _does not_ contain a matching function.\n\nExamples:\n\n```\n(lldb) breakpoint command add -F 'any_caller_is(\"someFunction\")'\n(lldb) breakpoint command add -F 'not any_caller_is(\"someFunction\")'\n(lldb) breakpoint command add -F 'any_caller_is(\"-[SomeClass theMethod:]\")'\n(lldb) breakpoint command add -F 'any_caller_contains(\"SomeClass\")'\n(lldb) breakpoint command add -F 'any_caller_matches(\"OneClass|someFunction\")'\n(lldb) breakpoint command add -F 'not any_caller_matches(\"OneClass|someFunction\")'\n```\n\nWhen you want a breakpoint to stop when library (module) is or is not in the call stack, use `any_caller_from`.\n\nExamples:\n\n```\n(lldb) breakpoint command add -F 'any_caller_from(\"UIKit\")'\n(lldb) breakpoint command add -F 'not any_caller_from(\"UIKit\")'\n```\n\n### Threads\n\nThe `called_on` helper function is used to stop only when a breakpoint is hit from a specific thread or queue. LLDB breakpoints have the ability to specify a specifc thread (`--thread-index`) or queue (`--queue-name`), but there is no way to specify that a breakpoint *not* stop for a specific thread or queue. The `called_on` helper can do this, and takes either a thread index, for example `1` for the main thread, or takes a thread name or queue name.\n\nExamples:\n\n```\n(lldb) breakpoint command add -F 'not called_on(1)'\n(lldb) breakpoint command add -F 'called_on(\"com.banana.eventfetch-thread\")'\n```\n\n## Installation\n\n1. Clone this repository to your prefrerred location\n2. Add this `import` command to your `~/.lldbinit`:\n\n```\ncommand script import ~/path/to/lldb-helpers/criteria.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkastiglione%2Flldb-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkastiglione%2Flldb-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkastiglione%2Flldb-helpers/lists"}