LCOV - code coverage report
Current view: top level - strace_git/linux/x86_64 - get_error.c (source / functions) Hit Total Coverage
Test: strace-4.16.0.69.f1ea-dirty Code Coverage Lines: 9 9 100.0 %
Date: 2017-03-18 00:38:52 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 6 6 100.0 %

           Branch data     Line data    Source code
       1                 :            : static void
       2                 :   11655995 : get_error(struct tcb *tcp, const bool check_errno)
       3                 :            : {
       4                 :            :         /*
       5                 :            :          * In X32, return value is 64-bit (llseek uses one).
       6                 :            :          * Using merely "long rax" would not work.
       7                 :            :          */
       8                 :            :         long long rax;
       9                 :            : 
      10         [ +  + ]:   11655995 :         if (x86_io.iov_len == sizeof(i386_regs)) {
      11                 :            :                 /* Sign extend from 32 bits */
      12                 :     102994 :                 rax = (int32_t) i386_regs.eax;
      13                 :            :         } else {
      14                 :   11553001 :                 rax = x86_64_regs.rax;
      15                 :            :         }
      16                 :            : 
      17 [ +  + ][ +  + ]:   11655995 :         if (check_errno && is_negated_errno(rax)) {
      18                 :     259141 :                 tcp->u_rval = -1;
      19                 :     259141 :                 tcp->u_error = -rax;
      20                 :            :         } else {
      21                 :   11396854 :                 tcp->u_rval = rax;
      22                 :            :         }
      23                 :   11655995 : }

Generated by: LCOV version 1.12