Skip to content

Commit

Permalink
Merging differences between branches (#49)
Browse files Browse the repository at this point in the history
* #3 - Adding support to attach to a running process

* #3 - Removing leftover from README.

* #3 - Fixing attach to a running process

* #3 - Adding Experimental info on README

* Rollback of a wrong change.

* #44 - Removing leading zeroes from variable values
  • Loading branch information
brunopacheco1 authored Jun 17, 2020
1 parent aab7c41 commit fdded0d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,43 @@ Stop the container by `Ctrl+Shift+P` and command `GnuCOBOL Docker: stop`, or in
docker rm --force gnucobol
```

### Attaching to a running process - EXPERIMENTAL
You may debug your COBOL program attaching to a running process.

This is an experimental feature, it doesn't display the variable values yet. For more details, please refer to [attach to a running process #3](https://github.com/OlegKunitsyn/gnucobol-debug/issues/3).

Add `pid` property to your `launch.json` and start debugging session (you can use a input variable to help like the sample below).

Here's an example:
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "COBOL debugger (Attach)",
"type": "gdb",
"request": "attach",
"target": "${file}",
"targetargs": [],
"cwd": "${workspaceRoot}",
"gdbpath": "gdb",
"cobcpath": "cobc",
"cobcargs": ["-x", "-C"],
"group": [],
"coverage": false,
"pid": "${input:pid}"
}
],
"inputs": [
{
"id": "pid",
"type": "promptString",
"description": "PID to attach"
}
]
}
```

### Roadmap
- Mac
- Unit testing
Expand Down
7 changes: 6 additions & 1 deletion src/mi2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,12 @@ export class MI2 extends EventEmitter implements IDebugger {
} else {
if (this.verbose)
this.log("stderr", "Not implemented stop reason (assuming exception): " + reason);
this.emit("stopped", parsed);

if (!this.map.hasLineCobol(parsed.record('frame.fullname'), parseInt(parsed.record('frame.line')))) {
this.continue();
} else {
this.emit("stopped", parsed);
}
}
} else {
if (this.verbose)
Expand Down

0 comments on commit fdded0d

Please sign in to comment.