Thanks, Bill. This works. Well, fairly well. When it's in the actual Go runtime source code a "step into" doesn't always end up where it should. Sometimes it does, but sometimes it's showing just some "random" line of the particular .go file.
One other quirk. The source code shows fine when the CCSID is ISO-8859-1. However, when it's UTF-8 it seems to "lose" the line terminators. This is unfortunate because it looks like Git on z/OS defaults to UTF-8, so you have to chtag all of the files to change it to ISO-8859-1.
Thanks.
------------------------------
Frank Swarbrick
------------------------------
Original Message:
Sent: Wed May 22, 2024 01:51 PM
From: Bill O'Farrell
Subject: debugging Go on z/OS
in package directory xx type "go test -c"
this creates xx.test executable
then to run your test yy in the xx package you type
xx.test -test.run yy
so to debug this test you use the debugger as normal but for the application you use "xx.test" and give the arguments "-test.run yy"
------------------------------
Bill O'Farrell
Senior Technical Manger, Go on z/OS
Original Message:
Sent: Tue May 21, 2024 11:02 PM
From: Frank Swarbrick
Subject: debugging Go on z/OS
I'm talking specifically about the "go test" command. If I just build/install an application program I can get it working with z/OS Debugger. But not if I use "go test" to run the test suite.
------------------------------
Frank Swarbrick
Original Message:
Sent: Tue May 21, 2024 10:11 PM
From: Bill O'Farrell
Subject: debugging Go on z/OS
I'm not an expert on the debugger. I know it's possible to get it to work with Go, as I've used it. I'm asking around about setup.
------------------------------
Bill O'Farrell
Senior Technical Manger, Go on z/OS
Original Message:
Sent: Tue May 21, 2024 05:08 PM
From: Frank Swarbrick
Subject: debugging Go on z/OS
Is there a way to debug a go test using z/OS Debugger?
I have this script (name 'debug'):
TESTOPTS="TEST(,,,TCPIP&myipaddr%8001:*)"GOMAXPROCS=1 _CEE_RUNOPTS="$_CEE_RUNOPTS $TESTOPTS" "$@"
The I try "debug go test" and get "/u/dvfjs/bin/debug: line 2: 84017274 SIGKILL GOMAXPROCS=1 _CEE_RUNOPTS="$_CEE_RUNOPTS $TESTOPTS" "$@""
On the debugger side it seems to connect and immediately disconnect.
------------------------------
Frank Swarbrick
------------------------------