Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff with master #1

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bb366d6
Update deps and fix gcov parsing (#1)
emilienlemaire Sep 8, 2023
351f4f6
Some improvements
ddeclerck Nov 23, 2023
33be1a0
Remove compilation from extenstion - should rely on preBuildTask
ddeclerck Dec 6, 2023
6300127
Merge pull request #3 from ddeclerck/improvements
ddeclerck Dec 7, 2023
49c057d
Minor adaptations for integration into SuperBOL
nberth Dec 19, 2023
e797ae5
Merge pull request #3 from nberth/adapt2superbol
nberth Dec 19, 2023
576a36a
Fix warning about a call to namespace object
nberth Dec 20, 2023
5c793fb
Merge pull request #4 from nberth/fix-import-readline
nberth Dec 20, 2023
a19b379
Change some fields to match the SuperBOL main extension
nberth Dec 20, 2023
8bce5ed
Merge branch 'master' into superbol-vscode-debug
ddeclerck Feb 21, 2024
dd2a466
Fix default config resolver
nberth Apr 8, 2024
a1576ed
Merge pull request #5 from nberth/fix-default-config-resolver
nberth Apr 8, 2024
ba251cf
Add support for several terminal emulator programs
marcsosduma Apr 9, 2024
b6180e1
Correction of BUG in subroutine parser
marcsosduma Apr 9, 2024
ac6e7d4
Fix some links in the README
nberth Apr 9, 2024
32ef083
Merge pull request #6 from nberth/rebasing-pr-2
nberth Apr 9, 2024
3e61d84
Auto-update coverage highlighting (#7)
emilienlemaire May 3, 2024
07ab8b4
Make the `preLaunchTask` optional in launch configuration
nberth Jul 26, 2024
d203ea1
Proper disposal of the debug adapter factory
nberth Jul 26, 2024
a2e56ef
Merge pull request #9 from nberth/optional-prelaunchtask
nberth Jul 26, 2024
2fec4e8
Disable handling of code coverage by default
nberth Jul 26, 2024
12fcf1e
Merge pull request #10 from nberth/coverage-not-by-default
nberth Jul 26, 2024
eb434cb
Rename debugger type to avoid conflicting with proper "gdb"
nberth Jul 26, 2024
03f7b23
Merge pull request #8 from nberth/rename-debugger-type
nberth Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 26 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,20 @@
<img src="https://github.com/OlegKunitsyn/gnucobol-debug/actions/workflows/nodejs.yml/badge.svg" />
</p>

An 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).
An extension to debug or execute GnuCOBOL code. Forked from [COBOL Degub](https://github.com/OlegKunitsyn/gnucobol-debug).

- [Features](#features)
- [Requirements](#requirements)
- [Binaries](#binaries)
- [Usage](#usage)
- [Code coverage](#code-coverage)
- [Attaching to a running process](#attaching-to-a-running-process)
- [Local Process](#local-process)
- [Remote Debugger (GDBServer)](#remote-debugger-gdbserver)
- [Display application output in a separate window](#display-application-output-in-a-separate-window)
- [Documentation](#documentation)
- [Troubleshooting](#troubleshooting)
- [Development](#development)

### Features
* Setting breakpoints
Expand All @@ -25,23 +38,15 @@ An extension to debug or execute GnuCOBOL code. Install from [VS Code Marketplac
* Watch pane with expressions
* Code coverage
* No mainframe required
* GnuCOBOL Docker

![Screenshot](screenshot.png)

### Requirements
A 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.
Otherwise, the breakpoints will be unavailable.
This extension is meant to work in combination with the [SuperBOL Studio](https://github.com/OCamlPro/superbol-vscode-platform) extension for COBOL.

Now you may choose between *local* and *container* execution environment. Or try both of them :)

#### Local
* GnuCOBOL `cobc` 2.2+ installed.
* GNU Debugger `gdb` 6.0+ installed.

#### Container
* [GnuCOBOL Docker](https://hub.docker.com/r/olegkunitsyn/gnucobol) container up and running.
The image includes GnuCOBOL, GNU Debugger and all required dependencies needed to debug or execute your code. See an example below.
#### Binaries
* GnuCOBOL `cobc` 3.1+ installed.
* GNU Debugger `gdb` 13.0+ installed.

### Usage
When 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:
Expand All @@ -65,7 +70,7 @@ Pick `COBOL debugger` from the dropdown on the Debug pane in VS Code. Press the
The 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.

### Code coverage
You can estimate an execution flow of your COBOL program.
You can estimate an execution flow of your COBOL program.

![Coverage](coverage.png)

Expand All @@ -87,36 +92,6 @@ Set `coverage` property to `true` in your `launch.json` and start debugging sess

The extension decodes the code-coverage files in `gcov` format generated by the compiler.

### Docker
You 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:
```bash
docker run -d -i --name gnucobol -w ${workspaceRoot} -v ${workspaceRoot}:${workspaceRoot} olegkunitsyn/gnucobol:3.1-dev
docker exec -i gnucobol cobc -V
docker exec -i gnucobol gdb -v
```

Add `docker` property to your `launch.json` and start debugging session.
Here's an example:
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "COBOL debugger",
"type": "gdb",
"request": "launch",
"cobcargs": ["-free", "-x"],
"docker": "olegkunitsyn/gnucobol:3.1-dev"
}
]
}
```

Stop the container by `Ctrl+Shift+P` and command `GnuCOBOL Docker: stop`, or in the terminal:
```bash
docker rm --force gnucobol
```

### Attaching to a running process
You may debug your COBOL program attaching to a running process. In order to achieve that, you have two options:

Expand Down Expand Up @@ -146,7 +121,8 @@ Here's an example:
```

#### Remote Debugger (GDBServer)
Add `remoteDebugger` property to your `launch.json`.
Add `remoteDebugger` property to your `launch.json`.

Here's an example:
```json
{
Expand All @@ -163,7 +139,7 @@ Here's an example:
}
```

### Displays application output in a separate window
### Display application output in a separate window
Add `gdbtty` property to your `launch.json`. Here’s an example:
```json
{
Expand All @@ -180,13 +156,6 @@ Add `gdbtty` property to your `launch.json`. Here’s an example:
```
![GdbTTY](gdbttydisplay.png)

* Linux Requirements: `xterm`

How to install xterm on Ubuntu:
```
sudo apt-get install xterm
```

On 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:
```json
{
Expand All @@ -203,11 +172,10 @@ On Linux you can see the output of the application in Vs Code itself. Add `gdbtt
```
![GdbTTY](gdbttyvscode.png)

### Roadmap
- Mac
- Unit testing
You can also use these options with `gdbtty`: `xterm`, `gnome-terminal`, `konsole` and `xfce4-terminal`.

Your contribution is always welcome!
### Documentation
For a more in depth documentation please check the [SuperBOL Documentation](https://get-superbol.com/studio/)

### Troubleshooting
Add `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:
Expand All @@ -229,7 +197,7 @@ Add `verbose` property to your `launch.json` and start debugging session. In `DE
### Development
* Fork the repository.
* Clone it to your machine and open with VS Code.
* Install dependencies by `npm install` command in the terminal.
* Install dependencies by `yarn install` command in the terminal.
* 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.
* Follow Requirements and Usage sections above.
* In the first VS Code instance you may put breakpoints to explore the functionality.
Expand Down
Loading