LCOV - code coverage report
Current view: top level - strace/linux/x86_64 - get_error.c (source / functions) Hit Total Coverage
Test: strace-4.18.0.129.97bbb Code Coverage Lines: 9 9 100.0 %
Date: 2017-07-31 03:46:08 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                 :            : #include "negated_errno.h"
       2                 :            : 
       3                 :            : static void
       4                 :     447626 : get_error(struct tcb *tcp, const bool check_errno)
       5                 :            : {
       6                 :            :         /*
       7                 :            :          * In X32, return value is 64-bit (llseek uses one).
       8                 :            :          * Using merely "long rax" would not work.
       9                 :            :          */
      10                 :            :         long long rax;
      11                 :            : 
      12         [ +  + ]:     447626 :         if (x86_io.iov_len == sizeof(i386_regs)) {
      13                 :            :                 /* Sign extend from 32 bits */
      14                 :     198220 :                 rax = (int32_t) i386_regs.eax;
      15                 :            :         } else {
      16                 :     249406 :                 rax = x86_64_regs.rax;
      17                 :            :         }
      18                 :            : 
      19 [ +  + ][ +  + ]:     895077 :         if (check_errno && is_negated_errno(rax)) {
      20                 :     205542 :                 tcp->u_rval = -1;
      21                 :     205542 :                 tcp->u_error = -rax;
      22                 :            :         } else {
      23                 :     242084 :                 tcp->u_rval = rax;
      24                 :            :         }
      25                 :     447626 : }

Generated by: LCOV version 1.11