Debian Codegraph @

tapset/java.stp

raw
1 @__private30 global java_backtrace_string
2
3 /**
4 * sfunction sprint_java_backtrace - returns the java backtrace as a single string
5 *
6 * Description: This function returns the java backtrace as a single string.
7 * in the case when the backtrace is cut off, use the -DMAXSTRINGLEN
8 * option to extend the maximum string length
9 */
10
11 function sprint_java_backtrace:string ()
12 {
13 foreach([_tid,__thread_depth+] in java_backtrace_string){
14 if(_tid == tid()){
15 string_return .= java_backtrace_string[_tid,__thread_depth]
16 string_return .= "\n"
17 }
18 }
19 return string_return
20 }
21
22 /**
23 * sfunction print_java_backtrace - print the java backtrace
24 *
25 * Description: This function immediately prints the java backtrace
26 * one line at a time, avoiding any max string length issues.
27 *
28 */
29 function print_java_backtrace ()
30 {
31 foreach ([_tid,__thread_depth+] in java_backtrace_string){
32 if(_tid == tid()){
33 println(java_backtrace_string[_tid,__thread_depth])
34 }
35 }
36 }
37
38 function __delete_backtrace()
39 {
40 foreach([_tid,_depth-] in java_backtrace_string){
41 if(_tid == tid() && _depth > jbs_dup){
42 jbs_dup = _depth
43 }
44 }
45 for (i = 0; i< jbs_dup; i++)
46 delete java_backtrace_string[_tid, i]
47 delete jbs_dup
48 }
49
50 function __assign_stacktrace(jbts:long, jstd:long){
51 java_backtrace_string[tid(), jstd] = user_string(jbts)
52 }