inline comments above
Can se just pick a safer SP value that would work on all systems? Maybe 32 or 64? Some systems might require SP to be aligned to a specific 4, 8 or 16 byte boundary and I am guessing that is what this change is trying to fix. Can we just change the SP value to 64?
Not sure why we have a test that is counting single steps of instructions? Of course they are going to vary. Maybe you can check with the original author and ask why we are doing this? This doesn't seem portable or like a very good thing to test? I would rather see breakpoints being set at source lines and stop before and after and verify that things changed than to have any tests that expect stepping to work in a specific way. All of the different architectures (arm, arm64, i386, x86_64, mips, mips64, hexagon, etc) have front/back ends that produce different DWARF line tables so even trying to make a test that does something like:
are doomed to fail. We should be using breakpoints on file + line in order to test things so they work on all architectures and then the test should look like:
As I understand it, these tests are supposed to verify behaviour of the lldb-server, sans lldb. This means they talk raw gdb-remote protocol over sockets and they don't have access to lldb functionality like parsing dwarf line tables.
Based on my understanding these tests try to verify that the "s" (or the "vCont:s") packet only steps 1 instruction. For architectures where the instruction size is fixed we can compare the PC reported before the step and after the step but it won't work on x86 or with thumb
When sp=1 , for MIPS64 it generate 64 bit invalid address causing process to exit. The solution for above problem was to set sp value greater than stack allocated size in Assembly Prologue. But it will vary from process to process hence not suitable approached. The good approach was to handle SIGBUS signal with si_code=SI_KERENEL for invalid 64 bit address.
The Patch [ http://reviews.llvm.org/D11176 | To handle SI_KERENEL generated for invalid 64 bit address ] handle above mentioned case
Even changing sp to 64 couldn't cause the test case to passed. Since it was generating SIGBUS signal with si_code=SI_KERENEL for invalid 64 bit address. which was not handle.
The Patch [ http://reviews.llvm.org/D11176 | To handle SI_KERENEL generated for invalid 64 bit address ] handle above mentioned case.