Author Topic: Which debugger to use.  (Read 1460 times)

Jochen Schäfer

  • Jr. Member
  • **
  • Thank You
  • -Given: 18
  • -Receive: 7
  • Posts: 99
    • View Profile
Which debugger to use.
« on: August 12, 2019, 03:05:32 pm »
I want to check, if things are still working as they should in DosBOX/2.
I tried Watcom, but GUI one instantly crashes, when I run DosBOX. The VIO one does not do that, but I can't find an option to select sources.
When I started the port about 15 years ago, I used one of the IBM debuggers in the VAC 4 package, but I just have not been able to set it up correctly at the moment, so I have to really should take a deep dive into them.

So my questions is: Which debugger are you using for GCC compiled and Watcom linked, rpm only applications?
Any configuration recommendations?

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2148
    • View Profile
Re: Which debugger to use.
« Reply #1 on: August 12, 2019, 09:36:00 pm »
Any of the IBM debuggers should sorta work, the OW ones won't. There are issues, IIRC the stack is slightly different then the native debuggers expect though generally they do seem to largely work.
For free and simple (textmode so you can run in full screen session to debug PM app) there is http://hobbes.nmsu.edu/download/pub/os2/dev/util/sd386v50.zip. Better is if you can install VAC. such as 3.08 (winworld has a copy) or find a copy of jitdbg.

Jochen Schäfer

  • Jr. Member
  • **
  • Thank You
  • -Given: 18
  • -Receive: 7
  • Posts: 99
    • View Profile
Re: Which debugger to use.
« Reply #2 on: August 13, 2019, 08:06:57 am »
Thanks. I will try that.

Rick C. Hodgin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 32
    • View Profile
Re: Which debugger to use.
« Reply #3 on: November 02, 2019, 02:20:32 am »
Any of the IBM debuggers should sorta work, the OW ones won't. There are issues, IIRC the stack is slightly different then the native debuggers expect though generally they do seem to largely work.
For free and simple (textmode so you can run in full screen session to debug PM app) there is http://hobbes.nmsu.edu/download/pub/os2/dev/util/sd386v50.zip. Better is if you can install VAC. such as 3.08 (winworld has a copy) or find a copy of jitdbg.

sd386 looks nice.  Are there any tutorials on its various features?  It has source code.  Has it been ported to any other OSes, so the OS/2 guest being debugged can be debugged from a Win32 or DOS or Linux host?

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2148
    • View Profile
Re: Which debugger to use.
« Reply #4 on: November 02, 2019, 02:41:13 am »
sd386 looks nice.  Are there any tutorials on its various features?  It has source code.  Has it been ported to any other OSes, so the OS/2 guest being debugged can be debugged from a Win32 or DOS or Linux host?

Not that I know off and considering it was replaced by graphical debuggers that likely ran on Windows, AIX and perhaps other systems, probably not, especially as the readme infers the remote debugging support was added just before being discontinued.
Note that to use any of the IBM debuggers with GCC, programs need to be linked with -Zomf as well as built with -g

Rick C. Hodgin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 32
    • View Profile
Re: Which debugger to use.
« Reply #5 on: November 02, 2019, 02:47:00 am »
Any of the IBM debuggers should sorta work, the OW ones won't. There are issues, IIRC the stack is slightly different then the native debuggers expect though generally they do seem to largely work.

OW has remote TCP/IP-based debugging that the documentation states works across platforms like OS/2 to Win32.

Has anyone used it to know what works and what doesn't?

I'd like to get a cross-compiler to be able to code/test in a Win32 environment compiling for OS/2 binaries, copy to OS/2, and run there with remote debugging.

Rick C. Hodgin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 32
    • View Profile
Re: Which debugger to use.
« Reply #6 on: November 02, 2019, 02:52:45 am »
sd386 looks nice.  Are there any tutorials on its various features?  It has source code.  Has it been ported to any other OSes, so the OS/2 guest being debugged can be debugged from a Win32 or DOS or Linux host?

Not that I know off and considering it was replaced by graphical debuggers that likely ran on Windows, AIX and perhaps other systems, probably not, especially as the readme infers the remote debugging support was added just before being discontinued.

With source code available, a stub could probably be created, and the actual debugger app could be ported to another OS.

I never used to admire remote debugging, but I've had quite a bit of occasion the past couple years to do remote debugging over TCP/IP.  It's quite nice on a fast LAN.  And it's invaluable to be able to reach out to a client's system and diagnose their app errors from the comfort of my office, rather than driving to other cities. :-)

Quote
Note that to use any of the IBM debuggers with GCC, programs need to be linked with -Zomf as well as built with -g

I've had to use GCC when I've had to, but I've found GCC and GDB to be inferior debugging tools.  It's why I've done most of my development in Win32.  Visual Studio 2019 Community is free for up to 5 developers to use for proprietary / commercial work.  If you're an open source developer, it's free for any number whether proprietary or not.  It has features like edit-and-continue debugging, where you can change your source code while the program is running, apply code changes, and keep going.

There's no other development environment like it on the planet.  If there is, I'd like to see it.

