[parisc-linux] kdb getting healthier? (PCI guru needed, that's you willy!)

Carlos O'Donell Jr. carlos@baldric.uwo.ca
Thu, 6 Jun 2002 14:57:33 -0400


> > -       table->end = base_addr + end[-1].region_end;

> > +       table->end = base_addr + end[0].region_end - sizeof(struct unwind_table_entry);
> >         table->table = (struct unwind_table_entry *)table_start;
> >         table->length = end - start;
> >         table->next = NULL;
> 
> It's definitely dangerous to use array indexes outside the bounds
> of the array, particularly on the PA.  There can be problems with
> space register selection, although I wouldn't expect this to be a in
> the linux kernel.  You can avoid index insns with "-mdisable-indexing".
> Let me know if you see anything strange in the assembler output.
> 
> Dave

That's what I imagined, but only now do I realize that the fix
is completely wrong (my bad).

It should really be something like:

table->end = base_addr + (&end[0] - sizeof(struct unwind_table_entry))->region_end;

I'm pretty sure that the end[-1] is causing a processor fault. 
Which then causes kdb to kick-in, but the unwind table isn't
built yet so it can't find a matching entry.

If this doesn't work, then how is one supposed to correctly get
the last table entry? :)

 (end == __stop___unwind)

  __start___unwind = .;         /* unwind info */
  .PARISC.unwind : { *(.PARISC.unwind) }
  __stop___unwind = .;

c.