]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Update FreeBSD (f)stat tests for FreeBSD 13.1
authorPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 19 May 2022 17:52:57 +0000 (19:52 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 19 May 2022 17:52:57 +0000 (19:52 +0200)
commit6b7cd3b4e40d01073a86e716dac7b4e2e1dba25a
tree9d3c67d898fe3c2dc8b0270e19ff70e0a5f96a9b
parentf6316d1b68c85af2eecfef5ee0a62fff8a8d8954
Update FreeBSD (f)stat tests for FreeBSD 13.1

Somewhat annoyingly, libc is using tail call optimization
which alters our callstacks.

FreeBSD 13 and earlier had something like

{compatibility API check}
  1372e0:       48 8d 95 08 fe ff ff    lea    -0x1f8(%rbp),%rdx
  1372e7:       bf 8d 01 00 00          mov    $0x18d,%edi
  1372ec:       44 89 f6                mov    %r14d,%esi
  1372ef:       31 c0                   xor    %eax,%eax
  1372f1:       e8 8a c5 09 00          call   1d3880 <syscall@plt>

{compatibility API check}
  1342b9:       3d 9f 4f 12 00          cmp    $0x124f9f,%eax
  1342be:       7c 25                   jl     1342e5 <_fstatfs+0x55>
  1342c0:       49 8b 07                mov    (%r15),%rax
  1342c3:       48 3b 45 e0             cmp    -0x20(%rbp),%rax
  1342c7:       0f 85 51 01 00 00       jne    13441e <_fstatfs+0x18e>

{compatibility not needed}
  1342cd:       44 89 f7                mov    %r14d,%edi
  1342d0:       48 89 de                mov    %rbx,%rsi
  1342d3:       48 81 c4 e8 01 00 00    add    $0x1e8,%rsp
  1342da:       5b                      pop    %rbx
  1342db:       41 5e                   pop    %r14
  1342dd:       41 5f                   pop    %r15
  1342df:       5d                      pop    %rbp

{tail call optimization}

  1342e0:       e9 bb a0 09 00          jmp    1ce3a0 <__sys_fstatfs@plt>

{compatibility API call}

So I've updated the expecteds and added a filter for 13.0 and older.
memcheck/tests/freebsd/Makefile.am
memcheck/tests/freebsd/filter_fstat [new file with mode: 0755]
memcheck/tests/freebsd/stat.stderr.exp
memcheck/tests/freebsd/stat.vgtest
memcheck/tests/freebsd/statfs.stderr.exp
memcheck/tests/freebsd/statfs.vgtest