C debugging issue (9.2-1, X86)

Post Reply
User avatar

Topic author
tlovern
Active Contributor
Posts: 40
Joined: Tue Jul 21, 2020 10:44 am
Reputation: 0
Status: Offline

C debugging issue (9.2-1, X86)

Post by tlovern » Mon Aug 14, 2023 3:20 pm

This is a weird one for me. I've brought over my debugger ini file, that I've used for probably 30 years without issue.
I compile a small working test module with:

Code: Select all

$ cc/g_float/nolist/nomember_align/prefix=all/noansi/assume=(nowritable_string_literals,aligned_object)/noopt/debug=ALL test.c
$ link/debug test
$
(Changing the CC command to be simply "CC/noopt/g_float/debug=all" did not make a difference)
C module is:

Code: Select all

#include<stdlib>
#include<stddef>
#include<stdio>
main()
{
int	a = 1;
char	*s="this is a string";

printf("\n\na=[%d] s=[%s]",a,s);
exit(1);
}
DBG.INI is:

Code: Select all

set mode screen
SET MODE SCREEN
set radix decimal
set step nosource
!
!DEFINE COLOR KEYS
!
DEFINE/KEY/NOLOG/SET_STATE=GOLD  PF1 ""
DEFINE/KEY/NOLOG/SET_STATE=RED   PF2 ""
DEFINE/KEY/NOLOG/SET_STATE=WHITE PF3 ""
DEFINE/KEY/NOLOG/SET_STATE=BLUE  PF4 ""
!*
!*NON-COLOR KEY DEFINITIONS
!*
DEFINE/KEY/NOLOG        DO "DEPOSIT "                   /NOTERM/ECHO
!
DEFINE/KEY/NOLOG        E1 "EX "                        /ECHO/NOTERM
DEFINE/KEY/NOLOG        E2 "SE BR %LI "                 /ECHO/NOTERM
DEFINE/KEY/NOLOG        E3 "CAN BR %LI "                /ECHO/NOTERM
DEFINE/KEY/NOLOG        E4 "DISPLAY/REFRESH"            /TERM/NOECHO
DEFINE/KEY/NOLOG        E5 "SCROLL/UP SRC"              /NOECHO/TERM
DEFINE/KEY/NOLOG        E6 "SCROLL/DOWN SRC"            /NOECHO/TERM
!
DEFINE/KEY/NOLOG        KP0 "STEP"                      /TERM/ECHO
DEFINE/KEY/NOLOG        KP7 "GO"                        /TERM/ECHO
!
DEFINE/KEY/NOLOG        F17 "SHOW SYMBOL "              /ECHO/NOTERM
DEFINE/KEY/NOLOG        F18 "SET MODULE/ALL"            /TERM/ECHO
DEFINE/KEY/NOLOG        F19 "SET SCOPE MAIN"            /TERM/ECHO
DEFINE/KEY/NOLOG        F20 "CAN SCOPE"                 /TERM/ECHO
!
!*
!*GOLD KEYS
!*
DEFINE/KEY/NOLOG/IF_STATE=GOLD DO "DEP/ASCII "          /NOTERM/ECHO
!
DEFINE/KEY/NOLOG/IF_STATE=GOLD E1 "EX/ASCII "           /NOTERM/ECHO
DEFINE/KEY/NOLOG/IF_STATE=GOLD E2 "SE BR "              /ECHO/NOTERM
DEFINE/KEY/NOLOG/IF_STATE=GOLD E3 "CAN BREAK "          /ECHO/NOTERM
DEFINE/KEY/NOLOG/IF_STATE=GOLD E4 "SE MODU "            /ECHO/NOTERM
!
DEFINE/KEY/NOLOG/IF_STATE=GOLD  KP0 "STEP "             /NOTERM/ECHO
DEFINE/KEY/NOLOG/IF_STATE=GOLD  KP7 "GO "               /NOTERM/ECHO
!
!*
!*RED KEYS
!*
DEFINE/KEY/NOLOG/IF_STATE=RED HELP "DISPLAY OUT AT FS;SHOW CALLS"       /TERM/ECHO
!
DEFINE/KEY/NOLOG/IF_STATE=RED E1 "EVALUATE/ADDRESS "                    /NOTERM/ECHO
DEFINE/KEY/NOLOG/IF_STATE=RED E3 "CAN BR/ALL"                           /TERM/ECHO
!
DEFINE/KEY/NOLOG/IF_STATE=RED KP0 "STEP/INTO"   /TERM/ECHO
!
!*
!*WHITE KEYS
!*
DEFINE/KEY/NOLOG/IF_STATE=WHITE DO "REPEAT 10 DO ("     /NOTERM/ECHO
!
DEFINE/KEY/NOLOG/IF_STATE=WHITE E1 "SEARCH "            /NOTERM/ECHO
DEFINE/KEY/NOLOG/IF_STATE=WHITE E2 "type"               /noterm/echo
!
!display the windows
!
display src at(1,33), out at (34,8), prompt at (43,5)
run the debug program and I cannot see the source code, no matter what I do.

