0

I am trying to take over some projects involving DEC BASIC, A.K.A. VAX BASIC, A.K.A. Alpha BASIC. I am really hoping to run into someone with experience here. I have been through the user manual for VAX/Alpha BASIC through and though but I can't figure out how to debug shareable code.

I can create, compile and link shareable code, I can debug the code that references the shareable code, but I can't debug the shareable code. Any help would be greatly appreciated.

The commands I am using to compile and link are:

$ BASIC/DEBUG/NOOPTIMIZE COMPARE_DATES_TEST.BAS,COMPARE_DATES.BAS
$ LINK/SHAREABLE/DEBUG COMPARE_DATES.OBJ,COMPARE_DATES_SUB/OPT
$ LINK/DEBUG COMPARE_DATES_TEST,COMPARE_DATES_MAIN/OPT
$ RUN COMPARE_DATES_TEST

The contents of the two option files are:

$ type COMPARE_DATES_SUB.OPT
! COMPARE_DATES_SUB.OPT
SYMBOL_VECTOR=(COMPARE_DATES=PROCEDURE)
$ type COMPARE_DATES_MAIN.OPT
! COMPARE_DATES_MAIN.OPT
COMPARE_DATES/SHAREABLE

My shareable code has a bug, but I don't know where, the debugger reports:

— SRC: module COMPARE_DATES_TEST$MAIN -scroll-source————————————————————————————
     1: EXTERNAL INTEGER FUNCTION COMPARE_DATES(STRING,STRING)
     2: DECLARE STRING A$, B$
     3: A$ = "01-APR-18"
     4: B$ = "15-MAY-2017"
     5:
->   6: PRINT COMPARE_DATES(A$, B$)
     7: END
— OUT -output———————————————————————————————————————————————————————————————————
stepped to COMPARE_DATES_TEST$MAIN\COMPARE_DATES_TEST$MAIN\%LINE 3
stepped to COMPARE_DATES_TEST$MAIN\COMPARE_DATES_TEST$MAIN\%LINE 4
stepped to COMPARE_DATES_TEST$MAIN\COMPARE_DATES_TEST$MAIN\%LINE 6
%BAS-F-SUBOUTRAN, Subscript out of range
-BAS-I-FROFUN, In external function COMPARE_DATES
-BAS-I-FROMOD, In module COMPARE_DATES_TEST
break on unhandled exception preceding 18446744071563830960
— PROMPT -error-program-prompt——————————————————————————————————————————————————
%DEBUG-I-SOURCESCOPE, source lines not available for %PC in scope number 0
        Displaying source for 6\%PC
DBG>
  • By default the shareable image will be loaded from `Sys$Share:`. Is that where the file is being placed, or have you created a logical name to point to your local debugging image? (Ref section 5.4 [here](http://h41379.www4.hpe.com/doc/84final/4538/4538pro_011.html).) – HABO Sep 06 '17 at 14:33
  • I added a logical "DEFINE COMPARE_DATES DRIVE:[FOLDER]COMPARE_DATES.EXE" – geoffb-csharpguy Sep 06 '17 at 15:09
  • Usually the debugger will show you the source code when it stops at a break point, which here is an "unhandled exception". The debugger however reports that it can't find the sources. Usually the debugger is right. – user2116290 Sep 06 '17 at 21:40
  • Hit return too early, so ... The debugger claims the exception is around 18446744071563830960 which is ```ffffffff801ae6b0```, which is in system space. That's very likely not your shareable image (or is it installed?) What is the debugger's output of ```show image```? Can you see your shareable image? What's its address space? At line 6 of your main, did you try a ```step/into``` to get into your shareable image? – user2116290 Sep 06 '17 at 21:51
  • `COMPARE_DATES no 0000000000042000 00000000000480B7` – geoffb-csharpguy Sep 06 '17 at 22:42
  • `*COMPARE_DATES_TEST yes 0000000000010000 00000000000400D7` – geoffb-csharpguy Sep 06 '17 at 22:43
  • [Debugger output of show image](http://oi68.tinypic.com/2r6igwm.jpg) – geoffb-csharpguy Sep 06 '17 at 22:48
  • Step/Into on line 6 results: Output="stepped to SHARE$DEC$BASRTL_CODE0+683200" ------------------------------------------------------------- Error="%DEBUG-I-SOURCESCOPE, source lines not available for %PC in scope number 0 Displaying source for 1\%PC" – geoffb-csharpguy Sep 06 '17 at 22:50

1 Answers1

0

Too long for a comment: You compiled with /NOOPTIMIZE, so I would have expected that a STEP/INTO when at line 6, PRINT COMPARE_DATES(A$, B$), would have stepped to COMPARE_DATES in your shareable image. I don't know why that's not the case, here. The debugger is right, you don't have the sources for DEC$BASRTL. Your shareable image is not installed, it is in your address space. It seems PRINT has problems with the passed argument. I would try a SET IMAGE COMPARE_DATES; SET MODULE/ALL; SET BREAK COMPARE_DATES at the initial debugger prompt. That makes all debug symbols of the shareable image known and sets a breakpoint in your function. And then a GO should get you into your function. (I noticed, that you have the same names for the function, the source module and the shareable image. This shouldn't be a problem.)

user2116290
  • 1,062
  • 5
  • 6
  • The [SET IMAGE COMPARE_DATES...] worked. It allowed the debugger into the shared image. Thank you so very much. After I was in I ran into a similar error though. In the shared image there are two functions, COMPARE_DATES, the one being called from the test program and another COMPARE_DATES_PARTS. When I try to step into the function which resides in the same shared image is chokes. [Screen Cap of code and debugger](http://oi66.tinypic.com/2drriom.jpg) – geoffb-csharpguy Sep 07 '17 at 17:25
  • Did you try to ```STEP/INTO``` the function ```COMPARE_DATE_PARTS```? Maybe that can give you some clues. To me this doesn't look like a debugger problem. On the other hand, I don't know enough of BASIC to understand the code snippets you posted: in main there is a ```COMPARE_DATES(A$, B$)```, strings are passed, in ```COMPARE_DATES``` there is a ```COMPARE_DATE_PARTS(DATE_PART_A%, DATE_PART_B%)```, integers are passed. So there is likely more code in ```COMPARE_DATES```. You may want/need to show more of the source code. – user2116290 Sep 07 '17 at 18:39