File: const_value.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 (87 lines) | stat: -rw-r--r-- 2,422 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# DW_AT_const_value (blocks).
set test "const_value"
set ::result_string {i: 2
j: 21
a: {17, 23}}

set test_flags "additional_flags=-g"
# We need -O2 to get const_value encodings in dwarf.
set test_flags "$test_flags additional_flags=-O2"
set test_flags "$test_flags [sdt_includes]"

set res [target_compile $srcdir/$subdir/$test.c $test.exe executable "$test_flags"]
if { $res != "" } {
  verbose "target_compile failed: $res" 2
  fail "$test.c compile"
  untested "$test"
  return
} else {
  pass "$test.c compile"
}

# Test only when we are running an install test (can execute) and when
# gcc generated DW_AT_const_values for us. We are interested in block
# constant values.
if {[installtest_p]} {
  set dw_at_c {DW_AT_const_value}
  if {![catch {exec readelf --debug-dump=info $test.exe | grep "$dw_at_c"}]} {
    foreach runtime [get_runtime_list] {
      if {$runtime != ""} {
	stap_run2 $srcdir/$subdir/$test.stp -c ./$test.exe --runtime=$runtime
      } elseif {[uprobes_p]} {
	stap_run2 $srcdir/$subdir/$test.stp -c ./$test.exe
      } else {
	untested "$test"
      }
    }
  } else {
    untested "$test (no-const-value)"
  }
} else {
  untested "$test"
}
catch {exec rm -f $test.exe}


# DW_AT_const_value (address).
set test "const_value_func"
set ::result_string {f: bar}

set test_flags "additional_flags=-g"
# We need -O2 to get const_value encodings in dwarf.
set test_flags "$test_flags additional_flags=-O2"
set test_flags "$test_flags [sdt_includes]"

set res [target_compile $srcdir/$subdir/$test.c $test.exe executable "$test_flags"]
if { $res != "" } {
  verbose "target_compile failed: $res" 2
  fail "$test.c compile"
  untested "$test"
  return
} else {
  pass "$test.c compile"
}

# Test only when we are running an install test (can execute) and when
# gcc generated DW_AT_const_values for us. We are interested in pure
# constant addresses.
if {[installtest_p]} {
  set dw_at_c {DW_AT_const_value}
  if {![catch {exec readelf --debug-dump=info $test.exe | grep "$dw_at_c"}]} {
    foreach runtime [get_runtime_list] {
      setup_kfail 10739 "*-*-*"
      if {$runtime != ""} {
	stap_run2 $srcdir/$subdir/$test.stp -c ./$test.exe --runtime=$runtime
      } elseif {[uprobes_p]} {
	stap_run2 $srcdir/$subdir/$test.stp -c ./$test.exe
      } else {
	untested "$test"
      }
    }
  } else {
    untested "$test (no-const-value)"
  }
} else {
  untested "$test"
}
catch {exec rm -f $test.exe}