示例#1
0
static void
print_array(struct mlist *mlp, struct tdesc *tdp, char *format, int level)
{
	struct ardef *ap = tdp->data.ardef;
	int items, inc;

	if (level == 0) {
		items = ap->indices->range_end - ap->indices->range_start + 1;
		inc = (mlp->size / items) / 8;
#if 0 /* { FIXME: */
		printf("#define\t%s 0x%x\n", format, mlp->offset / 8);
		printf("#define\t%s_INCR 0x%x\n", format, inc);
#endif /* } */
		printf("!\tarray %s @ 0x%x size 0x%x : element size 0x%x\n",
		    format, mlp->offset / 8, mlp->size, inc);
		switch_on_type(mlp, ap->contents, format, level);
#if 0 /* { FIXME: */
		switch (ap->contents->type) {
		case INTRINSIC:
			print_intrinsic(mlp, ap->contents, format, level);
			break;

		case POINTER:
			print_pointer(mlp, ap->contents, format, level);
			break;

		default:
			break;
		}
#endif /* } */
	}
}
示例#2
0
void
asmcheck_do_sou(struct tdesc *tdp, struct node *np)
{
	struct mlist *mlp;
	struct child *chp;
	char *format;

	if (np->format != NULL) {
		char *upper = uc(np->format);

		printf("!	struct/union %s size 0x%x\n", upper, tdp->size);

#if 0 /* { FIXME: */
		{
			int l;
			if ((np->format2 != NULL) &&
			    (l = stabs_log2(tdp->size)) != -1) {
				printf("#define\t%s 0x%x\n", np->format2, l);
			}
		}
#endif /* } */

		free(upper);
	}

	/*
	 * Run thru all the fields of a struct and print them out
	 */
	for (mlp = tdp->data.members.forw; mlp != NULL; mlp = mlp->next) {
		/*
		 * If there's a child list, only print those members.
		 */
		if (np->child != NULL) {
			if (mlp->name == NULL)
				continue;
			chp = find_child(np, mlp->name);
			if (chp == NULL)
				continue;
			format = uc(chp->format);
		} else {
			format = NULL;
		}
		if (mlp->fdesc == NULL)
			continue;
		switch_on_type(mlp, mlp->fdesc, format, 0);
		if (format != NULL)
			free(format);
	}
}
示例#3
0
static void
print_array(struct mlist *mlp, struct tdesc *tdp, char *format, int level)
{
	struct ardef *ap = tdp->data.ardef;
	int items, inc, limit;

	if (level > 0) {
		printf("' noop ' .x");
	} else {
		items = ap->indices->range_end - ap->indices->range_start + 1;
		inc = (mlp->size / items) / 8;
		limit = mlp->size / 8;
		switch_on_type(mlp, ap->contents, format, level + 1);
		printf(" %x %x %x array-field", limit, inc, mlp->offset / 8);
		printf(" %s\n", mlp->name);
	}
}
示例#4
0
void
forth_do_sou(struct tdesc *tdp, struct node *np)
{
	struct mlist *mlp;
	struct child *chp;
	char *format;

	printf("\n");
	printf("vocabulary %s-words\n", np->name);
	printf("h# %x constant %s-sz\n", tdp->size, np->name);
	printf("%x ' %s-words c-struct .%s\n",
		tdp->size, np->name, np->name);
	printf("also %s-words definitions\n\n", np->name);

	/*
	 * Run thru all the fields of a struct and print them out
	 */
	for (mlp = tdp->data.members.back; mlp != NULL; mlp = mlp->prev) {
		/*
		 * If there's a child list, only print those members.
		 */
		if (np->child) {
			if (mlp->name == NULL)
				continue;
			chp = find_child(np, mlp->name);
			if (chp == NULL)
				continue;
			format = chp->format;
		} else
			format = NULL;
		if (mlp->fdesc == NULL)
			continue;
		switch_on_type(mlp, mlp->fdesc, format, 0);
	}
	printf("\nkdbg-words definitions\n");
	printf("previous\n\n");
	printf("\\ end %s section\n\n", np->name);
}
示例#5
0
static void
print_volatile(struct mlist *mlp, struct tdesc *tdp, char *format, int level)
{
	switch_on_type(mlp, tdp->data.tdesc, format, level);
}