Print this page
9210 remove KMDB branch debugging support
9211 ::crregs could do with cr2/cr3 support
9209 ::ttrace should be able to filter by thread
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/intel/kmdb/kvm_isadep.c
          +++ new/usr/src/cmd/mdb/intel/kmdb/kvm_isadep.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + *
       25 + * Copyright 2018 Joyent, Inc.
  24   26   */
  25   27  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   28  /*
  29   29   * isa-dependent portions of the kmdb target
  30   30   */
  31   31  
  32   32  #include <kmdb/kvm.h>
  33      -#include <kmdb/kvm_cpu.h>
  34   33  #include <kmdb/kmdb_kdi.h>
  35   34  #include <kmdb/kmdb_asmutil.h>
  36   35  #include <mdb/mdb_debug.h>
  37   36  #include <mdb/mdb_err.h>
  38   37  #include <mdb/mdb_list.h>
  39   38  #include <mdb/mdb_target_impl.h>
  40   39  #include <mdb/mdb_isautil.h>
  41   40  #include <mdb/mdb_kreg_impl.h>
  42   41  #include <mdb/mdb.h>
  43   42  
↓ open down ↓ 50 lines elided ↑ open up ↑
  94   93          if (mdb_tgt_vread(t, &instr, sizeof (mdb_instr_t), pc) !=
  95   94              sizeof (mdb_instr_t))
  96   95                  return (-1); /* errno is set for us */
  97   96  
  98   97          if (!kmt_step_out_validate(t, pc))
  99   98                  return (set_errno(EMDB_TGTNOTSUP));
 100   99  
 101  100          return (mdb_isa_step_out(t, p, pc, fp, sp, instr));
 102  101  }
 103  102  
 104      -int
 105      -kmt_step_branch(mdb_tgt_t *t)
 106      -{
 107      -        kmt_data_t *kmt = t->t_data;
 108      -
 109      -        return (kmt_cpu_step_branch(t, kmt->kmt_cpu));
 110      -}
 111      -
 112  103  /*
 113  104   * Return the address of the next instruction following a call, or return -1
 114  105   * and set errno to EAGAIN if the target should just single-step.
 115  106   */
 116  107  int
 117  108  kmt_next(mdb_tgt_t *t, uintptr_t *p)
 118  109  {
 119  110          kreg_t pc;
 120  111          mdb_instr_t instr;
 121  112  
↓ open down ↓ 227 lines elided ↑ open up ↑
 349  340          val = kmt_numarg(argv);
 350  341  
 351  342          if (kmt_rwmsr(addr, &val, wrmsr)) {
 352  343                  warn("wrmsr failed");
 353  344                  return (DCMD_ERR);
 354  345          }
 355  346  
 356  347          return (DCMD_OK);
 357  348  }
 358  349  
 359      -int
 360      -kmt_msr_validate(const kdi_msr_t *msr)
 361      -{
 362      -        uint64_t val;
 363      -
 364      -        for (/* */; msr->msr_num != 0; msr++) {
 365      -                if (kmt_rwmsr(msr->msr_num, &val, rdmsr) < 0)
 366      -                        return (0);
 367      -        }
 368      -
 369      -        return (1);
 370      -}
 371      -
 372  350  /*ARGSUSED*/
 373  351  ssize_t
 374  352  kmt_write(mdb_tgt_t *t, const void *buf, size_t nbytes, uintptr_t addr)
 375  353  {
 376  354          if (!(t->t_flags & MDB_TGT_F_ALLOWIO) &&
 377  355              (nbytes = kmdb_kdi_range_is_nontoxic(addr, nbytes, 1)) == 0)
 378  356                  return (set_errno(EMDB_NOMAP));
 379  357  
 380  358          /*
 381  359           * No writes to user space are allowed.  If we were to allow it, we'd
↓ open down ↓ 237 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX