Operating System - OpenVMS
1753747 Members
4870 Online
108799 Solutions
New Discussion юеВ

OpenVMS Alpha Debug64 - Examining char buffer as array

 
SOLVED
Go to solution
Alex Vournas
Occasional Advisor

OpenVMS Alpha Debug64 - Examining char buffer as array

#include
int main()
{
char buffer[10];
strcpy(buffer, "123456789");
return 0;
}

Using OpenVMS Alpha DEBUG Version V7.1-06R if I examine buffer, I get this output:

DBG> ex buffer
DEBUGTEST\main\buffer[0:9]
[0]: 49
[1]: 50
[2]: 51
[3]: 52
[4]: 53
[5]: 54
[6]: 55
[7]: 56
[8]: 57
[9]: 0
DBG>

Using OpenVMS Alpha Debug64 Version V7.3-200 I get:

DBG> ex buffer
DEBUGTEST\main\buffer: "123456789"
DBG>

I would like to know how I can output buffer as an array like the old version did. I thought "ex buffer[0:9]" may work, but I still get "123456789". Any suggestions?
4 REPLIES 4
Dale A. Marcy
Trusted Contributor

Re: OpenVMS Alpha Debug64 - Examining char buffer as array

I believe examine/byte buffer will give the desired results.
Alex Vournas
Occasional Advisor

Re: OpenVMS Alpha Debug64 - Examining char buffer as array

That doesn't work either

DBG> ex /byte buffer
DEBUGTEST\main\buffer: 49
DBG>

neither does this

DBG> ex /byte buffer[0:9]
DEBUGTEST\main\buffer: 49
DBG>
John Gillings
Honored Contributor
Solution

Re: OpenVMS Alpha Debug64 - Examining char buffer as array

Alex,

I think I'd argue that the behaviour of displaying a string is a big improvement!

The program usage is most likely as a string, so that's how DEBUG should display it.

To display as an array use:

DBG> EXAMINE/BYTE buffer[0]:buffer[9]

or, to see individual characters:

DBG> EXAMINE/ASCII buffer[0]:buffer[9]
A crucible of informative mistakes
Alex Vournas
Occasional Advisor

Re: OpenVMS Alpha Debug64 - Examining char buffer as array

John,

Thanks, that is exactly what I was looking for. I agree with you about the new behavior being an improvement, but I still find it necessary to display each byte in some cases.

Thanks again,
Alex