LCOV - code coverage report
Current view: top level - backends - mips_regs.c (source / functions) Hit Total Coverage
Test: elfutils-0.191 Lines: 0 43 0.0 %
Date: 2024-04-17 19:42:11 Functions: 0 1 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 25 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* Register names and numbers for mips DWARF.
       2                 :            :    Copyright (C) 2006 Red Hat, Inc.
       3                 :            :    Copyright (C) 2024 CIP United Inc.
       4                 :            :    This file is part of elfutils.
       5                 :            : 
       6                 :            :    This file is free software; you can redistribute it and/or modify
       7                 :            :    it under the terms of either
       8                 :            : 
       9                 :            :      * the GNU Lesser General Public License as published by the Free
      10                 :            :        Software Foundation; either version 3 of the License, or (at
      11                 :            :        your option) any later version
      12                 :            : 
      13                 :            :    or
      14                 :            : 
      15                 :            :      * the GNU General Public License as published by the Free
      16                 :            :        Software Foundation; either version 2 of the License, or (at
      17                 :            :        your option) any later version
      18                 :            : 
      19                 :            :    or both in parallel, as here.
      20                 :            : 
      21                 :            :    elfutils is distributed in the hope that it will be useful, but
      22                 :            :    WITHOUT ANY WARRANTY; without even the implied warranty of
      23                 :            :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      24                 :            :    General Public License for more details.
      25                 :            : 
      26                 :            :    You should have received copies of the GNU General Public License and
      27                 :            :    the GNU Lesser General Public License along with this program.  If
      28                 :            :    not, see <http://www.gnu.org/licenses/>.  */
      29                 :            : 
      30                 :            : #ifdef HAVE_CONFIG_H
      31                 :            : # include <config.h>
      32                 :            : #endif
      33                 :            : 
      34                 :            : #include <assert.h>
      35                 :            : #include <dwarf.h>
      36                 :            : #include <string.h>
      37                 :            : 
      38                 :            : #define BACKEND mips_
      39                 :            : #include "libebl_CPU.h"
      40                 :            : #include <system.h>
      41                 :            : ssize_t
      42                 :          0 : mips_register_info (Ebl *ebl __attribute__ ((unused)),
      43                 :            :                       int regno, char *name, size_t namelen,
      44                 :            :                       const char **prefix, const char **setname,
      45                 :            :                       int *bits, int *type)
      46                 :            : {
      47         [ #  # ]:          0 :   if (name == NULL)
      48                 :            :     return 72;
      49                 :            : 
      50         [ #  # ]:          0 :   if (regno < 0 || regno > 71 || namelen < 4)
      51                 :            :     return -1;
      52                 :            : 
      53                 :          0 :   *prefix = "$";
      54         [ #  # ]:          0 :   if (regno < 38)
      55                 :            :     {
      56                 :          0 :       *setname = "integer";
      57                 :          0 :       *type = DW_ATE_signed;
      58                 :          0 :       *bits = 32;
      59                 :            :     }
      60                 :            :   else
      61                 :            :     {
      62                 :          0 :       *setname = "FPU";
      63                 :          0 :       *type = DW_ATE_float;
      64                 :          0 :       *bits = 64;
      65                 :            :     }
      66                 :            : 
      67         [ #  # ]:          0 :   if (regno < 32)
      68                 :            :     {
      69         [ #  # ]:          0 :       if (regno < 10)
      70                 :            :         {
      71                 :          0 :           name[0] = regno + '0';
      72                 :          0 :           namelen = 1;
      73                 :            :         }
      74                 :            :       else
      75                 :            :         {
      76                 :          0 :           name[0] = (regno / 10) + '0';
      77                 :          0 :           name[1] = (regno % 10) + '0';
      78                 :          0 :           namelen = 2;
      79                 :            :         }
      80         [ #  # ]:          0 :       if (regno == 28 || regno == 29 || regno == 31)
      81                 :          0 :         *type = DW_ATE_address;
      82                 :            :     }
      83   [ #  #  #  #  :          0 :   else if (regno == 32)
                #  #  # ]
      84                 :            :     {
      85                 :          0 :       return stpcpy (name, "lo") + 1 - name;
      86                 :            :     }
      87                 :            :   else if (regno == 33)
      88                 :            :     {
      89                 :          0 :       return stpcpy (name, "hi") + 1 - name;
      90                 :            :     }
      91                 :            :   else if (regno == 34)
      92                 :            :     {
      93                 :          0 :       return stpcpy (name, "pc") + 1 - name;
      94                 :            :     }
      95                 :            :   else if (regno == 35)
      96                 :            :     {
      97                 :          0 :       *type = DW_ATE_address;
      98                 :          0 :       return stpcpy (name, "bad") + 1 - name;
      99                 :            :     }
     100                 :            :   else if (regno == 36)
     101                 :            :     {
     102                 :          0 :       return stpcpy (name, "sr") + 1 - name;
     103                 :            :     }
     104                 :            :   else if (regno == 37)
     105                 :            :     {
     106                 :          0 :       *type = DW_ATE_address;
     107                 :          0 :       return stpcpy (name, "cause") + 1 - name;
     108                 :            :     }
     109         [ #  # ]:          0 :   else if (regno < 70)
     110                 :            :     {
     111                 :          0 :       name[0] = 'f';
     112         [ #  # ]:          0 :       if (regno < 38 + 10)
     113                 :            :       {
     114                 :          0 :         name[1] = (regno - 38) + '0';
     115                 :          0 :         namelen = 2;
     116                 :            :       }
     117                 :            :       else
     118                 :            :       {
     119                 :          0 :         name[1] = (regno - 38) / 10 + '0';
     120                 :          0 :         name[2] = (regno - 38) % 10 + '0';
     121                 :          0 :         namelen = 3;
     122                 :            :       }
     123                 :            :     }
     124         [ #  # ]:          0 :   else if (regno == 70)
     125                 :            :     {
     126                 :          0 :       return stpcpy (name, "fsr") + 1 - name;
     127                 :            :     }
     128                 :          0 :   else if (regno == 71)
     129                 :            :     {
     130                 :          0 :       return stpcpy (name, "fir") + 1 - name;
     131                 :            :     }
     132                 :            : 
     133                 :          0 :   name[namelen++] = '\0';
     134                 :          0 :   return namelen;
     135                 :            : }

Generated by: LCOV version 1.16