Re: How to avoid stepping inside libpthread

Daniel Jacobowitz
2007-07-12T11:10:28Z

On Thu, Jul 12, 2007 at 03:30:49PM +0900, Atsushi Nemoto wrote:
> + /* Assume that there is at most one branch in the atomic
> + sequence. If a branch is found, put a breakpoint in its
> + destination address. */
> + branch_bp = mips_next_pc (loc);
> + if (branch_bp != loc + MIPS_INSN32_SIZE)

That's not what you want to do. mips_next_pc decides based on the
current registers whether each branch is taken or not taken, so this
will not detect untaken branches (and it's got the wrong set of
registers, since loc != current pc). I think we'll have to make
mips_next_pc return whether a control flow changing instruction was
found. Possibly whether an acceptable branch was found, to avoid
subroutine calls, if that's going to be a problem.

--
Daniel Jacobowitz
CodeSourcery