annotate debuginfo-tests/README.txt @ 209:dd44ba33042e

merged...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:36:09 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 -*- rst -*-
anatofuz
parents:
diff changeset
2 This is a collection of tests to check debugging information generated by
anatofuz
parents:
diff changeset
3 compiler. This test suite can be checked out inside clang/test folder. This
anatofuz
parents:
diff changeset
4 will enable 'make test' for clang to pick up these tests.
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 Some tests (in the 'llgdb-tests' directory) are written with debugger
anatofuz
parents:
diff changeset
7 commands and checks for the intended debugger output in the source file,
anatofuz
parents:
diff changeset
8 using DEBUGGER: and CHECK: as prefixes respectively.
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 For example::
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 define i32 @f1(i32 %i) nounwind ssp {
anatofuz
parents:
diff changeset
13 ; DEBUGGER: break f1
anatofuz
parents:
diff changeset
14 ; DEBUGGER: r
anatofuz
parents:
diff changeset
15 ; DEBUGGER: p i
anatofuz
parents:
diff changeset
16 ; CHECK: $1 = 42
anatofuz
parents:
diff changeset
17 entry:
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 is a testcase where the debugger is asked to break at function 'f1' and
anatofuz
parents:
diff changeset
21 print value of argument 'i'. The expected value of 'i' is 42 in this case.
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 Other tests are written for use with the 'Dexter' tool (in the 'dexter-tests'
anatofuz
parents:
diff changeset
24 and 'dexter' directories respectively). These use a domain specific language
anatofuz
parents:
diff changeset
25 in comments to describe the intended debugger experience in a more abstract
anatofuz
parents:
diff changeset
26 way than debugger commands. This allows for testing integration across
anatofuz
parents:
diff changeset
27 multiple debuggers from one input language.
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 For example::
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 void __attribute__((noinline, optnone)) bar(int *test) {}
anatofuz
parents:
diff changeset
32 int main() {
anatofuz
parents:
diff changeset
33 int test;
anatofuz
parents:
diff changeset
34 test = 23;
anatofuz
parents:
diff changeset
35 bar(&test); // DexLabel('before_bar')
anatofuz
parents:
diff changeset
36 return test; // DexLabel('after_bar')
anatofuz
parents:
diff changeset
37 }
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 // DexExpectWatchValue('test', '23', on_line='before_bar')
anatofuz
parents:
diff changeset
40 // DexExpectWatchValue('test', '23', on_line='after_bar')
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 Labels two lines with the names 'before_bar' and 'after_bar', and records that
anatofuz
parents:
diff changeset
43 the 'test' variable is expected to have the value 23 on both of them.