T.R | Title | User | Personal Name | Date | Lines |
---|
2069.1 | Did they get to the main program first? | WIBBIN::NOYCE | Pulling weeds, pickin' stones | Fri Jan 24 1997 16:15 | 39 |
| I tested this with DEC C V5.5-002 and DEBUG T7.1-013 on
OpenVMS Alpha V6.2-1H2, but I think this should hold true
for all Alpha versions ...
Did the user notice this message?
%DEBUG-I-NOTATMAIN, Type GO to reach MAIN program
In order to construct the argcnt and argptr values, and set
up C signal handling, DEC C builds a "wrapper" main program
around the user's main program. (Several other languages have
done this for a long time.) If you follow the directions,
this is what you will see:
DBG> go
break at routine TST_STEP\main
3: int x = 1;
DBG> step/ret
stepped on return from TST_STEP\main\%LINE 3 to TST_STEP\main\%LINE 8
8: }
DBG> e r0
TST_STEP\main\%R0: 0000000000000001
DBG> g
%DEBUG-I-EXITSTATUS, is '%SYSTEM-S-NORMAL, normal successful completion'
DBG>
Since the "wrapper" routine calls SYS$EXIT instead of returning, this
is what you see if you don't start by saying GO:
DBG> step/ret
break at routine TST_STEP\main
3: int x = 1;
DBG> go
%DEBUG-I-EXITSTATUS, is '%SYSTEM-S-NORMAL, normal successful completion'
DBG>
This is entirely expected.
If there's some other behavior that's upsetting your customer, or if
the versions you listed don't behave as shown here, please let us know.
|
2069.2 | Duplicated | DECCXL::WIBECAN | That's the way it is, in Engineering! | Fri Jan 24 1997 16:42 | 30 |
| Bill, I believe what the customer would like is for the program to stop on the
"return" statement that fires, rather than on the curly brace. On Alpha, there
is just the one RET and the "return" statements are really branches, so that
may be the reason for the behavior.
Actually, I just tried this on VAX using DEC C, and the behavior is exactly as
described: the program runs to completion with no stop at all. Here is a
screen dump:
DECCXX$ run b
OpenVMS VAX DEBUG Version V6.2-000
Language is C, module set to B
DBG> step/return
Is 'Normal successful completion'
DBG> exit
Under VAX C, the program stops at the "return" statement that fires, so VAX C
wins by both methods.
Looking at the VAX machine code for DEC C and VAX C, I see that DEC C has no
actual RET instruction in the code path; it ends by call SYS$EXIT. VAX C has
RET instructions in the code path, one for each "return" statement.
I'll log this as a bug. Am I correct in assuming the customer would prefer the
VAX C behavior on Alpha platforms as well?
Brian
|
2069.3 | Maybe, but... | CSC32::J_HENSON | Don't get even, get ahead! | Fri Jan 24 1997 17:08 | 64 |
| >> <<< Note 2069.1 by WIBBIN::NOYCE "Pulling weeds, pickin' stones"
>> -< Did they get to the main program first? >-
>>I tested this with DEC C V5.5-002 and DEBUG T7.1-013 on
>>OpenVMS Alpha V6.2-1H2, but I think this should hold true
>>for all Alpha versions ...
>>Did the user notice this message?
>> %DEBUG-I-NOTATMAIN, Type GO to reach MAIN program
Actually, the user reported this with dec c/vax. I'm the one who
extended the testing to dec c/alpa. I did type GO (didn't get
$200, though) and waited until I got to the start of the program
before issuing the step/return command.
I got the same results as you are posting.
What the user wants is the same behavior they got with Vax C. That's
what they're used to, and what they've come to expect. If this is an
issue of educating the customer, I can try that. However, it does seem
reasonable to expect step/return to break on the return statement, and
not wait until the end of the module. After all, a return is a return,
regardless of how it is implemented.
How about the situation where the multiple returns are in a called function?
When I modified the original code as follows, I got similar results. I
have attached the debug log to the end of this reply.
Thanks,
Jerry
=============================================================================
main()
{
int sub(int),stat,x=1;
stat = sub(x);
}
int sub(int x)
{
if (x)
return(1);
else
return(0);
}
---------------------debug.log------------------------------------
g
!break at routine TST_STEP2\main
! 3: int sub(int),stat,x=1;
se br sub
g
!break at routine TST_STEP2\sub
! 8: if (x)
step/return
!stepped on return from TST_STEP2\sub\%LINE 8 to TST_STEP2\sub\%LINE 12
! 12: }
g
!%DEBUG-I-EXITSTATUS, is '%SYSTEM-S-NORMAL, normal successful completion'
exit
|
2069.4 | thanks | CSC32::J_HENSON | Don't get even, get ahead! | Fri Jan 24 1997 17:17 | 18 |
| >> <<< Note 2069.2 by DECCXL::WIBECAN "That's the way it is, in Engineering!" >>>
>> -< Duplicated >-
Brian,
Looks like I was entering reply .3 at the same time your were entering
.2, and I didn't see it until after I made my post.
I'll tell the customer that it is considered a bug, will be fixed in
a future version, and thank him for bringing this to our attention.
The customer did not comment on Dec C/Alpha behavior, so I can't tell
you his opinion on that. However, it seems reasonable to make it
the same on both architectures.
Thanks,
Jerry
|
2069.5 | Brian posted internal bug # 4085 | WIDTH::MDAVIS | Mark Davis - compiler maniac | Mon Jan 27 1997 09:53 | 0
|