https://bugs.kde.org/show_bug.cgi?id=509406

--- Comment #5 from Paul Floyd <[email protected]> ---
I just looked at the gdbserver failures. In 2 of the cases (and probably the
third, just not in the diffs) there is an assert firing.

How this is supposed to work:

invoker_invoke_gdbserver uses ptrace to modify the running Valgrind tool
execution context. For arm64 the relevant bit is

      reg_mod.x[0] = check;
      reg_mod.sp = sp;
      reg_mod.elr = shared64->invoke_gdbserver;
      /* put NULL return address in Link Register */
      reg_mod.lr = bad_return;

So that's setting up the stack pointer, program counter (same as exception link
register, dunno why), a phoney return address (s'pose the code wil get back via
longjmp hyperspace) and in the x0 register the value of 'check', 0x8BADF00D.

On the other side, void VG_(invoke_gdbserver) ( int check ) contains

   vg_assert (check == 0x8BADF00D);

and that assert is failing. If I just comment out the assert then all the
gdbserver tests pass on arm64.

I did a printf of the value of 'check' and it was 4.

There are only two things that I can see as possibilities. 

1.    if (ptrace(PT_SETREGS, pid, (caddr_t)regs, 0) < 0) {
^^^ if this has changed in some way in FreeBSD 15. I need to run the tests with
-d to get traces for that.

2. Some compiler oddity at the receiving end. What I might be able to do there
is to put a sleep in the code and then attach gdb to try to see what is
happening.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to