I tried:
set module/all
set source/module=TEST []

set br main

no source is displayed.

Tried setting scope to TEST

interestingly, "type 1" does type the expanded source, starting at line one.

even debug in non-window mode will not show any source lines.
if I do a show modules TEST shows up with symbols
the language is set to C
Last edited by tlovern on Mon Aug 14, 2023 3:28 pm, edited 2 times in total.

User avatar

Topic author
tlovern
Active Contributor
Posts: 40
Joined: Tue Jul 21, 2020 10:44 am
Reputation: 0
Status: Offline

Re: C debugging issue (9.2-1, X86)

Post by tlovern » Tue Aug 15, 2023 2:40 pm

ok, more information:

using:

Code: Select all

 CC/noopt/debug test
 link/trace/debug test
 
to build the exe in my login directory.
then I run the program with a pared down dbg.ini

doing:

Code: Select all

SET MODULE/ALL
SET SCOPE TEST
Allows me to use the TYPE command: i.e.: type 3946 to see source from my module.
I cannot set breaks to a line number (generates an exception), nor does stepping through the code display source code.

clearly it can see the source code, or type would not work. I'm not using any directives or logicals or anything. It has to be either a compiler switch I'm missing, or a linker switch that's wrong.

privs do not appear to be the cause....
Last edited by tlovern on Tue Aug 15, 2023 2:51 pm, edited 1 time in total.

User avatar

Topic author
tlovern
Active Contributor
Posts: 40
Joined: Tue Jul 21, 2020 10:44 am
Reputation: 0
Status: Offline

Re: C debugging issue (9.2-1, X86)

Post by tlovern » Wed Aug 16, 2023 11:06 am

changed the test program to not do any includes and just declare some variables and do math on them. I wanted to rule out any directory logicals or weird translation issues.

I compiled specifying the device and directory path, linked doing the same.

it still cannot display the source code. setting the source for the module and setting the scope to the module allowed me to type the source and it displays.

I set a break at main, and do a go.

from there, trying to do a set break at line 17, gives me a message that 17 doesn't exist, but that 15 and 19 do. I set the br to line 19 and it stack dumps o the command. (i.e.: never did a go)

Code: Select all

$ write sys$output cc
CC/G_FLOAT/prefix=all

$ cc/noopt/debug dka100:[users.1lovern]Y.C
$ link/debug dka100:[users.1lovern]Y.OBJ
$ r y

         OpenVMS x86-64 Debug64 Version V9.2-005

%DEBUG-I-INITIAL, Language: C, Module: Y
─ SRC: module Y -Scroll-source─────────────────────────────────────────────────────
->  1:
     2:
     3:
     4:
     5: main()
     6: {
     7: int     a,      b,      c,      d,      e,      f;
     8:
     9:         a=1;
    10:
    11:         b+a+33;
    12:
    13:         c = b/2;
    14:
    15:         d = b*2;
    16:
    17:         e = a+b+c+d;
    18:
    19:         f = e-b;
    20:
    21:         a = f+c+e;
    22: }
    23:
    24:

─ OUT -output─────────────────────────────────────────────────────────────────

─ PROMPT -error-program-prompt──────────────────────────────────────────────────
DBG> set scope Y
DBG> type 1
DBG> set br main\%line 17
%DEBUG-F-INTMEMERR, internal memory-pool error
-LIB-F-BADBLOSIZ, bad block size
────────────────────────────────────────────────────────────────────────────
got a stack dump, preserved in the DBGERR.LOG file:

Code: Select all

