From: "Edgar E. Iglesias" <[email protected]>

When singlestepping over BEQ issuing a compare between
a single register (i.e a branch always), only follow the
branch path.

This catches the case for functions that end with loops
and avoids us putting breakpoints at the begining of the
next function (where there likely already is a bp).

Signed-off-by: Edgar E. Iglesias <[email protected]>
---
 sysdeps/linux-gnu/mipsel/trace.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/sysdeps/linux-gnu/mipsel/trace.c b/sysdeps/linux-gnu/mipsel/trace.c
index a8a680a..8094fb7 100644
--- a/sysdeps/linux-gnu/mipsel/trace.c
+++ b/sysdeps/linux-gnu/mipsel/trace.c
@@ -201,8 +201,16 @@ int mips_next_pcs(struct Process *proc, uint32_t pc, 
uint32_t *newpc)
                        /* Upper four bits get never changed...  */
                        newpc[nr++] = rx + ((pc + 4) & ~0x0fffffff);
                        break;
+               case 4: /* BEQ  */
+                       if (itype_rs(inst) == itype_rt(inst)) {
+                               /* Compare the same reg for equality, always
+                                * follow the branch.  */
+                               newpc[nr++] = pc + 4 +
+                                       mips32_relative_offset(inst);
+                               break;
+                       }
+                       /* Fall through.  */
                default:
-               case 4:
                case 5:
                case 6:
                case 7:
-- 
1.7.8.6


_______________________________________________
Ltrace-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/ltrace-devel

Reply via email to