Go

Go on z/OS

Go on z/OS

This group is a space for open discussions and sharing technical information, and also provides a connection to the wider Go open source community for anyone who is interested in Go on z/OS

 View Only
  • 1.  debugging Go on z/OS

    Posted Tue May 21, 2024 05:08 PM

    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
    ------------------------------


  • 2.  RE: debugging Go on z/OS

    Posted Tue May 21, 2024 10:12 PM

    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
    ------------------------------



  • 3.  RE: debugging Go on z/OS

    Posted Tue May 21, 2024 11:02 PM

    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
    ------------------------------



  • 4.  RE: debugging Go on z/OS

    Posted Wed May 22, 2024 01:52 PM

    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
    ------------------------------



  • 5.  RE: debugging Go on z/OS

    Posted Wed May 22, 2024 11:03 PM

    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
    ------------------------------