!Logging enabled to file: DBGERR.LOG
!
!If you wish to log a Debug problem report please include:
!
!     o This file.
!     o The operating system version number.
!     o The system type or types if using Client/Server mode.
!     o The program being debugged, both source and image.
!     o The last, if not all, debug commands entered.
!     o Any other information which you think would be helpful.
!
!Debugger Version: OpenVMS x86-64 Debug64 Version V9.2-005
!
!image     module    routine               line      rel PC           abs PC
!DEBUGSHR  GETMEMORY.B32;1  GET_BYTES_OF_MEMORY
!                                         #2228 0000000080323F2B 000000007BBA3F2B
!DEBUGSHR  GETMEMORY.B32;1  DBG$GET_MEMORY_BYTE
!                                         #1680 000000008032322A 000000007BBA322A
!DEBUGSHR  DBGEVENT_SEMANTICS.B32;1  FILL_IN_EVENT_VALUES
!                                         #5097 00000000802DB100 000000007BB5B100
!DEBUGSHR  DBGEVENT_SEMANTICS.B32;1  DBG$EVENT_SEMANTICS
!                                         #3267 00000000802D76A5 000000007BB576A5
!DEBUGSHR  DBGNSET.B32;1  DBG$NEXECUTE_SET
!                                         #2985 00000000802B2BA2 000000007BB32BA2
!DEBUGSHR  COMMAND_NODES.C;1  dbg_do_verb_action
!                                         #4544 0000000080090F88 000000007B910F88
!DEBUGSHR  DBGNEXCTE.B32;1  DBG$NEXECUTE_CMD
!                                         #1353 000000008036426D 000000007BBE426D
!DEBUGSHR  DBGNCNTRL.B32;1  DO_CMD        #2215 0000000080365899 000000007BBE5899
!DEBUGSHR  DBGPROCESS.B32;1  DBG$VISIT_PROCESSES
!                                         #7233 000000008010F0B5 000000007B98F0B5
!DEBUGSHR  DBGNCNTRL.B32;1  DBG$NCONTROL
!                                         #2095 000000008036558F 000000007BBE558F
!DEBUGSHR  DBGEXC.B32;1  DBG$COMMAND_PROC
!                                         #3675 00000000801C53C9 000000007BA453C9
!DEBUGSHR  DBGMAIN.B32;1  DBG$PROCESS_USER_INPUT
!                                         #2479 00000000800A0162 000000007B920162
!DEBUGSHR  DBGMAIN.B32;1  DBG$ACTUAL_MAIN_LOOP
!                                         #1859 000000008009F0A9 000000007B91F0A9
!DEBUGSHR  DBGMAIN.B32;1  DBG$MAIN_LOOP
!                                         #1641 000000008009ED9F 000000007B91ED9F
!                                             0 FFFF8300085FC0A6 FFFF8300085FC0A6
!DCL                                          0 000000008006778B 000000007ADFF78B
[End of file]
At this point, the system is almost unusable without the ability to debug. I've eliminated what I think are the obvious items. There are no include directives, I'm fully specifying the path when compiling, in case there was some weird logical embedded in the module.

one last thought - lnk$libraries:

Code: Select all

$ show logical/full lnk$library*

(LNM$PROCESS_TABLE)	[kernel]
			[no protection information]

(LNM$JOB_826E8C80)	[kernel]  [shareable]  [Quota=(3504,4096)]
			[Protection=(RWCD,RWCD,,)]  [Owner=[1LOVERN]]

(LNM$GROUP_000200)	[kernel]  [shareable,group]
			[Protection=(RWCD,R,R,)]  [Owner=[200,*]]

(LNM$SYSTEM_TABLE)	[kernel]  [shareable,system]
			[Protection=(RWC,RWC,R,R)]  [Owner=[SYSTEM]]

  "LNK$LIBRARY" [exec] = "SYS$LIBRARY:IMAGELIB.OLB"
  "LNK$LIBRARY_1" [exec] = "SYS$LIBRARY:STARLET.OLB"
  "LNK$LIBRARY_2" [exec] = "USER$LIBRARY:RTL_LIBRARY.OLB"

(LNM$SYSCLUSTER_TABLE)	[kernel]  [shareable,system]
			[Protection=(RWC,RWC,R,R)]  [Owner=[SYSTEM]]

(DECW$LOGICAL_NAMES)	[exec]  [shareable]
			[Protection=(RWCD,RWCD,R,R)]  [Owner=[SYSTEM]]
