unsigned int referencep : 1;
/* Whether this is in the local type block. */
unsigned int localp : 1;
+ /* If this is not local, whether a reference to this type should be
+ local. */
+ unsigned reflocalp : 1;
/* Whether this is a duplicate struct definition which we are
ignoring. */
unsigned int ignorep : 1;
return true;
}
-/* Make a pointer type. */
+/* Make a pointer type. The HP debugger seems to sometimes get
+ confused by global pointers to global pointers. Therefore, we mark
+ all pointers as reflocalp, so that references to global pointers are
+ forced to be local. This is probably less efficient than possible. */
static boolean
ieee_pointer_type (p)
unsigned int indx;
struct ieee_modified_type *m = NULL;
- localp = info->type_stack->type.localp;
+ localp = info->type_stack->type.localp || info->type_stack->type.reflocalp;
indx = ieee_pop_type (info);
/* A pointer to a simple builtin type can be obtained by adding 32.
FIXME: Will this be a short pointer, and will that matter? */
if (indx < 32)
- return ieee_push_type (info, indx + 32, 0, true, false);
+ {
+ if (! ieee_push_type (info, indx + 32, 0, true, false))
+ return false;
+ /* I don't think we need to set reflocalp for this case. */
+ return true;
+ }
if (! localp)
{
/* FIXME: The size should depend upon the architecture. */
if (m->pointer > 0)
- return ieee_push_type (info, m->pointer, 4, true, false);
+ {
+ if (! ieee_push_type (info, m->pointer, 4, true, false))
+ return false;
+ info->type_stack->type.reflocalp = true;
+ return true;
+ }
}
if (! ieee_define_type (info, 4, true, localp)
if (! localp)
m->pointer = info->type_stack->type.indx;
+ info->type_stack->type.reflocalp = true;
+
return true;
}
args = (unsigned int *) xmalloc (argcount * sizeof *args);
for (i = argcount - 1; i >= 0; i--)
{
- if (info->type_stack->type.localp)
+ if (info->type_stack->type.localp
+ || info->type_stack->type.reflocalp)
localp = true;
args[i] = ieee_pop_type (info);
}
else if (argcount < 0)
varargs = false;
- if (info->type_stack->type.localp)
+ if (info->type_stack->type.localp || info->type_stack->type.reflocalp)
localp = true;
retindx = ieee_pop_type (info);
size = info->type_stack->type.size;
unsignedp = info->type_stack->type.unsignedp;
- localp = info->type_stack->type.localp;
+ localp = info->type_stack->type.localp || info->type_stack->type.reflocalp;
ieee_pop_unused_type (info);
return (ieee_define_type (info, size, unsignedp, localp)
&& ieee_write_number (info, 'R')
/* IEEE does not store the range, so we just ignore it. */
ieee_pop_unused_type (info);
- localp = info->type_stack->type.localp;
+ localp = info->type_stack->type.localp || info->type_stack->type.reflocalp;
eleindx = ieee_pop_type (info);
if (! localp)
boolean localp;
unsigned int eleindx;
- localp = info->type_stack->type.localp;
+ localp = info->type_stack->type.localp || info->type_stack->type.reflocalp;
eleindx = ieee_pop_type (info);
/* FIXME: We don't know the size, so we just use 4. */
size = info->type_stack->type.size;
unsignedp = info->type_stack->type.unsignedp;
- localp = info->type_stack->type.localp;
+ localp = info->type_stack->type.localp || info->type_stack->type.reflocalp;
indx = ieee_pop_type (info);
if (! localp)
size = info->type_stack->type.size;
unsignedp = info->type_stack->type.unsignedp;
- localp = info->type_stack->type.localp;
+ localp = info->type_stack->type.localp || info->type_stack->type.reflocalp;
indx = ieee_pop_type (info);
if (! localp)
size = info->type_stack->type.size;
unsignedp = info->type_stack->type.unsignedp;
referencep = info->type_stack->type.referencep;
- localp = info->type_stack->type.localp;
+ localp = info->type_stack->type.localp || info->type_stack->type.reflocalp;
indx = ieee_pop_type (info);
if (localp)
&& ! ieee_buffer_emptyp (&info->type_stack->next->type.strdef));
bname = info->type_stack->type.name;
- localp = info->type_stack->type.localp;
+ localp = info->type_stack->type.localp || info->type_stack->type.reflocalp;
bindx = ieee_pop_type (info);
/* We are currently defining both a struct and a class. We must