[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | Alpha Migration Tools - Digital Confidential |
Notice: | Kits: VEST v1.1A: Note 15.60, mx v1.2-4: Notes 4.23 & 4.24 |
Moderator: | TALLIS::GORTON |
|
Created: | Wed Jun 13 1990 |
Last Modified: | Mon May 26 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 970 |
Total number of notes: | 4239 |
963.0. "Data mapping problems Vax C vs. Alpha C" by JAMSIE::CORBETT () Tue Apr 08 1997 05:38
I have a problem with porting code from VAX to ALPHA.
This particular problem occurs with mapping data to data structures.
The code reads VMS error log files and interprets the header. It works
correctly on VAX but then loses data (on alignment) on the ALPHA.
The essential pieces of code and data are seen below :
1. the struct definition;
2. the mapping to memory 'vms_hdr';
3. the mapping from read buffer to memory;
4. a dump of the first file block.
The two columns alongside the struct definition show the hex values
assigned to the data items in the struct after memory mapping (the data
in the buffer is correct on both machines according to the dump). The
error occurs consistently with other files.
The mis-alignment seems to start following the 'short rev' item
where the two bytes 0101 are lost from the ALPHA data
(another mis-alignment occurs later following another 'short').
1.
typedef struct hdr_ptype { VAX ALPHA
int sid; 0B000006 0B000006
short rev; FFFB FFFB
int systype; 02300101 00040230
.
} vms_hdr_stype;
.
2. .
vms_hdr_stype vms_hdr;
.
3. .
while ((file_status = ReadFile(in_file_ptr->filename)) != RMS$_EOF)
{
if (file_status == FILEERROR) break;
temp_hdr_ptr = (vms_hdr_stype *) buffer;
vms_hdr = *temp_hdr_ptr;
4.
Dump of file DPP$USER:[CORBETT.LOCALMPH.DATA]ERRLOG.OLD;53 on 8-APR-1997 07:48:07.58
File ID (29598,113,0) End of file block 87 / Allocated 87
Virtual block number 1 (00000001), 512 (0200) bytes
00000000 00202020 4F535050 44080000 00000004 02300101 FFFB0B00 00060040 @.....�...0........DPPSO ..... 000000
C0060000 00002020 2020312E 36560000 009A8FD7 76E97F28 00234001 00000000 .....@#.(.�v�.....V6.1 .....� 000020
00000020 20204F53 50504408 00000000 00040230 0101FFFB 0B000006 00400029 ).@.....�...0........DPPSO ... 000040
.
20202020 312E3656 143F009A 912FC95C 38280041 40010000 00000000 00000020 ..........@A.(8\�/...?.V6.1 0001E0
When I compile cc/SHOW=ALl on the VAX I get a listing of the data dictionary.
When I compile with the same parameters on the ALPHA, there is no dictionary listing
although the help command states that the data dictionary listing should appear.
Can anyone help with explanations and suggestions, please??
Daniel
T.R | Title | User | Personal Name | Date | Lines |
---|
963.1 | Compiler question | HNDYMN::MCCARTHY | A Quinn Martin Production | Tue Apr 08 1997 06:33 | 7 |
| This is most likly a question for the TURRIS::DECC conference.
Have you tried #pragma directives or /member_align
VAXC did not pad structions, DECC does.
bjm
|
963.2 | It works, thank you, bjm | JAMSIE::CORBETT | | Tue Apr 08 1997 09:31 | 0
|