Print this page
patch fix-lint

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdisasm/common/dis_i386.c
          +++ new/usr/src/lib/libdisasm/common/dis_i386.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   * Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
       26 + * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  26   27   */
  27   28  
  28   29  #include <libdisasm.h>
  29      -#include <stdlib.h>
  30      -#include <stdio.h>
  31   30  
  32   31  #include "dis_tables.h"
  33   32  #include "libdisasm_impl.h"
  34   33  
  35   34  typedef struct dis_handle_i386 {
  36   35          int             dhx_mode;
  37   36          dis86_t         dhx_dis;
  38   37          uint64_t        dhx_end;
  39   38  } dis_handle_i386_t;
  40   39  
↓ open down ↓ 78 lines elided ↑ open up ↑
 119  118          if (dhp->dh_flags & DIS_X86_SIZE16)
 120  119                  dhx->dhx_mode = SIZE16;
 121  120          else if (dhp->dh_flags & DIS_X86_SIZE64)
 122  121                  dhx->dhx_mode = SIZE64;
 123  122          else
 124  123                  dhx->dhx_mode = SIZE32;
 125  124  
 126  125          if (dhp->dh_flags & DIS_OCTAL)
 127  126                  dhx->dhx_dis.d86_flags = DIS_F_OCTAL;
 128  127  
 129      -        dhx->dhx_dis.d86_sprintf_func = snprintf;
      128 +        dhx->dhx_dis.d86_sprintf_func = dis_snprintf;
 130  129          dhx->dhx_dis.d86_get_byte = get_byte;
 131  130          dhx->dhx_dis.d86_sym_lookup = do_lookup;
 132  131          dhx->dhx_dis.d86_check_func = check_func;
 133  132  
 134  133          dhx->dhx_dis.d86_data = dhp;
 135  134  
 136  135          return (0);
 137  136  }
 138  137  
 139  138  static int
↓ open down ↓ 26 lines elided ↑ open up ↑
 166  165          return (15);
 167  166  }
 168  167  
 169  168  /* ARGSUSED */
 170  169  static int
 171  170  dis_i386_min_instrlen(dis_handle_t *dhp)
 172  171  {
 173  172          return (1);
 174  173  }
 175  174  
 176      -#define MIN(a, b)       ((a) < (b) ? (a) : (b))
 177      -
 178  175  /*
 179  176   * Return the previous instruction.  On x86, we have no choice except to
 180  177   * disassemble everything from the start of the symbol, and stop when we have
 181  178   * reached our instruction address.  If we're not in the middle of a known
 182  179   * symbol, then we return the same address to indicate failure.
 183  180   */
 184  181  static uint64_t
 185  182  dis_i386_previnstr(dis_handle_t *dhp, uint64_t pc, int n)
 186  183  {
 187  184          uint64_t *hist, addr, start;
↓ open down ↓ 72 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX