{"id":24575107,"url":"https://github.com/olegkunitsyn/gnucobol-debug","last_synced_at":"2025-04-23T15:21:54.852Z","repository":{"id":42208581,"uuid":"257069900","full_name":"OlegKunitsyn/gnucobol-debug","owner":"OlegKunitsyn","description":"GnuCOBOL debugger","archived":false,"fork":false,"pushed_at":"2024-07-18T12:46:48.000Z","size":1911,"stargazers_count":22,"open_issues_count":35,"forks_count":10,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T00:51:13.483Z","etag":null,"topics":["cobol","debugger","visual-studio-code"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OlegKunitsyn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-04-19T18:12:12.000Z","updated_at":"2024-09-10T14:57:06.000Z","dependencies_parsed_at":"2023-01-31T15:30:57.968Z","dependency_job_id":"fe32d92e-d9e4-4208-95c0-a6212cb35eff","html_url":"https://github.com/OlegKunitsyn/gnucobol-debug","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlegKunitsyn%2Fgnucobol-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlegKunitsyn%2Fgnucobol-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlegKunitsyn%2Fgnucobol-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlegKunitsyn%2Fgnucobol-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OlegKunitsyn","download_url":"https://codeload.github.com/OlegKunitsyn/gnucobol-debug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250457813,"owners_count":21433740,"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":["cobol","debugger","visual-studio-code"],"created_at":"2025-01-23T21:54:50.234Z","updated_at":"2025-04-23T15:21:54.835Z","avatar_url":"https://github.com/OlegKunitsyn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n    \u003cimg src=\"https://github.com/OlegKunitsyn/gnucobol-debug/blob/master/icon.png?raw=true\" alt=\"Logo GnuCOBOL debug\" width=\"200\"\u003e\n  \u003cbr\u003e\n  Debugger for \u003ca href=\"https://www.gnu.org/software/gnucobol\"\u003eGnuCOBOL\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eDebug COBOL code from VS Code or VSCodium.\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/v/tag/OlegKunitsyn/gnucobol-debug\" /\u003e\n  \u003cimg src=\"https://img.shields.io/visual-studio-marketplace/d/OlegKunitsyn.gnucobol-debug\" /\u003e\n  \u003cimg src=\"https://img.shields.io/visual-studio-marketplace/i/OlegKunitsyn.gnucobol-debug\" /\u003e\n  \u003cimg src=\"https://github.com/OlegKunitsyn/gnucobol-debug/actions/workflows/nodejs.yml/badge.svg\" /\u003e\n\u003c/p\u003e\n\nAn extension to debug or execute GnuCOBOL code. Install from [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=OlegKunitsyn.gnucobol-debug) or [Open VSX-Registry](https://open-vsx.org/extension/OlegKunitsyn/gnucobol-debug).\n\n### Features\n* Setting breakpoints\n* Continue, Stop, Restart, Step Over, Step Into, Step Out\n* Variables pane, including Copy Value, Copy as Expression and Add to Watch\n* Watch pane with expressions\n* Code coverage\n* No mainframe required\n* GnuCOBOL Docker\n\n![Screenshot](screenshot.png)\n\n### Requirements\nA COBOL-syntax extension i.e. `bitlang.gnucobol` (recommended, note: the previously recommended `bitlang.cobol` was split and now is intended to target MicroFocus products only), or - if you target a mainframe dialect: `broadcommfd.cobol-language-support`, `rechinformatica.rech-editor-cobol` or `ibm.zopeneditor` installed.  \nOtherwise, the breakpoints will be unavailable. \n\nNow you may choose between *local* and *container* execution environment. Or try both of them :)\n\n#### Local\n* GnuCOBOL `cobc` 2.2+ installed.\n* GNU Debugger `gdb` 6.0+ installed.\n\n#### Container\n* [GnuCOBOL Docker](https://hub.docker.com/r/olegkunitsyn/gnucobol) container up and running. \nThe image includes GnuCOBOL,  GNU Debugger and all required dependencies needed to debug or execute your code. See an example below.\n\n### Usage\nWhen your `launch.json` config is set up, you can debug or execute your COBOL program. If you debug a Compilation Group (main- and sub- programs), you need to list sub-programs inside `group` property. Here's an example:\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"COBOL debugger\",\n            \"type\": \"gdb\",\n            \"request\": \"launch\",\n            \"cobcargs\": [\"-free\", \"-x\"],\n            \"group\": [\"subsample.cbl\", \"subsubsample.cbl\"]\n        }\n    ]\n}\n```\n\nPick `COBOL debugger` from the dropdown on the Debug pane in VS Code. Press the Play button or `F5` to debug or `Ctrl+F5` to execute.\n\nThe debugger uses C sourcecode generated by the compiler upon each debugging session. If the sourcemap isn't accurate or you see any other issues, please make a bug-report.\n\n### Code coverage\nYou can estimate an execution flow of your COBOL program. \n\n![Coverage](coverage.png)\n\nSet `coverage` property to `true` in your `launch.json` and start debugging session. Here's an example:\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"COBOL debugger\",\n            \"type\": \"gdb\",\n            \"request\": \"launch\",\n            \"cobcargs\": [\"-free\", \"-x\"],\n            \"coverage\": true\n        }\n    ]\n}\n```\n\nThe extension decodes the code-coverage files in `gcov` format generated by the compiler.\n\n### Docker\nYou may debug or execute your COBOL program inside [GnuCOBOL Docker](https://hub.docker.com/r/olegkunitsyn/gnucobol) container. Start the container and share your working directory by `Ctrl+Shift+P` and command `GnuCOBOL Docker: start`, or in the terminal:\n```bash\ndocker run -d -i --name gnucobol -w ${workspaceRoot} -v ${workspaceRoot}:${workspaceRoot} olegkunitsyn/gnucobol:3.1-dev\ndocker exec -i gnucobol cobc -V\ndocker exec -i gnucobol gdb -v\n```\n\nAdd `docker` property to your `launch.json` and start debugging session.\nHere's an example:\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"COBOL debugger\",\n            \"type\": \"gdb\",\n            \"request\": \"launch\",\n            \"cobcargs\": [\"-free\", \"-x\"],\n            \"docker\": \"olegkunitsyn/gnucobol:3.1-dev\"\n        }\n    ]\n}\n```\n\nStop the container by `Ctrl+Shift+P` and command `GnuCOBOL Docker: stop`, or in the terminal:\n```bash\ndocker rm --force gnucobol\n```\n\n### Attaching to a running process\nYou may debug your COBOL program attaching to a running process. In order to achieve that, you have two options:\n\n#### Local Process\nAdd `pid` property to your `launch.json` and start debugging session (you can use a input variable to help like the sample below). \nHere's an example:\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"COBOL debugger attach\",\n            \"type\": \"gdb\",\n            \"request\": \"attach\",\n            \"cobcargs\": [\"-free\", \"-x\"],\n            \"pid\": \"${input:pid}\"\n        }\n    ],\n    \"inputs\": [\n        {\n            \"id\": \"pid\",\n            \"type\": \"promptString\",\n            \"description\": \"PID to attach\"\n        }\n    ]\n}\n```\n\n#### Remote Debugger (GDBServer)\nAdd `remoteDebugger` property to your `launch.json`. \nHere's an example:\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"COBOL debugger attach\",\n            \"type\": \"gdb\",\n            \"request\": \"attach\",\n            \"cobcargs\": [\"-free\", \"-x\"],\n            \"remoteDebugger\": \"localhost:5555\"\n        }\n    ]\n}\n```\n\n### Displays application output in a separate window\nAdd `gdbtty` property to your `launch.json`. Here’s an example:\n```json\n{\n            \"name\": \"COBOL debugger\",\n            \"type\": \"gdb\",\n            \"request\": \"launch\",\n            \"cobcargs\": [\n                \"-free\",\n                \"-x\"\n            ],\n            \"coverage\": false,\n            \"gdbtty\": true\n}\n```\n![GdbTTY](gdbttydisplay.png)\n\n* Linux Requirements: `xterm`\n\nHow to install xterm on Ubuntu: \n```\nsudo apt-get install xterm\n```\n\nOn Linux you can see the output of the application in Vs Code itself. Add `gdbtty` property with `vscode` value to your `launch.json`. Here is an example:\n```json\n{\n            \"name\": \"COBOL debugger\",\n            \"type\": \"gdb\",\n            \"request\": \"launch\",\n            \"cobcargs\": [\n                \"-free\",\n                \"-x\"\n            ],\n            \"coverage\": false,\n            \"gdbtty\": \"vscode\"\n}\n```\n![GdbTTY](gdbttyvscode.png)\n\n### Roadmap\n- Mac\n- Unit testing\n\nYour contribution is always welcome!\n\n### Troubleshooting\nAdd `verbose` property to your `launch.json` and start debugging session. In `DEBUG CONSOLE` you will see complete communication log between `gdb` and VS Code. Here's an example:\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"COBOL debugger\",\n            \"type\": \"gdb\",\n            \"request\": \"launch\",\n            \"cobcargs\": [\"-free\", \"-x\"],\n            \"verbose\": true\n        }\n    ]\n}\n```\n\n### Development\n* Fork the repository.\n* Clone it to your machine and open with VS Code.\n* Install dependencies by `npm install` command in the terminal.\n* Pick `Extension` from the dropdown on the Debug pane and press `F5`. This will open new VS Code instance with your cloned extension in debugging mode.\n* Follow Requirements and Usage sections above.\n* In the first VS Code instance you may put breakpoints to explore the functionality.\n* Stop the second VS Code instance and implement your idea in TypeScript.\n* Pick `Tests` from the dropdown on the Debug pane and press `F5`. Keep them green.\n* Push your changes and create Pull Request to the original repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegkunitsyn%2Fgnucobol-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folegkunitsyn%2Fgnucobol-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegkunitsyn%2Fgnucobol-debug/lists"}