Rick C. Hodgin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 32
    • View Profile
Re: Which debugger to use.
« Reply #7 on: November 02, 2019, 03:06:27 am »
sd386 looks nice ... It has source code.

The source code there is a treasure trove of useful information.  Incredibly exciting.

I wonder if any of  the developers are still available?  Maybe they'd like to teach me a thing or two about their work and goals.
« Last Edit: November 02, 2019, 03:27:57 am by Rick C. Hodgin »

Rick C. Hodgin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 32
    • View Profile
Re: Which debugger to use.
« Reply #8 on: November 02, 2019, 04:20:38 pm »
For free and simple (textmode so you can run in full screen session to debug PM app) there is http://hobbes.nmsu.edu/download/pub/os2/dev/util/sd386v50.zip. Better is if you can install VAC. such as 3.08 (winworld has a copy) or find a copy of jitdbg.

Do you know what the license is for this product?  sd386v50.zip on Hobbes

I can't find any references to it in the source code.  Since it's been released in source code form, is it in the public domain?  This source code could serve as the base for a more comprehensive, more modern native/IBM-derived OS/2 debugger.
« Last Edit: November 02, 2019, 04:23:14 pm by Rick C. Hodgin »

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2148
    • View Profile
Re: Which debugger to use.
« Reply #9 on: November 02, 2019, 04:38:54 pm »
It doesn't seem to have a license, which makes it weird to do much with.

Rick C. Hodgin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 32
    • View Profile
Re: Which debugger to use.
« Reply #10 on: November 02, 2019, 06:58:38 pm »
It doesn't seem to have a license, which makes it weird to do much with.

I'll use it as a guide and write new code in my style then.

But first I'll see if I can't get it to compile and ported to Win32 for remote debugging.  I could use it in a VM and debug into it that way.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2148
    • View Profile
Re: Which debugger to use.
« Reply #11 on: November 02, 2019, 07:03:31 pm »
Wonder if Martin can use one of his IBM contacts to clarify the licensing? Also seems as it was publicly released with source and announced as abandoned, it would likely be fine to treat as public domain with the worst result being a cease and desist letter.

Rick C. Hodgin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 32
    • View Profile
Re: Which debugger to use.
« Reply #12 on: November 03, 2019, 03:19:26 pm »
Wonder if Martin can use one of his IBM contacts to clarify the licensing? Also seems as it was publicly released with source and announced as abandoned, it would likely be fine to treat as public domain with the worst result being a cease and desist letter.

Maybe so.  That'd be nice.

I really like sd386.  It's simple, fast.  Looks like it may be the precursor of what became Microsoft's CodeView Debugger for DOS and OS/2 when Microsoft split with IBM.

I cannot help but wonder what the OS world would've been like if IBM could've stuck in there and improved OS/2 for another ten years.

I haven't been able to get sd386 to compile yet.  I get close, but my dev environment isn't setup properly.  I'll have to figure out what it's missing one-by-one I think, and setup the PATH to create the correct environment.  NMAKE seems to work on the .MK script though.  The UNZIP utility I used also stuck an ASCII-26 at the end of every file, so it complains about those characters as well. : -)

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 149
  • Posts: 2148
    • View Profile
Re: Which debugger to use.
« Reply #13 on: November 03, 2019, 05:23:11 pm »
I really like sd386.  It's simple, fast.  Looks like it may be the precursor of what became Microsoft's CodeView Debugger for DOS and OS/2 when Microsoft split with IBM.

May well be. Looking, it seems to have been ported from an original 16 bit version

Quote
I cannot help but wonder what the OS world would've been like if IBM could've stuck in there and improved OS/2 for another ten years.

Probably have MS OS/2 v10, now with telemetry now. NT was originally OS/2 NT ver3 and I have a Byte news article somewhere where MS announced running 32 bit Presentation Manager on NT.

Quote
I haven't been able to get sd386 to compile yet.  I get close, but my dev environment isn't setup properly.  I'll have to figure out what it's missing one-by-one I think, and setup the PATH to create the correct environment.  NMAKE seems to work on the .MK script though.  The UNZIP utility I used also stuck an ASCII-26 at the end of every file, so it complains about those characters as well. : -)

Looks like it was meant to be compiled with C-Set/2, the precursor of VACPP. The CTRL-Z's are put in there by the editor, they're DOS EOF markers.
C-Set/2, http://www.edm2.com/index.php/IBM_C_Set/2 seems to be available at WinWorld, https://winworldpc.com/product/ibm-c-set/20

Rick C. Hodgin

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 32
    • View Profile
Re: Which debugger to use.
« Reply #14 on: November 03, 2019, 07:02:37 pm »
I cannot help but wonder what the OS world would've been like if IBM could've stuck in there and improved OS/2 for another ten years.

Probably have MS OS/2 v10, now with telemetry now. NT was originally OS/2 NT ver3 and I have a Byte news article somewhere where MS announced running 32 bit Presentation Manager on NT.

My thinking (hoping??) was IBM would've been a holdout against that deep state intrusion invasion.  Noble IBM ... victorious over evil. : -)