summaryrefslogtreecommitdiff
path: root/libproc/debian/patches/libproc-no-saveargs.patch
blob: 523a1ee569a9d67bbe49bb69faf965785a5fda41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Description: Dyson does not support -msave-args
Index: libproc/usr/src/lib/libproc/amd64/Makefile
===================================================================
--- libproc.orig/usr/src/lib/libproc/amd64/Makefile	2014-03-01 16:18:16.000000000 +0400
+++ libproc/usr/src/lib/libproc/amd64/Makefile	2014-04-07 17:58:23.306646905 +0400
@@ -30,6 +30,5 @@
 include ../../Makefile.lib.64
 
 CPPFLAGS += -D_SYSCALL32
-LDLIBS += -lsaveargs
 
 install: all $(ROOTLIBS64) $(ROOTLINKS64)
Index: libproc/usr/src/lib/libproc/amd64/Pisadep.c
===================================================================
--- libproc.orig/usr/src/lib/libproc/amd64/Pisadep.c	2014-03-01 16:18:16.000000000 +0400
+++ libproc/usr/src/lib/libproc/amd64/Pisadep.c	2014-04-07 18:05:02.991093668 +0400
@@ -36,7 +36,6 @@
 #include <errno.h>
 #include <string.h>
 
-#include <saveargs.h>
 #include "Pcontrol.h"
 #include "Pstack.h"
 
@@ -359,7 +358,6 @@
 	ctf_file_t *ctfp = NULL;
 	ctf_funcinfo_t finfo;
 	prsyminfo_t si = {0};
-	uint8_t ins[SAVEARGS_INSN_SEQ_LEN];
 	size_t insnsize;
 	int argc = 0;
 	int rettype = 0;
@@ -411,56 +409,7 @@
 			return (0);
 	}
 
-	/*
-	 * The number of instructions to search for argument saving is limited
-	 * such that only instructions prior to %pc are considered and we
-	 * never read arguments from a function where the saving code has not
-	 * in fact yet executed.
-	 */
-	insnsize = MIN(MIN(sym.st_size, SAVEARGS_INSN_SEQ_LEN),
-	    pc - sym.st_value);
-
-	if (Pread(P, ins, insnsize, sym.st_value) != insnsize)
-		return (0);
-
-	if ((argc != 0) &&
-	    ((args_style = saveargs_has_args(ins, insnsize, argc,
-	    start_index)) != SAVEARGS_NO_ARGS)) {
-		int regargs = MIN((6 - start_index), argc);
-		size_t size = regargs * sizeof (long);
-		int i;
-
-		/*
-		 * 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 (Pread(P, args, size, (fp - size)) != size)
-			return (0);
-
-		for (i = 0; i < (regargs / 2); i++) {
-			prgreg_t t = args[i];
-
-			args[i] = args[regargs - i - 1];
-			args[regargs - i - 1] = t;
-		}
-
-		if (argc > regargs) {
-			size = MIN((argc - regargs) * sizeof (long),
-			    argsize - (regargs * sizeof (long)));
-
-			if (Pread(P, &args[regargs], size, fp +
-			    (sizeof (uintptr_t) * 2)) != size)
-				return (6);
-		}
-
-		return (argc);
-	} else {
-		return (0);
-	}
+	return (0);
 }
 
 int