Print this page
OS-3417 lx brand: need /dev/log to be a Unix domain socket (DEBUG build)
OS-3419 lx brand: "mdb -p [pid]" fails

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/mdb/mdb_main.c
          +++ new/usr/src/cmd/mdb/common/mdb/mdb_main.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   * Copyright 2012, Josef 'Jeff' Sipek <jeffpc@31bits.net>. All rights reserved.
  25   25   */
  26   26  
  27   27  /*
  28      - * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
       28 + * Copyright (c) 2014, Joyent, Inc.  All rights reserved.
  29   29   */
  30   30  
  31   31  #include <sys/types.h>
  32   32  #include <sys/mman.h>
  33   33  #include <sys/priocntl.h>
  34   34  #include <sys/rtpriocntl.h>
  35   35  #include <sys/resource.h>
  36   36  #include <sys/termios.h>
  37   37  #include <sys/param.h>
  38   38  #include <sys/regset.h>
↓ open down ↓ 5 lines elided ↑ open up ↑
  44   44  #include <libscf.h>
  45   45  #include <alloca.h>
  46   46  #include <unistd.h>
  47   47  #include <string.h>
  48   48  #include <stdlib.h>
  49   49  #include <fcntl.h>
  50   50  #include <dlfcn.h>
  51   51  #include <libctf.h>
  52   52  #include <errno.h>
  53   53  #include <kvm.h>
       54 +#include <zone.h>
  54   55  
  55   56  #include <mdb/mdb_lex.h>
  56   57  #include <mdb/mdb_debug.h>
  57   58  #include <mdb/mdb_signal.h>
  58   59  #include <mdb/mdb_string.h>
  59   60  #include <mdb/mdb_modapi.h>
  60   61  #include <mdb/mdb_target.h>
  61   62  #include <mdb/mdb_gelf.h>
  62   63  #include <mdb/mdb_conf.h>
  63   64  #include <mdb/mdb_err.h>
↓ open down ↓ 726 lines elided ↑ open up ↑
 790  791                          warn("-p may not be used with other arguments\n");
 791  792                          terminate(2);
 792  793                  }
 793  794                  if (proc_arg_psinfo(pidarg, PR_ARG_PIDS, NULL, &status) == -1) {
 794  795                          die("cannot attach to %s: %s\n",
 795  796                              pidarg, Pgrab_error(status));
 796  797                  }
 797  798                  if (strchr(pidarg, '/') != NULL)
 798  799                          (void) mdb_iob_snprintf(object, MAXPATHLEN,
 799  800                              "%s/object/a.out", pidarg);
 800      -                else
      801 +                else {
      802 +                        const char *root;
      803 +
 801  804                          (void) mdb_iob_snprintf(object, MAXPATHLEN,
 802      -                            "/proc/%s/object/a.out", pidarg);
      805 +                            "%s/proc/%s/object/a.out",
      806 +                            (root = zone_get_nroot()) != NULL ? root : "",
      807 +                            pidarg);
      808 +                }
      809 +
 803  810                  tgt_argv[tgt_argc++] = object;
 804  811                  tgt_argv[tgt_argc++] = pidarg;
 805  812          }
 806  813  
 807  814          /*
 808  815           * Find the first argument that is not a special "-" token.  If one is
 809  816           * found, we will examine this file and make some inferences below.
 810  817           */
 811  818          for (c = 0; c < tgt_argc && strcmp(tgt_argv[c], "-") == 0; c++)
 812  819                  continue;
↓ open down ↓ 333 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX