{"push_id":1078987248,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"4a7e075c3fdb862d1a9632fc3500c6e5111013fc","before":"5b061e98860ad84315704c732a1a43525f494946","commits":[{"sha":"4a7e075c3fdb862d1a9632fc3500c6e5111013fc","author":{"email":"82697eede7783c80d18ae8c0d02575d32c9ac359@linaro.org","name":"Yao Qi"},"message":"Tweak gdb.reverse/step-precsave.exp and gdb.reverse/step-reverse.exp\n\nI see the following test fail in arm-linux with -marm and -fomit-frame-pointer,\n\n step\n callee () at /home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.reverse/step-reverse.c:27\n 27      }                       /* RETURN FROM CALLEE */\n (gdb) step\n main () at /home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.reverse/step-reverse.c:58\n 58         callee();    /* STEP INTO THIS CALL */\n (gdb) FAIL: gdb.reverse/step-precsave.exp: reverse step into fn call\n\nAs we can see, the \"step\" has already stepped into the function callee,\nbut in the last line.  The second \"step\" attempts to step to function\nbody, but it goes out of callee, which isn't expected.\n\nThe program is compiled with -marm and -fomit-frame-pointer, the\nfunction callee is prologue-less, because nothing needs to be saved\non stack,\n\n(gdb) disassemble callee\nDump of assembler code for function callee:\n   0x00010680 <+0>:\tmovw\tr3, #2364\t; 0x93c\n   0x00010684 <+4>:\tmovt\tr3, #2\n   0x00010688 <+8>:\tldr\tr3, [r3]\n   0x0001068c <+12>:\tadd\tr2, r3, #1\n   0x00010690 <+16>:\tmovw\tr3, #2364\t; 0x93c\n   0x00010694 <+20>:\tmovt\tr3, #2\n   0x00010698 <+24>:\tstr\tr2, [r3]\n   0x0001069c <+28>:\tmov\tr3, #0\n   0x000106a0 <+32>:\tmov\tr0, r3\n   0x000106a4 <+36>:\tbx\tlr\n\nprogram stops at the 0x106a0 (passed the epilogue) after the first\n\"step\".  When second \"step\" is executed, the stepping range is\n[0x10680-0x106a0], which starts from the first instruction of function\ncallee (because it doesn't have prologue).\n\ninfrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [LWP 2461] at 0x1069c^M\ninfrun: prepare_to_wait^M\ninfrun: target_wait (-1.0.0, status) =^M\ninfrun:   2461.2461.0 [LWP 2461],^M\ninfrun:   status->kind = stopped, signal = GDB_SIGNAL_TRAP^M\ninfrun: TARGET_WAITKIND_STOPPED^M\ninfrun: stop_pc = 0x10698^M\ninfrun: stepping inside range [0x10680-0x106a0]\n\nWhen program goes out of the range, it stops at the caller of callee,\nand test fails.  IOW, if function callee has prologue, the stepping\nrange won't start from the first instruction of the function, and\nprogram stops at the prologue and test passes.\n\nIMO, GDB does nothing wrong, but test shouldn't expect the program\nstops in callee after the second \"step\".  I decide to fix test rather\nthan GDB.  In this patch, I change to test to do one \"step\", and check\nthe program is still in callee, then, do multiple \"step\" until program\ngoes out of the callee.\n\ngdb/testsuite:\n\n2016-04-22  Yao Qi  <yao.qi@linaro.org>\n\n\t* gdb.reverse/step-precsave.exp: Do one step and test program\n\tstops in \"callee\" and do multiple steps until program goes out\n\tof \"callee\".\n\t* gdb.reverse/step-reverse.exp: Likewise.","distinct":true,"url":"https://api.github.com/repos/wallento/binutils-gdb/commits/4a7e075c3fdb862d1a9632fc3500c6e5111013fc"}]}