/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Copyright (c) 1983-1998 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* Subroutines to be called by adbgen2.c, the C program generated
* by adbgen1.c.
*/
#include <stdio.h>
#include <stdlib.h>
int warns = 0;
/*
* User claims offset is ok.
* This usually follows call to another script, which we cannot handle.
*/
void
offsetok(void)
{
last_off = -1;
}
/*
* Get adb.s dot to the right offset.
*/
void
{
if (last_off == -1) {
return;
}
if (off_diff) {
if (off_diff > 0) {
if (off_diff > 1) {
}
printf("+");
}
if (off_diff < 0) {
if (off_diff < -1) {
}
printf("-");
}
}
}
/*
* Emit the format command, return the size.
*/
int
{
char *cp;
do {
}
if (rcount == 0) {
rcount = 1;
}
switch (*cp) {
case 'e':
case 'E':
case 'F':
case 'g':
case 'G':
case 'J':
width = 8;
break;
case 'K':
#ifdef _LP64
width = 8;
#else /* _LP64 */
width = 4;
#endif /* _LP64 */
break;
case 'X':
case 'O':
case 'Q':
case 'D':
case 'U':
case 'f':
case 'Y':
case 'p':
case 'P':
width = 4;
break;
case 'x':
case 'o':
case 'q':
case 'd':
case 'u':
width = 2;
break;
case 'v':
case 'V':
case 'b':
case 'B':
case 'c':
case 'C':
case '+':
width = 1;
break;
case 'I':
case 'a':
case 'A':
case 't':
case 'r':
case 'n':
width = 0;
break;
case '-':
width = -1;
break;
case 's':
case 'S':
case 'i':
if (warnings) {
"Unknown format size \"%s\", assuming zero\n",
acp);
warns++;
}
width = 0;
break;
default:
exit(1);
}
for (i = 0; i < rcount; i++) {
}
cp++;
} while (*cp);
return (sum);
}
/*
* Format struct member, checking size.
*/
void
{
int fs;
"warning: \"%s\" size is %ld, \"%s\" width is %d\n",
warns++;
}
}
/*
* Get the value at offset based on base.
*/
void
{
if (offset == 0) {
} else {
}
} else if (size == 2) {
if (offset == 2) {
} else {
}
} else if (size == 1) {
if (offset == 3) {
} else {
} else {
printf("((*(%s+0t%ld)&0xff00)/0x100)",
}
}
} else {
exit(1);
}
}