$ show logical/full user$library
   "USER$LIBRARY" [exec] = "SOURCE$ROOT:[LIB]" (LNM$SYSTEM_TABLE)
$ show logical/full source$root
   "SOURCE$ROOT" [exec] = "USER$DISK:[SRC.]" [concealed] (LNM$SYSTEM_TABLE)
$

Last edited by tlovern on Wed Aug 16, 2023 11:35 am, edited 3 times in total.

User avatar

imiller
Master
Posts: 157
Joined: Fri Jun 28, 2019 8:45 am
Reputation: 0
Location: South Tyneside, UK
Status: Offline
Contact:

Re: C debugging issue (9.2-1, X86)

Post by imiller » Wed Aug 16, 2023 11:35 am

I see the V9.2-1 release notes have this

2.1.27.6. Not Supported or Not Working Features
Below is the list of commands and functionalities that are currently not supported or do not function
correctly:
• SET MODE SCREEN is not available
SET MODE SCREEN (and associated commands) are not currently available. Executing the SET
MODE SCREEN command will result in undefined behaviour that may cause the debugger to
become unstable.
Ian Miller
[ personal opinion only. usual disclaimers apply. Do not taunt happy fun ball ].

User avatar

Topic author
tlovern
Active Contributor
Posts: 40
Joined: Tue Jul 21, 2020 10:44 am
Reputation: 0
Status: Offline

Re: C debugging issue (9.2-1, X86)

Post by tlovern » Wed Aug 16, 2023 11:36 am

Dang, I missed that. The debugger wasn't the only thing becoming unstable in screen mode.

Cool, now to go back and do it the old fashioned way. :-)

Now that I have read the release notes on the debugger, I can dust off my old-old school tools.

Thank you very much Ian!

I am going to spend a lot more time in the release notes.

Apologies to the board for spamming this thread needlessly.
Last edited by tlovern on Wed Aug 16, 2023 11:49 am, edited 1 time in total.


jreagan
VSI Expert
Master
Posts: 148
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: C debugging issue (9.2-1, X86)

Post by jreagan » Wed Aug 16, 2023 2:05 pm

There is an upcoming OS update for V9.2-1 that will include a newer debugger that does SET MODE SCREEN. I've been using it without problems.

User avatar

imiller
Master
Posts: 157
Joined: Fri Jun 28, 2019 8:45 am
Reputation: 0
Location: South Tyneside, UK
Status: Offline
Contact:

Re: C debugging issue (9.2-1, X86)

Post by imiller » Thu Aug 24, 2023 7:50 am

I see VMS921X_UPDATE-V0100 is available and includes the Debugger updates.
Ian Miller
[ personal opinion only. usual disclaimers apply. Do not taunt happy fun ball ].

User avatar

cct
Master
Posts: 136
Joined: Sat Aug 15, 2020 9:00 am
Reputation: 0
Location: Cambridge, UK
Status: Offline

Re: C debugging issue (9.2-1, X86)

Post by cct » Thu Aug 24, 2023 9:24 am

Which doesn't seem to be available to us mere mortals!

Chris
--
Chris


babydr
Valued Contributor
Posts: 54
Joined: Thu Dec 23, 2021 8:02 pm
Reputation: 0
Location: Fairbanks , AK.
Status: Offline

Re: C debugging issue (9.2-1, X86)

Post by babydr » Thu Aug 24, 2023 6:27 pm

Hello All , I am in agreement with his Highness(cct) ;-)
It appears from the reaction of the download agent that we do not have download permissions at this time .
Hopefully this will be corrected at a future moment .
But , I also find the package was uploaded 2023-01-30 15:53:48 , IF I am looking at the right package . And I was NOT .
the present update is dated 2023-08-23 02:49:19 . Not sure if that is an AKT time stamp .

Twyl , JimL
Last edited by babydr on Thu Aug 24, 2023 6:39 pm, edited 4 times in total.


jreagan
VSI Expert
Master
Posts: 148
Joined: Tue Dec 01, 2020 8:40 am
Reputation: 0
Status: Offline

Re: C debugging issue (9.2-1, X86)

Post by jreagan » Thu Aug 24, 2023 7:00 pm

The debugger in the V9.2-1 update includes SET MODE SCREEN and other fixes.

I'll have my debugger expert look over this post to look for other issues

John

Post Reply