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

Error with docker on windows #114

Open
sam94dion opened this issue Nov 5, 2021 · 3 comments
Open

Error with docker on windows #114

sam94dion opened this issue Nov 5, 2021 · 3 comments

Comments

@sam94dion
Copy link

Hi,

There seems to be a problem when I try to run the debugger on WINDOWS.

First off this command does not seem to work on windows :

docker run -d -i --name gnucobol -w ${workspaceRoot} -v ${workspaceRoot}:${workspaceRoot} olegkunitsyn/gnucobol:3.1-dev

I get the same error as #89 so i tried his solution but it did not seem to work for me.

what I did :

Lunch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "COBOL debugger",
"type": "gdb",
"request": "launch",
"cobcargs": ["-free", "-x"],
"docker": "olegkunitsyn/gnucobol:3.1-dev",
"coverage": true,
"verbose": true
}
]
}

Lunched docker :

docker run -d -i --name gnucobol -w /app -v C:\workspace\cobol-check:/app olegkunitsyn/gnucobol:3.1-dev

then every time i tried to lunch debug it couldn't find the path because it used the cwd

Mi2 file
if (!nativePath.isAbsolute(target) || (this.cobcpath === "docker" && this.gdbpath === "docker")) {
target = nativePath.resolve(cwd, target);
}

so i changed it tofix this
if (!nativePath.isAbsolute(target) || (this.cobcpath === "docker" && this.gdbpath === "docker")) {
target = "/app/src/main/cobol/TST.CBL";
}

after this I get the following error

image

log :

loading standard configuration file 'default.conf'

command line: cobc -free -x -g -fsource-location -ftraceall -Q --coverage -A --coverage -v /app/src/main/cobol/TST.CBL

preprocessing: /app/src/main/cobol/TST.CBL -> TST.i

return status: 0

parsing: TST.i (/app/src/main/cobol/TST.CBL)

return status: 0
translating: TST.i -> TST.c (/app/src/main/cobol/TST.CBL)

executing: gcc -c -pipe -I/usr/local/include -Wno-unused -fsigned-char
-Wno-pointer-sign -ggdb3 -fasynchronous-unwind-tables
--coverage -o "/tmp/cob8_0.o" "TST.c"

return status: 0
executing: gcc -Wl,--export-dynamic -o "TST" "/tmp/cob8_0.o" --coverage
-L/usr/local/lib -lcob -lm

return status: 0

COBOL file /app/src/main/cobol/TST.CBL compiled with exit code: 0
SourceMap created: lines 4, vars 3
/app/src/main/cobol/TST.CBL:11 > C:\workspace\cobol-check\TST.c:112
/app/src/main/cobol/TST.CBL:12 > C:\workspace\cobol-check\TST.c:119
/app/src/main/cobol/TST.CBL:13 > C:\workspace\cobol-check\TST.c:126
/app/src/main/cobol/TST.CBL:14 > C:\workspace\cobol-check\TST.c:133
obtaininput_.b_2[null] > RETURN-CODE
obtaininput_.b_8[null] > NAME
obtaininput_.f_8[a_2] > NAME
obtaininput_.RETURN-CODE[null] > b_2
obtaininput_.NAME[null] > b_8
obtaininput_.NAME.NAME[a_2] > f_8

Thank you :)

@Trisk3lion
Copy link

I'm having the same problem.

And when I hardcode the path with Cobol_Debugger: Cwd I get "Failed to load MI Debugger: Error: cwd does not exist"

@OlegKunitsyn
Copy link
Owner

I can't help you on Windows, but noticed that you were launching Docker containers manually providing different workspaceRoot arguments. Please try to rely on VS Code instead - https://github.com/OlegKunitsyn/gnucobol-debug#docker:
You may debug or execute your COBOL program inside GnuCOBOL Docker container. Start the container and share your working directory by Ctrl+Shift+P and command GnuCOBOL Docker: start

@samdion1994
Copy link

@OlegKunitsyn, Good news got it to work but now I may have other problems. Looks like there maybe an offset with the debugger.

image

I'm using Arnold tremblay's 3.1.2 package is this related to #97 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants