author | John Beck <John.Beck@Oracle.COM> |
Thu, 22 May 2014 14:36:47 -0700 | |
changeset 1914 | 00e8dbcb9b1e |
parent 896 | 50be262e44f7 |
child 1954 | 32663e59626d |
permissions | -rw-r--r-- |
1914
00e8dbcb9b1e
PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
896
diff
changeset
|
1 |
--- Python-2.7.6/Makefile.pre.in.~3~ 2014-05-14 13:34:20.432313485 -0700 |
00e8dbcb9b1e
PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
896
diff
changeset
|
2 |
+++ Python-2.7.6/Makefile.pre.in 2014-05-14 13:34:20.480920940 -0700 |
00e8dbcb9b1e
PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
896
diff
changeset
|
3 |
@@ -407,7 +407,7 @@ |
896
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
4 |
|
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
5 |
# Default target |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
6 |
all: build_all |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
7 |
-build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
8 |
+build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks build-py_db |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
9 |
|
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
10 |
# Compile a binary with gcc profile guided optimization. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
11 |
profile-opt: |
1914
00e8dbcb9b1e
PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
896
diff
changeset
|
12 |
@@ -777,6 +777,19 @@ |
896
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
13 |
|
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
14 |
$(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
15 |
|
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
16 |
+SHLIB_FLAGS = -shared -fpic |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
17 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
18 |
+libpython2.7_db.so.1.0: $(srcdir)/py_db/libpython27_db.c |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
19 |
+ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(SHLIB_FLAGS) $< |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
20 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
21 |
+check_offset: $(srcdir)/py_db/check_offsets.c |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
22 |
+ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $< |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
23 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
24 |
+build-py_db: libpython2.7_db.so.1.0 check_offset |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
25 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
26 |
+install-py_db: libpython2.7_db.so.1.0 check_offset |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
27 |
+ $(INSTALL_SHARED) libpython2.7_db.so.1.0 $(DESTDIR)$(LIBDIR) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
28 |
+ $(INSTALL_PROGRAM) check_offset $(DESTDIR)$(BINDIR) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
29 |
|
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
30 |
###################################################################### |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
31 |
|
1914
00e8dbcb9b1e
PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
896
diff
changeset
|
32 |
@@ -841,7 +854,7 @@ |
896
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
33 |
$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
34 |
|
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
35 |
# Install everything |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
36 |
-install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
37 |
+install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ install-py_db |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
38 |
|
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
39 |
# Install almost everything without disturbing previous versions |
1914
00e8dbcb9b1e
PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
896
diff
changeset
|
40 |
altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall \ |
896
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
41 |
--- /dev/null |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
42 |
+++ Python-2.7.1/py_db/check_offsets.c |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
43 |
@@ -0,0 +1,87 @@ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
44 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
45 |
+ * CDDL HEADER START |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
46 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
47 |
+ * The contents of this file are subject to the terms of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
48 |
+ * Common Development and Distribution License (the "License"). |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
49 |
+ * You may not use this file except in compliance with the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
50 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
51 |
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
52 |
+ * or http://www.opensolaris.org/os/licensing. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
53 |
+ * See the License for the specific language governing permissions |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
54 |
+ * and limitations under the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
55 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
56 |
+ * When distributing Covered Code, include this CDDL HEADER in each |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
57 |
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
58 |
+ * If applicable, add the following below this CDDL HEADER, with the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
59 |
+ * fields enclosed by brackets "[]" replaced with your own identifying |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
60 |
+ * information: Portions Copyright [yyyy] [name of copyright owner] |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
61 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
62 |
+ * CDDL HEADER END |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
63 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
64 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
65 |
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
66 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
67 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
68 |
+#include <stdio.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
69 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
70 |
+#include <Python.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
71 |
+#include <frameobject.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
72 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
73 |
+#include "libpython27_db_32.h" |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
74 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
75 |
+#if 0 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
76 |
+#define offsetof(s, m) ((size_t)(&(((s *)0)->m))) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
77 |
+#endif |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
78 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
79 |
+int |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
80 |
+main(void) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
81 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
82 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
83 |
+ * PyCodeObject co_name |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
84 |
+ * PyCodeObject co_filename |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
85 |
+ * PyCodeObject co_lnotab |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
86 |
+ * PyFrameObject f_back |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
87 |
+ * PyFrameObject f_code |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
88 |
+ * PyFrameObject f_lasti |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
89 |
+ * PyInterpreterState next |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
90 |
+ * PyInterpreterState tstate_head |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
91 |
+ * PyStringObject ob_sval |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
92 |
+ * PyStringObject ob_size |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
93 |
+ * PyThreadState frame |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
94 |
+ * PyThreadState next |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
95 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
96 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
97 |
+ printf("struct member: native 32\n"); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
98 |
+ printf("PyCodeObject co_name: %d %d\n", offsetof(PyCodeObject, co_name), |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
99 |
+ offsetof(PyCodeObject32, co_name)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
100 |
+ printf("PyCodeObject co_filename: %d %d\n", offsetof(PyCodeObject, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
101 |
+ co_filename), offsetof(PyCodeObject32, co_filename)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
102 |
+ printf("PyCodeObject co_lnotab: %d %d\n", offsetof(PyCodeObject, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
103 |
+ co_lnotab), offsetof(PyCodeObject32, co_lnotab)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
104 |
+ printf("PyFrameObject f_back: %d %d\n", offsetof(PyFrameObject, f_back), |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
105 |
+ offsetof(PyFrameObject32, f_back)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
106 |
+ printf("PyFrameObject f_code: %d %d\n", offsetof(PyFrameObject, f_code), |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
107 |
+ offsetof(PyFrameObject32, f_code)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
108 |
+ printf("PyFrameObject f_lasti: %d %d\n", offsetof(PyFrameObject, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
109 |
+ f_lasti), offsetof(PyFrameObject32, f_lasti)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
110 |
+ printf("PyInterpreterState next: %d %d\n", offsetof(PyInterpreterState, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
111 |
+ next), offsetof(PyInterpreterState32, next)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
112 |
+ printf("PyInterpreterState tstate_head: %d %d\n", |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
113 |
+ offsetof(PyInterpreterState, tstate_head), |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
114 |
+ offsetof(PyInterpreterState32, tstate_head)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
115 |
+ printf("PyStringObject ob_sval: %d %d\n", offsetof(PyStringObject, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
116 |
+ ob_sval), offsetof(PyStringObject32, ob_sval)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
117 |
+ printf("PyStringObject ob_size: %d %d\n", offsetof(PyStringObject, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
118 |
+ ob_size), offsetof(PyStringObject32, ob_size)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
119 |
+ printf("PyThreadState frame: %d %d\n", offsetof(PyThreadState, frame), |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
120 |
+ offsetof(PyThreadState32, frame)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
121 |
+ printf("PyThreadState next: %d %d\n", offsetof(PyThreadState, next), |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
122 |
+ offsetof(PyThreadState32, next)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
123 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
124 |
+ printf("\nObject sizes\n"); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
125 |
+ printf("PyObject: %d %d\n", sizeof (PyObject), sizeof (PyObject32)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
126 |
+ printf("PyVarObject: %d %d\n", sizeof (PyVarObject), |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
127 |
+ sizeof (PyVarObject32)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
128 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
129 |
+ return (0); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
130 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
131 |
diff --git Python-2.7.1/py_db/libpython27_db.c Python-2.7.1/py_db/libpython27_db.c |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
132 |
new file mode 100644 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
133 |
--- /dev/null |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
134 |
+++ Python-2.7.1/py_db/libpython27_db.c |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
135 |
@@ -0,0 +1,654 @@ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
136 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
137 |
+ * CDDL HEADER START |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
138 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
139 |
+ * The contents of this file are subject to the terms of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
140 |
+ * Common Development and Distribution License (the "License"). |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
141 |
+ * You may not use this file except in compliance with the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
142 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
143 |
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
144 |
+ * or http://www.opensolaris.org/os/licensing. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
145 |
+ * See the License for the specific language governing permissions |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
146 |
+ * and limitations under the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
147 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
148 |
+ * When distributing Covered Code, include this CDDL HEADER in each |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
149 |
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
150 |
+ * If applicable, add the following below this CDDL HEADER, with the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
151 |
+ * fields enclosed by brackets "[]" replaced with your own identifying |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
152 |
+ * information: Portions Copyright [yyyy] [name of copyright owner] |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
153 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
154 |
+ * CDDL HEADER END |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
155 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
156 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
157 |
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
158 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
159 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
160 |
+#include <stdio.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
161 |
+#include <stdlib.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
162 |
+#include <string.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
163 |
+#include <errno.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
164 |
+#include <gelf.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
165 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
166 |
+#include <Python.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
167 |
+#include <frameobject.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
168 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
169 |
+#include "libpython27_db.h" |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
170 |
+#if defined(_LP64) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
171 |
+#include "libpython27_db_32.h" |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
172 |
+#endif /* _LP64 */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
173 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
174 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
175 |
+ * Because MDB always runs the debugger in the same datamodel as the target, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
176 |
+ * only functions that are used by the procfs part of this interface (or shared |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
177 |
+ * between the two) are written as 64->32 aware. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
178 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
179 |
+typedef struct pydb_arch_ops { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
180 |
+ ssize_t (*strobj_readdata)(pydb_agent_t *, uintptr_t, unsigned char *, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
181 |
+ size_t); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
182 |
+ int (*frameinfo)(pydb_agent_t *, uintptr_t, char *, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
183 |
+ size_t, char *, size_t, int *); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
184 |
+} pydb_arch_ops_t; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
185 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
186 |
+struct pydb_agent { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
187 |
+ struct ps_prochandle *pdb_ph; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
188 |
+ int pdb_vers; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
189 |
+ int pdb_is_64bit; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
190 |
+ int pdb_datamodel; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
191 |
+ const pydb_arch_ops_t *pdb_ops; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
192 |
+}; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
193 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
194 |
+typedef uintptr_t (*pdi_next_cb_t)(pydb_iter_t *); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
195 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
196 |
+struct pydb_iter { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
197 |
+ struct ps_prochandle *pdi_ph; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
198 |
+ uintptr_t pdi_current; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
199 |
+ pdi_next_cb_t pdi_nextf; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
200 |
+}; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
201 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
202 |
+#define LIBPYTHON "libpython2.7.so" |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
203 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
204 |
+#define MIN(x, y) (((x) < (y)) ? (x) : (y)) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
205 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
206 |
+/* Generic interface to helper functions */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
207 |
+static ssize_t pydb_strobj_readdata(pydb_agent_t *py, uintptr_t addr, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
208 |
+ unsigned char *buf, size_t buf_len); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
209 |
+static int pydb_getlno(pydb_agent_t *py, uintptr_t lnotab_addr, int firstline, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
210 |
+ int lastinst); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
211 |
+static int pydb_frameinfo(pydb_agent_t *py, uintptr_t addr, char *funcnm, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
212 |
+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
213 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
214 |
+/* datamodel specific implementation of helper functions */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
215 |
+static ssize_t pydb_strobj_readdata_native(pydb_agent_t *py, uintptr_t addr, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
216 |
+ unsigned char *buf, size_t buf_len); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
217 |
+static int pydb_frameinfo_native(pydb_agent_t *py, uintptr_t addr, char *funcnm, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
218 |
+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
219 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
220 |
+#if defined (_LP64) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
221 |
+static ssize_t pydb_strobj_readdata_32(pydb_agent_t *py, uintptr_t addr, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
222 |
+ unsigned char *buf, size_t buf_len); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
223 |
+static int pydb_frameinfo_32(pydb_agent_t *py, uintptr_t addr, char *funcnm, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
224 |
+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
225 |
+#endif /* _LP64 */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
226 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
227 |
+static ssize_t pydb_strobj_readstr(pydb_agent_t *py, uintptr_t addr, char *buf, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
228 |
+ size_t len); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
229 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
230 |
+/* Iterator function next routines. Plugable, configured by iterator init */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
231 |
+static uintptr_t pydb_frame_iter_next(pydb_iter_t *iter); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
232 |
+static uintptr_t pydb_interp_iter_next(pydb_iter_t *iter); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
233 |
+static uintptr_t pydb_thread_iter_next(pydb_iter_t *iter); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
234 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
235 |
+static const char *strbasename(const char *s); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
236 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
237 |
+static const pydb_arch_ops_t arch_ops_native = { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
238 |
+ .frameinfo = pydb_frameinfo_native, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
239 |
+ .strobj_readdata = pydb_strobj_readdata_native, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
240 |
+}; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
241 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
242 |
+#if defined (_LP64) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
243 |
+static const pydb_arch_ops_t arch_ops_32 = { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
244 |
+ .frameinfo = pydb_frameinfo_32, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
245 |
+ .strobj_readdata = pydb_strobj_readdata_32, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
246 |
+}; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
247 |
+#endif /* _LP64 */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
248 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
249 |
+static const char * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
250 |
+strbasename(const char *s) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
251 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
252 |
+ const char *p = strrchr(s, '/'); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
253 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
254 |
+ if (p == NULL) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
255 |
+ return (s); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
256 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
257 |
+ return (++p); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
258 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
259 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
260 |
+/* Agent creation / destruction routines */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
261 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
262 |
+pydb_agent_t * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
263 |
+pydb_agent_create(struct ps_prochandle *P, int vers) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
264 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
265 |
+ pydb_agent_t *py; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
266 |
+ int datamodel; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
267 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
268 |
+ if (vers != PYDB_VERSION) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
269 |
+ errno = ENOTSUP; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
270 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
271 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
272 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
273 |
+ if (ps_pdmodel(P, &datamodel) != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
274 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
275 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
276 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
277 |
+ py = (pydb_agent_t *)malloc(sizeof (pydb_agent_t)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
278 |
+ if (py == NULL) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
279 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
280 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
281 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
282 |
+ py->pdb_ph = P; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
283 |
+ py->pdb_vers = vers; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
284 |
+ py->pdb_datamodel = datamodel; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
285 |
+ py->pdb_is_64bit = 0; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
286 |
+ py->pdb_ops = &arch_ops_native; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
287 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
288 |
+#if defined (_LP64) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
289 |
+ py->pdb_is_64bit = (datamodel == PR_MODEL_LP64); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
290 |
+ if (!py->pdb_is_64bit) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
291 |
+ py->pdb_ops = &arch_ops_32; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
292 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
293 |
+#endif /* _LP64 */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
294 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
295 |
+ return (py); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
296 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
297 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
298 |
+void |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
299 |
+pydb_agent_destroy(pydb_agent_t *py) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
300 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
301 |
+ if (py == NULL) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
302 |
+ return; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
303 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
304 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
305 |
+ free(py); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
306 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
307 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
308 |
+/* Helper functions */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
309 |
+static int |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
310 |
+pydb_getlno(pydb_agent_t *py, uintptr_t lnotab_addr, int firstline, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
311 |
+ int lastinst) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
312 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
313 |
+ unsigned char lnotab[4096]; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
314 |
+ ssize_t lnotab_len; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
315 |
+ int addr, line; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
316 |
+ int i; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
317 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
318 |
+ lnotab_len = pydb_strobj_readdata(py, lnotab_addr, lnotab, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
319 |
+ sizeof (lnotab)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
320 |
+ if (lnotab_len < 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
321 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
322 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
323 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
324 |
+ /* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
325 |
+ * Python's line number algorithm is arcane. See here for details: |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
326 |
+ * http://svn.python.org/projects/python/trunk/Objects/lnotab_notes.txt |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
327 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
328 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
329 |
+ line = firstline; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
330 |
+ for (addr = i = 0; i < lnotab_len; i += 2) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
331 |
+ if (addr + lnotab[i] > lastinst) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
332 |
+ break; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
333 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
334 |
+ addr += lnotab[i]; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
335 |
+ line += lnotab[i + 1]; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
336 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
337 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
338 |
+ return (line); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
339 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
340 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
341 |
+static ssize_t |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
342 |
+pydb_strobj_readdata(pydb_agent_t *py, uintptr_t addr, unsigned char *buf, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
343 |
+ size_t buf_len) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
344 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
345 |
+ return (py->pdb_ops->strobj_readdata(py, addr, buf, buf_len)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
346 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
347 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
348 |
+static ssize_t |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
349 |
+pydb_strobj_readdata_native(pydb_agent_t *py, uintptr_t addr, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
350 |
+ unsigned char *buf, size_t buf_len) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
351 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
352 |
+ PyStringObject sobj; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
353 |
+ ssize_t obj_sz; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
354 |
+ ssize_t read_sz; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
355 |
+ psaddr_t straddr; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
356 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
357 |
+ /* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
358 |
+ * PyStringObjects are variable size. The size of the PyStringObject |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
359 |
+ * struct is fixed, and known at compile time; however, the size of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
360 |
+ * associated buffer is variable. The char[1] element at the end of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
361 |
+ * structure contains the string, and the ob_size of the PyStringObject |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
362 |
+ * indicates how much extra space was allocated to contain the string |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
363 |
+ * buffer at the object's tail. Read in the fixed size portion of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
364 |
+ * object first, and then read the contents of the data buffer into the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
365 |
+ * buffer passed by the caller. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
366 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
367 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
368 |
+ if (ps_pread(py->pdb_ph, addr, &sobj, sizeof (PyStringObject)) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
369 |
+ != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
370 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
371 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
372 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
373 |
+ obj_sz = (ssize_t)PyString_GET_SIZE(&sobj); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
374 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
375 |
+ read_sz = MIN(obj_sz, (ssize_t)buf_len); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
376 |
+ straddr = (psaddr_t)(addr + offsetof(PyStringObject, ob_sval)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
377 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
378 |
+ if (ps_pread(py->pdb_ph, straddr, buf, (size_t)read_sz) != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
379 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
380 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
381 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
382 |
+ return (read_sz); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
383 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
384 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
385 |
+#if defined(_LP64) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
386 |
+static ssize_t |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
387 |
+pydb_strobj_readdata_32(pydb_agent_t *py, uintptr_t addr, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
388 |
+ unsigned char *buf, size_t buf_len) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
389 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
390 |
+ PyStringObject32 sobj; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
391 |
+ ssize_t obj_sz; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
392 |
+ ssize_t read_sz; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
393 |
+ psaddr_t straddr; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
394 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
395 |
+ /* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
396 |
+ * PyStringObjects are variable size. The size of the PyStringObject |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
397 |
+ * struct is fixed, and known at compile time; however, the size of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
398 |
+ * associated buffer is variable. The char[1] element at the end of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
399 |
+ * structure contains the string, and the ob_size of the PyStringObject |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
400 |
+ * indicates how much extra space was allocated to contain the string |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
401 |
+ * buffer at the object's tail. Read in the fixed size portion of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
402 |
+ * object first, and then read the contents of the data buffer into the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
403 |
+ * buffer passed by the caller. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
404 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
405 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
406 |
+ if (ps_pread(py->pdb_ph, addr, &sobj, sizeof (PyStringObject32)) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
407 |
+ != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
408 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
409 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
410 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
411 |
+ obj_sz = (ssize_t)PyString_GET_SIZE32(&sobj); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
412 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
413 |
+ read_sz = MIN(obj_sz, (ssize_t)buf_len); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
414 |
+ straddr = (psaddr_t)(addr + offsetof(PyStringObject32, ob_sval)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
415 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
416 |
+ if (ps_pread(py->pdb_ph, straddr, buf, (size_t)read_sz) != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
417 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
418 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
419 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
420 |
+ return (read_sz); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
421 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
422 |
+#endif /* _LP64 */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
423 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
424 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
425 |
+ * Most Python PyStringObjects contain strings, as one would expect. However, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
426 |
+ * due to some sleazy hackery in parts of the Python code, some string objects |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
427 |
+ * are used as buffers for binary data. In the general case, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
428 |
+ * pydb_strobj_readstr() should be used to read strings out of string objects. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
429 |
+ * It wraps pydb_strobj_readdata(), which should be used by callers only when |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
430 |
+ * trying to retrieve binary data. (This routine does some string cleanup). |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
431 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
432 |
+static ssize_t |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
433 |
+pydb_strobj_readstr(pydb_agent_t *py, uintptr_t addr, char *buf, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
434 |
+ size_t buf_len) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
435 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
436 |
+ ssize_t read_sz; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
437 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
438 |
+ read_sz = pydb_strobj_readdata(py, addr, (unsigned char *)buf, buf_len); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
439 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
440 |
+ if (read_sz >= 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
441 |
+ if (read_sz >= buf_len) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
442 |
+ read_sz = buf_len - 1; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
443 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
444 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
445 |
+ buf[read_sz] = '\0'; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
446 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
447 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
448 |
+ return (read_sz); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
449 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
450 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
451 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
452 |
+static int |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
453 |
+pydb_frameinfo(pydb_agent_t *py, uintptr_t addr, char *funcnm, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
454 |
+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
455 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
456 |
+ return (py->pdb_ops->frameinfo(py, addr, funcnm, funcnm_sz, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
457 |
+ filenm, filenm_sz, lineno)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
458 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
459 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
460 |
+static int |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
461 |
+pydb_frameinfo_native(pydb_agent_t *py, uintptr_t addr, char *funcnm, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
462 |
+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
463 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
464 |
+ PyFrameObject fo; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
465 |
+ PyCodeObject co; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
466 |
+ ssize_t rc; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
467 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
468 |
+ if (ps_pread(py->pdb_ph, addr, &fo, sizeof (PyFrameObject)) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
469 |
+ != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
470 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
471 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
472 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
473 |
+ if (ps_pread(py->pdb_ph, (uintptr_t)fo.f_code, &co, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
474 |
+ sizeof (PyCodeObject)) != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
475 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
476 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
477 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
478 |
+ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_name, funcnm, funcnm_sz); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
479 |
+ if (rc < 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
480 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
481 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
482 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
483 |
+ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_filename, filenm, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
484 |
+ filenm_sz); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
485 |
+ if (rc < 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
486 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
487 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
488 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
489 |
+ *lineno = pydb_getlno(py, (uintptr_t)co.co_lnotab, co.co_firstlineno, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
490 |
+ fo.f_lasti); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
491 |
+ if (*lineno < 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
492 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
493 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
494 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
495 |
+ return (0); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
496 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
497 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
498 |
+#if defined (_LP64) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
499 |
+static int |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
500 |
+pydb_frameinfo_32(pydb_agent_t *py, uintptr_t addr, char *funcnm, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
501 |
+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
502 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
503 |
+ PyFrameObject32 fo; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
504 |
+ PyCodeObject32 co; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
505 |
+ ssize_t rc; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
506 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
507 |
+ if (ps_pread(py->pdb_ph, addr, &fo, sizeof (PyFrameObject32)) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
508 |
+ != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
509 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
510 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
511 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
512 |
+ if (ps_pread(py->pdb_ph, (uintptr_t)fo.f_code, &co, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
513 |
+ sizeof (PyCodeObject32)) != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
514 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
515 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
516 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
517 |
+ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_name, funcnm, funcnm_sz); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
518 |
+ if (rc < 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
519 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
520 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
521 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
522 |
+ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_filename, filenm, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
523 |
+ filenm_sz); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
524 |
+ if (rc < 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
525 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
526 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
527 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
528 |
+ *lineno = pydb_getlno(py, (uintptr_t)co.co_lnotab, co.co_firstlineno, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
529 |
+ fo.f_lasti); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
530 |
+ if (*lineno < 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
531 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
532 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
533 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
534 |
+ return (0); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
535 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
536 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
537 |
+#endif /* _LP64 */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
538 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
539 |
+/* Functions that are part of the library's interface */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
540 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
541 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
542 |
+ * Given the address of a PyFrameObject, and a buffer of a known size, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
543 |
+ * fill the buffer with a description of the frame. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
544 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
545 |
+int |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
546 |
+pydb_get_frameinfo(pydb_agent_t *py, uintptr_t frame_addr, char *fbuf, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
547 |
+ size_t bufsz, int verbose) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
548 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
549 |
+ char funcname[1024]; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
550 |
+ char filename[1024]; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
551 |
+ char *fn; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
552 |
+ int lineno; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
553 |
+ int length = (py->pdb_is_64bit ? 16 : 8); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
554 |
+ int rc; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
555 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
556 |
+ rc = pydb_frameinfo(py, frame_addr, funcname, sizeof (funcname), |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
557 |
+ filename, sizeof (filename), &lineno); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
558 |
+ if (rc < 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
559 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
560 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
561 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
562 |
+ if (!verbose) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
563 |
+ fn = (char *)strbasename(filename); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
564 |
+ } else { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
565 |
+ fn = filename; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
566 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
567 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
568 |
+ (void) snprintf(fbuf, bufsz, "%0.*lx %s:%d %s()\n", length, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
569 |
+ frame_addr, fn, lineno, funcname); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
570 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
571 |
+ return (0); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
572 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
573 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
574 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
575 |
+ * Return a description about a PyFrameObject, if the object is |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
576 |
+ * actually a PyFrameObject. In this case, the pc argument is checked |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
577 |
+ * to make sure that it came from a function that takes a PyFrameObject |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
578 |
+ * as its first (argv[0]) argument. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
579 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
580 |
+int |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
581 |
+pydb_pc_frameinfo(pydb_agent_t *py, uintptr_t pc, uintptr_t frame_addr, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
582 |
+ char *fbuf, size_t bufsz) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
583 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
584 |
+ char funcname[1024]; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
585 |
+ char filename[1024]; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
586 |
+ int lineno; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
587 |
+ int rc; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
588 |
+ ps_sym_t psym; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
589 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
590 |
+ /* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
591 |
+ * If PC doesn't match PyEval_EvalFrameEx in either libpython |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
592 |
+ * or the executable, don't decode it. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
593 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
594 |
+ if (ps_pglobal_sym(py->pdb_ph, LIBPYTHON, "PyEval_EvalFrameEx", &psym) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
595 |
+ != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
596 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
597 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
598 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
599 |
+ /* If symbol found, ensure that PC falls within PyEval_EvalFrameEx. */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
600 |
+ if (pc < psym.st_value || pc > psym.st_value + psym.st_size) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
601 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
602 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
603 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
604 |
+ rc = pydb_frameinfo(py, frame_addr, funcname, sizeof (funcname), |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
605 |
+ filename, sizeof (filename), &lineno); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
606 |
+ if (rc < 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
607 |
+ return (-1); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
608 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
609 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
610 |
+ (void) snprintf(fbuf, bufsz, "[ %s:%d (%s) ]\n", filename, lineno, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
611 |
+ funcname); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
612 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
613 |
+ return (0); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
614 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
615 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
616 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
617 |
+ * Walks the list of PyInterpreterState objects. If caller doesn't |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
618 |
+ * supply address of list, this method will look it up. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
619 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
620 |
+pydb_iter_t * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
621 |
+pydb_interp_iter_init(pydb_agent_t *py, uintptr_t addr) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
622 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
623 |
+ pydb_iter_t *itr; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
624 |
+ uintptr_t i_addr; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
625 |
+ int rc; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
626 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
627 |
+ if (addr == 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
628 |
+ rc = ps_pglobal_lookup(py->pdb_ph, LIBPYTHON, "interp_head", |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
629 |
+ (psaddr_t *)&addr); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
630 |
+ if (rc != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
631 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
632 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
633 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
634 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
635 |
+ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &i_addr, sizeof (uintptr_t)) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
636 |
+ != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
637 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
638 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
639 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
640 |
+ itr = malloc(sizeof (pydb_iter_t)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
641 |
+ if (itr == NULL) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
642 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
643 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
644 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
645 |
+ itr->pdi_ph = py->pdb_ph; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
646 |
+ itr->pdi_current = i_addr; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
647 |
+ itr->pdi_nextf = pydb_interp_iter_next; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
648 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
649 |
+ return (itr); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
650 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
651 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
652 |
+static uintptr_t |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
653 |
+pydb_interp_iter_next(pydb_iter_t *iter) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
654 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
655 |
+ PyInterpreterState st; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
656 |
+ uintptr_t cur; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
657 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
658 |
+ cur = iter->pdi_current; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
659 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
660 |
+ if (cur == 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
661 |
+ return (cur); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
662 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
663 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
664 |
+ if (ps_pread(iter->pdi_ph, cur, &st, sizeof (PyInterpreterState)) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
665 |
+ != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
666 |
+ iter->pdi_current = 0; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
667 |
+ return (0); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
668 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
669 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
670 |
+ iter->pdi_current = (uintptr_t)st.next; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
671 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
672 |
+ return (cur); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
673 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
674 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
675 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
676 |
+ * Walk a list of Python PyFrameObjects. The addr argument must be |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
677 |
+ * the address of a valid PyThreadState object. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
678 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
679 |
+pydb_iter_t * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
680 |
+pydb_frame_iter_init(pydb_agent_t *py, uintptr_t addr) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
681 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
682 |
+ pydb_iter_t *itr; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
683 |
+ PyThreadState ts; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
684 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
685 |
+ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &ts, sizeof (PyThreadState)) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
686 |
+ != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
687 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
688 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
689 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
690 |
+ itr = malloc(sizeof (pydb_iter_t)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
691 |
+ if (itr == NULL) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
692 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
693 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
694 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
695 |
+ itr->pdi_ph = py->pdb_ph; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
696 |
+ itr->pdi_current = (uintptr_t)ts.frame; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
697 |
+ itr->pdi_nextf = pydb_frame_iter_next; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
698 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
699 |
+ return (itr); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
700 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
701 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
702 |
+static uintptr_t |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
703 |
+pydb_frame_iter_next(pydb_iter_t *iter) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
704 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
705 |
+ PyFrameObject fo; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
706 |
+ uintptr_t cur; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
707 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
708 |
+ cur = iter->pdi_current; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
709 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
710 |
+ if (cur == 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
711 |
+ return (cur); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
712 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
713 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
714 |
+ if (ps_pread(iter->pdi_ph, cur, &fo, sizeof (PyFrameObject)) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
715 |
+ != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
716 |
+ iter->pdi_current = 0; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
717 |
+ return (0); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
718 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
719 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
720 |
+ iter->pdi_current = (uintptr_t)fo.f_back; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
721 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
722 |
+ return (cur); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
723 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
724 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
725 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
726 |
+ * Walk a list of Python PyThreadState objects. The addr argument must be |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
727 |
+ * the address of a valid PyInterpreterState object. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
728 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
729 |
+pydb_iter_t * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
730 |
+pydb_thread_iter_init(pydb_agent_t *py, uintptr_t addr) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
731 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
732 |
+ pydb_iter_t *itr; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
733 |
+ PyInterpreterState is; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
734 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
735 |
+ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &is, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
736 |
+ sizeof (PyInterpreterState)) != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
737 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
738 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
739 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
740 |
+ itr = malloc(sizeof (pydb_iter_t)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
741 |
+ if (itr == NULL) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
742 |
+ return (NULL); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
743 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
744 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
745 |
+ itr->pdi_ph = py->pdb_ph; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
746 |
+ itr->pdi_current = (uintptr_t)is.tstate_head; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
747 |
+ itr->pdi_nextf = pydb_thread_iter_next; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
748 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
749 |
+ return (itr); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
750 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
751 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
752 |
+static uintptr_t |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
753 |
+pydb_thread_iter_next(pydb_iter_t *iter) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
754 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
755 |
+ PyThreadState ts; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
756 |
+ uintptr_t cur; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
757 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
758 |
+ cur = iter->pdi_current; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
759 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
760 |
+ if (cur == 0) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
761 |
+ return (cur); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
762 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
763 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
764 |
+ if (ps_pread(iter->pdi_ph, cur, &ts, sizeof (PyThreadState)) != PS_OK) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
765 |
+ iter->pdi_current = 0; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
766 |
+ return (0); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
767 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
768 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
769 |
+ iter->pdi_current = (uintptr_t)ts.next; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
770 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
771 |
+ return (cur); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
772 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
773 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
774 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
775 |
+uintptr_t |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
776 |
+pydb_iter_next(pydb_iter_t *iter) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
777 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
778 |
+ return (iter->pdi_nextf(iter)); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
779 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
780 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
781 |
+void |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
782 |
+pydb_iter_fini(pydb_iter_t *iter) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
783 |
+{ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
784 |
+ if (iter == NULL) { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
785 |
+ return; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
786 |
+ } |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
787 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
788 |
+ free(iter); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
789 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
790 |
diff --git Python-2.7.1/py_db/libpython27_db.h Python-2.7.1/py_db/libpython27_db.h |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
791 |
new file mode 100644 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
792 |
--- /dev/null |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
793 |
+++ Python-2.7.1/py_db/libpython27_db.h |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
794 |
@@ -0,0 +1,73 @@ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
795 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
796 |
+ * CDDL HEADER START |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
797 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
798 |
+ * The contents of this file are subject to the terms of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
799 |
+ * Common Development and Distribution License (the "License"). |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
800 |
+ * You may not use this file except in compliance with the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
801 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
802 |
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
803 |
+ * or http://www.opensolaris.org/os/licensing. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
804 |
+ * See the License for the specific language governing permissions |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
805 |
+ * and limitations under the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
806 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
807 |
+ * When distributing Covered Code, include this CDDL HEADER in each |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
808 |
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
809 |
+ * If applicable, add the following below this CDDL HEADER, with the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
810 |
+ * fields enclosed by brackets "[]" replaced with your own identifying |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
811 |
+ * information: Portions Copyright [yyyy] [name of copyright owner] |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
812 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
813 |
+ * CDDL HEADER END |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
814 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
815 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
816 |
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
817 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
818 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
819 |
+#ifndef _LIBPYTHON27_DB_H |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
820 |
+#define _LIBPYTHON27_DB_H |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
821 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
822 |
+#include <proc_service.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
823 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
824 |
+#ifdef __cplusplus |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
825 |
+extern "C" { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
826 |
+#endif |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
827 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
828 |
+/* Agent is opaque to library's consumers. */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
829 |
+typedef struct pydb_agent pydb_agent_t; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
830 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
831 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
832 |
+ * Library's debug version is 1. Changes to interface should increase this |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
833 |
+ * number. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
834 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
835 |
+#define PYDB_VERSION 1 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
836 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
837 |
+/* Agent creation/destruction routines */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
838 |
+extern pydb_agent_t *pydb_agent_create(struct ps_prochandle *P, int vers); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
839 |
+extern void pydb_agent_destroy(pydb_agent_t *py); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
840 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
841 |
+/* Used by callers that know they are looking at a PyFrameObject */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
842 |
+extern int pydb_get_frameinfo(pydb_agent_t *py, uintptr_t frame_addr, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
843 |
+ char *fbuf, size_t bufsz, int verbose); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
844 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
845 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
846 |
+ * Used by callers that don't know if they're looking at PyFrameObject. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
847 |
+ * Checks PC for traceable functions. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
848 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
849 |
+extern int pydb_pc_frameinfo(pydb_agent_t *py, uintptr_t pc, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
850 |
+ uintptr_t frame_addr, char *fbuf, size_t bufsz); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
851 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
852 |
+/* Iterator functions */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
853 |
+typedef struct pydb_iter pydb_iter_t; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
854 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
855 |
+extern pydb_iter_t *pydb_frame_iter_init(pydb_agent_t *py, uintptr_t addr); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
856 |
+extern pydb_iter_t *pydb_interp_iter_init(pydb_agent_t *py, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
857 |
+ uintptr_t addr); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
858 |
+extern pydb_iter_t *pydb_thread_iter_init(pydb_agent_t *py, |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
859 |
+ uintptr_t addr); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
860 |
+extern void pydb_iter_fini(pydb_iter_t *iter); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
861 |
+extern uintptr_t pydb_iter_next(pydb_iter_t *iter); |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
862 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
863 |
+#ifdef __cplusplus |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
864 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
865 |
+#endif |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
866 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
867 |
+#endif /* _LIBPYTHON27_DB_H */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
868 |
diff --git Python-2.7.1/py_db/libpython27_db_32.h Python-2.7.1/py_db/libpython27_db_32.h |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
869 |
new file mode 100644 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
870 |
--- /dev/null |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
871 |
+++ Python-2.7.1/py_db/libpython27_db_32.h |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
872 |
@@ -0,0 +1,121 @@ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
873 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
874 |
+ * CDDL HEADER START |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
875 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
876 |
+ * The contents of this file are subject to the terms of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
877 |
+ * Common Development and Distribution License (the "License"). |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
878 |
+ * You may not use this file except in compliance with the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
879 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
880 |
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
881 |
+ * or http://www.opensolaris.org/os/licensing. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
882 |
+ * See the License for the specific language governing permissions |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
883 |
+ * and limitations under the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
884 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
885 |
+ * When distributing Covered Code, include this CDDL HEADER in each |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
886 |
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
887 |
+ * If applicable, add the following below this CDDL HEADER, with the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
888 |
+ * fields enclosed by brackets "[]" replaced with your own identifying |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
889 |
+ * information: Portions Copyright [yyyy] [name of copyright owner] |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
890 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
891 |
+ * CDDL HEADER END |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
892 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
893 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
894 |
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
895 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
896 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
897 |
+#ifndef _LIBPYTHON27_DB_32_H |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
898 |
+#define _LIBPYTHON27_DB_32_H |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
899 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
900 |
+#ifdef __cplusplus |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
901 |
+extern "C" { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
902 |
+#endif |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
903 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
904 |
+#include <sys/types.h> |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
905 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
906 |
+/* |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
907 |
+ * Define 32-bit Python data structures for use by the 64-bit debugger. This |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
908 |
+ * is so that a 64-bit debugger may properly examine a 32-bit process. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
909 |
+ * |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
910 |
+ * In many cases, the debug library is only concerned with a few fields in the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
911 |
+ * Python structure. In that case, the other ancillary fields are elided. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
912 |
+ */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
913 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
914 |
+typedef uint32_t uintptr32_t; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
915 |
+typedef int32_t Py_ssize32_t; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
916 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
917 |
+typedef struct _is32 { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
918 |
+ uintptr32_t next; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
919 |
+ uintptr32_t tstate_head; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
920 |
+} PyInterpreterState32; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
921 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
922 |
+typedef struct _ts32 { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
923 |
+ uintptr32_t next; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
924 |
+ uintptr32_t interp; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
925 |
+ uintptr32_t frame; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
926 |
+} PyThreadState32; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
927 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
928 |
+#define PyObject_HEAD32 \ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
929 |
+ Py_ssize32_t ob_refcnt; \ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
930 |
+ uintptr32_t ob_type; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
931 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
932 |
+#define PyObject_VAR_HEAD32 \ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
933 |
+ PyObject_HEAD32 \ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
934 |
+ Py_ssize32_t ob_size; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
935 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
936 |
+typedef struct { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
937 |
+ PyObject_HEAD32 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
938 |
+} PyObject32; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
939 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
940 |
+typedef struct { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
941 |
+ PyObject_VAR_HEAD32 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
942 |
+} PyVarObject32; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
943 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
944 |
+typedef struct { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
945 |
+ PyObject_VAR_HEAD32 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
946 |
+ int32_t ob_shash; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
947 |
+ int ob_sstate; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
948 |
+ char ob_sval[1]; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
949 |
+} PyStringObject32; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
950 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
951 |
+#define Py_SIZE32(ob) (((PyVarObject32*)(ob))->ob_size) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
952 |
+#define PyString_GET_SIZE32(op) Py_SIZE32(op) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
953 |
+#define PyString_AS_STRING32(op) (((PyStringObject32 *)(op))->ob_sval) |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
954 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
955 |
+typedef struct { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
956 |
+ PyObject_VAR_HEAD32 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
957 |
+ uintptr32_t f_back; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
958 |
+ uintptr32_t f_code; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
959 |
+ uintptr32_t f_builtins; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
960 |
+ uintptr32_t f_globals; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
961 |
+ uintptr32_t f_locals; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
962 |
+ uintptr32_t f_valuestack; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
963 |
+ uintptr32_t f_stacktop; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
964 |
+ uintptr32_t f_trace; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
965 |
+ uintptr32_t f_exc_typpe, f_exc_value, f_exc_traceback; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
966 |
+ uintptr32_t f_tstate; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
967 |
+ int f_lasti; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
968 |
+ int f_lineno; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
969 |
+} PyFrameObject32; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
970 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
971 |
+typedef struct { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
972 |
+ PyObject_HEAD32 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
973 |
+ int co_argcount; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
974 |
+ int co_nlocals; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
975 |
+ int co_stacksize; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
976 |
+ int co_flags; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
977 |
+ uintptr32_t co_code; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
978 |
+ uintptr32_t co_consts; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
979 |
+ uintptr32_t co_names; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
980 |
+ uintptr32_t co_varnames; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
981 |
+ uintptr32_t co_freevars; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
982 |
+ uintptr32_t co_cellvars; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
983 |
+ uintptr32_t co_filename; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
984 |
+ uintptr32_t co_name; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
985 |
+ int co_firstlineno; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
986 |
+ uintptr32_t co_lnotab; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
987 |
+} PyCodeObject32; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
988 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
989 |
+#ifdef __cplusplus |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
990 |
+} |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
991 |
+#endif |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
992 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
993 |
+#endif /* _LIBPYTHON27_DB_32_H */ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
994 |
diff --git Python-2.7.1/py_db/mapfile-vers Python-2.7.1/py_db/mapfile-vers |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
995 |
new file mode 100644 |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
996 |
--- /dev/null |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
997 |
+++ Python-2.7.1/py_db/mapfile-vers |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
998 |
@@ -0,0 +1,39 @@ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
999 |
+# |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1000 |
+# CDDL HEADER START |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1001 |
+# |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1002 |
+# The contents of this file are subject to the terms of the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1003 |
+# Common Development and Distribution License (the "License"). |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1004 |
+# You may not use this file except in compliance with the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1005 |
+# |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1006 |
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1007 |
+# or http://www.opensolaris.org/os/licensing. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1008 |
+# See the License for the specific language governing permissions |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1009 |
+# and limitations under the License. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1010 |
+# |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1011 |
+# When distributing Covered Code, include this CDDL HEADER in each |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1012 |
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1013 |
+# If applicable, add the following below this CDDL HEADER, with the |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1014 |
+# fields enclosed by brackets "[]" replaced with your own identifying |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1015 |
+# information: Portions Copyright [yyyy] [name of copyright owner] |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1016 |
+# |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1017 |
+# CDDL HEADER END |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1018 |
+# |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1019 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1020 |
+# |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1021 |
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1022 |
+# |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1023 |
+ |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1024 |
+SUNWprivate_1.1 { |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1025 |
+ global: |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1026 |
+ pydb_agent_create; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1027 |
+ pydb_agent_destroy; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1028 |
+ pydb_frame_iter_init; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1029 |
+ pydb_get_frameinfo; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1030 |
+ pydb_pc_frameinfo; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1031 |
+ pydb_interp_iter_init; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1032 |
+ pydb_thread_iter_init; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1033 |
+ pydb_iter_fini; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1034 |
+ pydb_iter_next; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1035 |
+ local: |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1036 |
+ *; |
50be262e44f7
7155369 mdb should work with python 2.7 bits
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1037 |
+}; |