{"id":13412561,"url":"https://github.com/sakhnik/nvim-gdb","last_synced_at":"2025-03-14T18:31:46.270Z","repository":{"id":24803397,"uuid":"100527092","full_name":"sakhnik/nvim-gdb","owner":"sakhnik","description":"Neovim thin wrapper for GDB, LLDB, PDB/PDB++ and BashDB","archived":false,"fork":false,"pushed_at":"2024-08-12T06:48:11.000Z","size":1296,"stargazers_count":702,"open_issues_count":6,"forks_count":34,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-12T20:17:07.863Z","etag":null,"topics":["bashdb","gdb","lldb","neovim","nvim-gdb","pdb"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/sakhnik.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":"2017-08-16T19:53:45.000Z","updated_at":"2024-08-12T06:46:33.000Z","dependencies_parsed_at":"2024-04-23T09:21:34.338Z","dependency_job_id":"bb8a21ae-0b40-4f0d-967b-0e60f21f9552","html_url":"https://github.com/sakhnik/nvim-gdb","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/sakhnik%2Fnvim-gdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakhnik%2Fnvim-gdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakhnik%2Fnvim-gdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakhnik%2Fnvim-gdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sakhnik","download_url":"https://codeload.github.com/sakhnik/nvim-gdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221495304,"owners_count":16832455,"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":["bashdb","gdb","lldb","neovim","nvim-gdb","pdb"],"created_at":"2024-07-30T20:01:26.141Z","updated_at":"2024-10-26T04:30:47.269Z","avatar_url":"https://github.com/sakhnik.png","language":"Lua","funding_links":[],"categories":["Debugging","Lua","\u003ca id=\"975d9f08e2771fccc112d9670eae1ed1\"\u003e\u003c/a\u003eGDB"],"sub_categories":["Cursorline","\u003ca id=\"5f4381b0a90d88dd2296c2936f7e7f70\"\u003e\u003c/a\u003e工具","CSV Files"],"readme":" \n[![Test](https://github.com/sakhnik/nvim-gdb/workflows/Test/badge.svg?branch=master)](https://github.com/sakhnik/nvim-gdb/actions?query=workflow%3ATest+branch%3Amaster)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f2a7dc2640f84b2a8983ac6da004c7ac)](https://www.codacy.com/app/sakhnik/nvim-gdb?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=sakhnik/nvim-gdb\u0026amp;utm_campaign=Badge_Grade)\n\n# GDB for neovim\n\n[Gdb](https://www.gnu.org/software/gdb/), [LLDB](https://lldb.llvm.org/),\n[pdb](https://docs.python.org/3/library/pdb.html)/[pdb++](https://github.com/pdbpp/pdbpp)\nand [BASHDB](http://bashdb.sourceforge.net/) integration with NeoVim.\n\n## Table of contents\n\n  * [Overview](#overview)\n  * [Installation](#installation)\n  * [Options](#options)\n  * [Usage](#usage)\n  * [Development](#development)\n\n## Overview\n\nTaken from the neovim: [neovim\\_gdb.vim](https://github.com/neovim/neovim/blob/master/contrib/gdb/neovim_gdb.vim)\n\nIt is instantly usable: type `\u003cleader\u003edd`, edit GDB launching command, hit `\u003ccr\u003e`.\nOr type `\u003cleader\u003edl` to do the same with LLDB backend.\nOr type `\u003cleader\u003edp` to start debugging a python program.\nOr type `\u003cleader\u003edb` to start debugging a BASH script.\n\nAlso you can record the execution of a program with [`rr record`](https://rr-project.org/), and then replay its execution systematically with `\u003cleader\u003edr`.\n\nSupported debuggers and operating systems:\n\n|  Debugger    |  Linux | Darwin | Windows |\n|--------------|--------|--------|---------|\n| GNU gdb      |  `✅`  |  `❌`  |  `✅`   |\n| lldb         |  `✅`  |  `✅`  |  `✅`   |\n| pdb          |  `✅`  |  `✅`  |  `✅`   |\n| BashDB       |  `✅`  |  `✅`  |  `❌`   |\n| rr           |  `✅`  |  `❌`  |  `❌`   |\n\n[![nvim-gdb](https://asciinema.org/a/E8sKlS53Dm6UzK2MJjEolOyam.png)](https://asciinema.org/a/E8sKlS53Dm6UzK2MJjEolOyam?autoplay=1)\n\n## Installation\n\nCheck the prerequisites in the script [test/prerequisites.py](https://github.com/sakhnik/nvim-gdb/blob/master/test/prerequisites.py).\n\nUse the branch `master` for NeoVim ≥ 0.7 or the branch `devel` to benefit from the latest NeoVim features.\n\nIf you use vim-plug, add the following line to your vimrc file:\n\n```vim\nPlug 'sakhnik/nvim-gdb'\n```\n\n## Options\n\nTo disable the plugin\n```vim\nlet g:loaded_nvimgdb = 1\n```\n\n`:GdbStart` and `:GdbStartLLDB` use `find` and the cmake file API to try to\ntab-complete the command with the executable for the current file. To disable\nthis set `g:nvimgdb_use_find_executables` or `g:nvimgdb_use_cmake_to_find_executables` to `0`.\n\nThe behaviour of the plugin can be tuned by defining specific variables.\nFor instance, you could overload some command keymaps:\n```vim\n\" We're going to define single-letter keymaps, so don't try to define them\n\" in the terminal window.  The debugger CLI should continue accepting text commands.\nfunction! NvimGdbNoTKeymaps()\n  tnoremap \u003csilent\u003e \u003cbuffer\u003e \u003cesc\u003e \u003cc-\\\u003e\u003cc-n\u003e\nendfunction\n\nlet g:nvimgdb_config_override = {\n  \\ 'key_next': 'n',\n  \\ 'key_step': 's',\n  \\ 'key_finish': 'f',\n  \\ 'key_continue': 'c',\n  \\ 'key_until': 'u',\n  \\ 'key_breakpoint': 'b',\n  \\ 'set_tkeymaps': \"NvimGdbNoTKeymaps\",\n  \\ }\n```\n\nLikewise, you could define your own hooks to be called when the source window\nis entered and left. Please refer to the online NeoVim help: `:help nvimgdb`.\n\n## Usage\n\nSee `:help nvimgdb` for the complete online documentation. Most notable commands:\n\n| Mapping          | Command                              | Description                                                          |\n|------------------|--------------------------------------|----------------------------------------------------------------------|\n| \u0026lt;Leader\u0026gt;dd | `:GdbStart gdb -q ./a.out`           | Start debugging session, allows editing the launching command        |\n| \u0026lt;Leader\u0026gt;dl | `:GdbStartLLDB lldb ./a.out`         | Start debugging session, allows editing the launching command        |\n| \u0026lt;Leader\u0026gt;dp | `:GdbStartPDB python -m pdb main.py` | Start Python debugging session, allows editing the launching command |\n| \u0026lt;Leader\u0026gt;db | `:GdbStartBashDB bashdb main.sh`     | Start BASH debugging session, allows editing the launching command   |\n| \u0026lt;Leader\u0026gt;dr | `:GdbStartRR`                        | Start debugging session with [`rr replay`](https://rr-project.org/). |\n| \u0026lt;F8\u0026gt;       | `:GdbBreakpointToggle`               | Toggle breakpoint in the coursor line                                |\n| \u0026lt;F4\u0026gt;       | `:GdbUntil`                          | Continue execution until a given line (`until` in gdb)               |\n| \u0026lt;F5\u0026gt;       | `:GdbContinue`                       | Continue execution (`continue` in gdb)                               |\n| \u0026lt;F10\u0026gt;      | `:GdbNext`                           | Step over the next statement (`next` in gdb)                         |\n| \u0026lt;F11\u0026gt;      | `:GdbStep`                           | Step into the next statement (`step` in gdb)                         |\n| \u0026lt;F12\u0026gt;      | `:GdbFinish`                         | Step out the current frame (`finish` in gdb)                         |\n| \u0026lt;c-p\u0026gt;      | `:GdbFrameUp`                        | Navigate one frame up (`up` in gdb)                                  |\n| \u0026lt;c-n\u0026gt;      | `:GdbFrameDown`                      | Navigate one frame down (`down` in gdb)                              |\n\nYou can create a watch window evaluating a backend command on every step.\nTry `:GdbCreateWatch info locals` in GDB, for istance.\n\nYou can open the list of breakpoints or backtrace locations into the location list.\nTry `:GdbLopenBacktrace` or `:GdbLopenBreakpoints`.\n\n## Development\n\nThe goal is to have a thin wrapper around\nGDB, LLDB, pdb/pdb++ and BASHDB, just like the official\n[TUI](https://sourceware.org/gdb/onlinedocs/gdb/TUI.html). NeoVim will enhance\ndebugging with syntax highlighting and source code navigation.\n\nThe project uses GitHub actions to run the test suite on every commit automatically.\nThe plugin, proxy and screen logs can be downloaded as the artifacts to be analyzed\nlocally.\n\nTo ease reproduction of an issue, set the environment variable `CI`, and\nlaunch NeoVim with the auxiliary script `test/nvim.py`. The screen cast will\nbe written to the log file `spy_ui.log`. Alternatively, consider recording\nthe terminal script with the ubiquitous command `script`.\n\nTo support development, consider donating:\n\n  * ₿ [1E5Sny3tC5qdr1owAQqbzfyq1SFjaNBQW4](https://bitref.com/1E5Sny3tC5qdr1owAQqbzfyq1SFjaNBQW4)\n\n## References\n\n  * Porting to Moonscript: [2018-11-17](https://sakhnik.com/2018/11/17/nvimgdb-lua.html)\n  * Overview to the first anniversary: [2018-08-10](https://sakhnik.com/2018/08/10/nvim-gdb-anni.html)\n\n## Showcase\n\n[![GdbStartRR](https://asciinema.org/a/506942.svg)](https://asciinema.org/a/506942)\n\n[![nvim-gdb + llvm](https://asciinema.org/a/162697.png)](https://asciinema.org/a/162697)\n\n[![clone + test](https://asciinema.org/a/397047.svg)](https://asciinema.org/a/397047)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakhnik%2Fnvim-gdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsakhnik%2Fnvim-gdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakhnik%2Fnvim-gdb/lists"}