From: Chris_F_Chiesa@cup.portal.com
Newsgroups: comp.os.vms
Subject: Re: Debugger problem
Date: Sat, 11 Apr 92 09:02:15 PDT
Organization: The Portal System (TM)

In an article which Portal does not allow me to identify specifically, 
Jeff E. Nelson (jnelson@gauche.zko.dec.com) writes:

> In article <56998@cup.portal.com>, Chris_F_Chiesa@cup.portal.com writes:
> |>Namely, if I have a data declaration like this:
> |>
> |>mystring:	.ascid	\Bogus\
> |>
> |>I'd like the debugger to interpret the symbol "mystring," when issued in
> |>a command (e.g. EVAL/ADDRESS MYSTRING; SHOW SYM/ADDR MYSTRING; EXAM/QUAD
> |>MYSTRING; etc.), as the address of the DESCRIPTOR, which is what the symbol
> |>actually defines in terms of memory addresses.
>
> [...] I tried your example on VMS V5.4 using MACRO32 with the following
> image identification:
> 
>                 image name: "MACRO32"
>                 image file identification: "X-8"
>                 link date/time: 19-JUN-1990 05:19:57.17
>                 linker identification: "05-05"
> 
> Source code:
> -----------------------------------
> mystring:       .ascid  \Bogus\
>         .external    lib$put_output
>         .entry main,^m<>
>         pushab  mystring
>         calls   #1,g^lib$put_output
>         ret
>         .end    main
> -----------------------------------
> 
> Sample run:
> -----------------------------------
> $ r test
> 
>          VAX DEBUG Version V5.4-019
> 
> %DEBUG-I-INITIAL, language is MACRO, module set to .MAIN.
> DBG> show symbol/address/type mystring
> data .MAIN.\MYSTRING
>     descriptor address: 00000200
>     string descriptor type, character-coded text, size: 5 bytes
> DBG> e mystring
> MAIN.\MYSTRING:        'Bogus'
> -----------------------------------
> 
> Thanks for bringing the problem to our attention. I'm happy to report
> that it is fixed.

Jeff, I disagree with your statement that it is "fixed," although I'm glad
to see SHOW/SYMBOL/ADDRESS giving the right information as a workaround.
(I notice I mistakenly include SHOW SYM/ADDRESS among those commands "not
behaving as I'd like," in my previous posting.  That's what I get for 
having to post from a system other than where I run VMS...)

Anyway...  The following Debugger log transcript shows the problem I'm trying 
to describe to you, and which everyone at Digital seems to feel "is a feature, 
not a bug!"  Using the same source code as above:

$ RUN TEST
eval/addr mystring
!00000208
exam/quad 208
!00000208:       9F000073 75676F42
exam/quad mystring
!.MAIN.\MYSTRING:        9F000073 75676F42
show sym/addr mystring
!data .MAIN.\MYSTRING
!    descriptor address: 00000200
exam/quad 200
!00000200:       00000208 010E0005

Obviously, the descriptor itself is at address %X00000200, and the 
character string itself is at %X00000208.  I can see why the Debugger group
thinks they're doing the right thing, i.e. "when you use EVAL, Debug thinks
in terms of 'the actual string,' and gives you the address of the DATA, but
when you use SHOW SYMBOL/ADDRESS it assumes you want the address of the 
DESCRIPTOR."  That's fine for HLL programmers who work with the abstract
data type "character string" and don't care how/where it's stored.  But 
we're a MACRO shop, and we DON'T think that way, and we find it hard to
believe that ANY Macro programmer WOULD think that way.  The key point is
that in Macro, any reference to the symbol "MYSTRING" generates the DESCRIPTOR 
address, %X00000200.  It is patently absurd, from the Macro standpoint, to
have the symbol MYSTRING "sometimes reference the DATA at %X00000208, as
with EVAL/ADDR, and other times reference the DESCRIPTOR at %X00000200, as
with SHOW SYMBOL/ADDRESS."  Aside from being annoying, this is an out-and-
out departure from the syntax and behavior of the language being debugged.
If I want to deposit some values into the DESCRIPTOR, I _can't do_ a 
"DEPOSIT/WORD MYSTRING+DSC$W_LENGTH = value", because that will wipe out
the first two characters of the DATA.  Wrong, wrong, WRONG.  It's a BUG,
-=NOT=- a -=FEATURE=-.

Oh, and under VMS V4 we could ALSO say things like

        DBG> DEP PC = %LINE 100

This ceased to work as of VMS V5, and now causes the PC to receive the 
address where the Debugger STORES THE "%LINE" EXPRESSION.  I have to work
around THIS by saying 

        DBG> EVAL/ADDRESS %LINE 100
        (address expression is displayed)
        DBG> DEP PC = expression_that_was_displayed

Again: I don't care if you guys CHANGE things, but at least leave us a
way BACK to the OLD behavior!  "SET BEHAVIOR V4" wouldn't be THAT hard to
implement, now WOULD it?  It'd certainly be easier than recoding the entire 
DECwindows debugger interface, which you tell us somebody took the time to do.

Anyway, I hope this makes the nature of my complaints clearer than my
original posting.  I got smart and composed this on my VMS system where
I could substantiate the behavior before posting.  (Now if I can just 
get the upload to Portal working right...!)

Chris Chiesa
  Chris_F_Chiesa@cup.portal.com