summaryrefslogtreecommitdiff
path: root/mdb/debian
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-04-15 11:19:39 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-04-15 11:19:39 +0400
commit8cba210c4b4aa25594001c51b522efa4aeeb5bec (patch)
tree18590e322ee622dc4fdd0ec7e14a4dce0608476a /mdb/debian
parente36288e1759bf8132948febbbff189bdd1f5e2e6 (diff)
downloadillumos-packaging-8cba210c4b4aa25594001c51b522efa4aeeb5bec.tar.gz
mdb: disabled saveargs
Diffstat (limited to 'mdb/debian')
-rw-r--r--mdb/debian/patches/mdb-no-saveargs.patch112
-rw-r--r--mdb/debian/patches/series1
2 files changed, 113 insertions, 0 deletions
diff --git a/mdb/debian/patches/mdb-no-saveargs.patch b/mdb/debian/patches/mdb-no-saveargs.patch
new file mode 100644
index 0000000..dcad0f3
--- /dev/null
+++ b/mdb/debian/patches/mdb-no-saveargs.patch
@@ -0,0 +1,112 @@
+Description: -msave-args is not supported on Dyson
+Index: mdb/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile
+===================================================================
+--- mdb.orig/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile 2014-04-14 18:25:46.082947781 +0400
++++ mdb/usr/src/cmd/mdb/intel/amd64/kmdb/Makefile 2014-04-15 11:00:50.593947463 +0400
+@@ -63,7 +63,6 @@
+
+ STANDUMEM = $(DEB_USRLIBDIR_64)/libstandumem.so
+ STANDLIBS += $(DEB_USRLIBDIR_64)/libstanddisasm.so
+-STANDLIBS += $(ROOT)/usr/lib/amd64/libstandsaveargs.so
+
+ INCDIRS += $(SRC)/uts/i86pc $(SRC)/common/dis/i386
+
+Index: mdb/usr/src/cmd/mdb/intel/amd64/mdb/Makefile
+===================================================================
+--- mdb.orig/usr/src/cmd/mdb/intel/amd64/mdb/Makefile 2014-04-14 19:17:31.339694673 +0400
++++ mdb/usr/src/cmd/mdb/intel/amd64/mdb/Makefile 2014-04-15 11:01:02.243817007 +0400
+@@ -49,6 +49,5 @@
+
+ CPPFLAGS += -I../../mdb
+ CPPFLAGS += -DDEB_USRLIBDIR_64=\"$(DEB_USRLIBDIR_64)\"
+-LDLIBS += -lsaveargs
+
+ install: all $(ROOTPROG64)
+Index: mdb/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c
+===================================================================
+--- mdb.orig/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c 2014-04-08 18:45:39.751064552 +0400
++++ mdb/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c 2014-04-15 11:05:21.441921277 +0400
+@@ -43,8 +43,6 @@
+ #include <mdb/mdb_err.h>
+ #include <mdb/mdb.h>
+
+-#include <saveargs.h>
+-
+ /*
+ * This array is used by the getareg and putareg entry points, and also by our
+ * register variable discipline.
+@@ -231,10 +229,6 @@
+ uintptr_t pc = gsp->kregs[KREG_RIP];
+ uintptr_t lastfp;
+
+- ssize_t size;
+- ssize_t insnsize;
+- uint8_t ins[SAVEARGS_INSN_SEQ_LEN];
+-
+ GElf_Sym s;
+ mdb_syminfo_t sip;
+ mdb_ctf_funcinfo_t mfp;
+@@ -301,62 +295,7 @@
+ argc = 0;
+ }
+
+- /*
+- * The number of instructions to search for argument saving is
+- * limited such that only instructions prior to %pc are
+- * considered such that we never read arguments from a
+- * function where the saving code has not in fact yet
+- * executed.
+- */
+- insnsize = MIN(MIN(s.st_size, SAVEARGS_INSN_SEQ_LEN),
+- pc - s.st_value);
+-
+- if (mdb_tgt_vread(t, ins, insnsize, s.st_value) != insnsize)
+- argc = 0;
+-
+- if ((argc != 0) &&
+- ((args_style = saveargs_has_args(ins, insnsize, argc,
+- start_index)) != SAVEARGS_NO_ARGS)) {
+- /* Up to 6 arguments are passed via registers */
+- reg_argc = MIN((6 - start_index), mfp.mtf_argc);
+- size = reg_argc * sizeof (long);
+-
+- /*
+- * If Studio pushed a structure return address as an
+- * argument, we need to read one more argument than
+- * actually exists (the addr) to make everything line
+- * up.
+- */
+- if (args_style == SAVEARGS_STRUCT_ARGS)
+- size += sizeof (long);
+-
+- if (mdb_tgt_vread(t, fr_argv, size, (fp - size))
+- != size)
+- return (-1); /* errno has been set for us */
+-
+- /*
+- * Arrange the arguments in the right order for
+- * printing.
+- */
+- for (i = 0; i < (reg_argc / 2); i++) {
+- long t = fr_argv[i];
+-
+- fr_argv[i] = fr_argv[reg_argc - i - 1];
+- fr_argv[reg_argc - i - 1] = t;
+- }
+-
+- if (argc > reg_argc) {
+- size = MIN((argc - reg_argc) * sizeof (long),
+- sizeof (fr_argv) -
+- (reg_argc * sizeof (long)));
+-
+- if (mdb_tgt_vread(t, &fr_argv[reg_argc], size,
+- fp + sizeof (fr)) != size)
+- return (-1); /* errno has been set */
+- }
+- } else {
+- argc = 0;
+- }
++ argc = 0;
+
+ if (got_pc && func(arg, pc, argc, fr_argv, &gregs) != 0)
+ break;
diff --git a/mdb/debian/patches/series b/mdb/debian/patches/series
index ecac3d8..1d9bd09 100644
--- a/mdb/debian/patches/series
+++ b/mdb/debian/patches/series
@@ -68,3 +68,4 @@ mdb-genunix-vfs-pointers.patch
mdb-genunix-zone-pointers.patch
mdb-genunix-typegraph-pointers.patch
mdb-genunix-gcore-pointers.patch
+mdb-no-saveargs.patch