Re: [rfa] Mips heuristic_proc_desc vs. the stack pointer.

Andrew Cagney
2001-11-19T21:30:40Z

> As HJ noticed, we try to read the stack pointer in heuristic_proc_desc. I'm
> not sure why this normally works and fails with linuxthread support, but I'm
> convinced it's sometimes wrong. If we are called from after_prologue(), the
> stack pointer has nothing to do with the function we're trying to generate a
> desc for. We shouldn't try to read it in this case. The uses of it in
> *_heuristic_proc_desc are harmless.

Regarding the threads, are you saying things still sometimes break with
your patch applied? I suspect there was the usual GDB internal thread
coherency problem where different parts of GDB were debugging different
threads.

> Is this OK, Andrew?

Yes, but can you please adjust the following before committing:

> * mips-tdep.c (find_proc_desc): Add read_sp argument. Update all
> callers.

Given the updates were not identical / mechanical, could you please list
each making it clear that after_prologue() was the exception.

Can you please add a comment to after_prologue() explaining why the SP
shouldn't be fetched in that case.

Can the argument be called read_sp_p (say?) rather than read_sp. There
is a global function read_sp that is hiding behind that variable.

> (heuristic_proc_desc): Likewise. Do not read SP if read_sp == 0.

enjoy, Andrew