File: partial-class-type.exp

package info (click to toggle)
systemtap 5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,556 kB
  • sloc: cpp: 81,117; ansic: 54,933; xml: 49,795; exp: 43,595; sh: 11,526; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (33 lines) | stat: -rw-r--r-- 1,368 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
set test "partial-class-type"

# PR14434 dwflpp sometimes caches incomplete class_type

proc error_handler { res message } {
  global verbose test
  if { $res == 0 } {
    verbose $message 2
    fail "$test $message"
    return 1
  } else {
    pass "$test $message"
    return 0
  }
}

set srcpath "$srcdir/$subdir"
set res [target_compile $srcpath/partial-class-type-heap.cxx "partial-class-type-heap.o" object "compiler=g++ additional_flags=-g additional_flags=-O2"]
if { [error_handler [expr {$res==""}] "partial-class-type-heap.cxx"] } { return }

set res [target_compile $srcpath/partial-class-type-main.cxx "partial-class-type-main.o" object "compiler=g++ additional_flags=-g additional_flags=-O2"]
if { [error_handler [expr {$res==""}] "partial-class-type-main.cxx"] } { return }

set res [target_compile "partial-class-type-main.o partial-class-type-heap.o" "partial-class-type" executable "compiler=g++ additional_flags=-g additional_flags=-O2"]
if { [error_handler [expr {$res==""}] "partial-class-type"] } { return }

set script {"probe process(\"./partial-class-type\").function(\"main\") { printf(\"_size member offset: %d\\n\", &@cast(0, \"Heap\")->_size); }"}

# Try compiling a couple of times, to make sure we always pick the right DIE.
# See PR14434 for the non-determinism.
for {set i 0} {$i < 7} {incr i} {
  stap_compile $test-$i 1 $script -p2
}