• Home
Name Date Size #Lines LOC

..--

solaris/07-May-2024-9882

Makefile.amD07-May-20243.9 KiB172160

README_DEVELOPERSD07-May-20248.5 KiB241191

clean_after_fork.cD07-May-2024715 3936

filter_gdbD07-May-20249.1 KiB13064

filter_helgrind_monitorD07-May-2024373 219

filter_helgrind_monitor_solarisD07-May-20241 KiB4330

filter_make_emptyD07-May-2024277 113

filter_memcheck_monitorD07-May-20241,020 308

filter_passsigalrmD07-May-2024250 113

filter_stderrD07-May-2024565 1511

filter_vgdbD07-May-2024813 249

fork_chain.cD07-May-2024623 3835

gone.cD07-May-2024627 3425

hginfo.stderr.expD07-May-202435 41

hginfo.stderrB.expD07-May-2024669 2019

hginfo.stdinB.gdbD07-May-2024500 2120

hginfo.stdoutB.expD07-May-2024254 109

hginfo.vgtestD07-May-2024480 1413

hgtls.stderr.expD07-May-20240 10

hgtls.stderrB.expD07-May-20240 10

hgtls.stdinB.gdbD07-May-2024723 3837

hgtls.stdoutB.expD07-May-20241.7 KiB4645

hgtls.vgtestD07-May-2024505 1211

invokerD07-May-2024381 209

main_pic.cD07-May-2024364 1613

make_local_linksD07-May-20243.4 KiB11365

mcblocklistsearch.stderr.expD07-May-20240 10

mcblocklistsearch.stderrB.expD07-May-20242.8 KiB6867

mcblocklistsearch.stdinB.gdbD07-May-2024724 3231

mcblocklistsearch.vgtestD07-May-2024517 1312

mcbreak.stderr.expD07-May-20240 10

mcbreak.stderrB.expD07-May-2024498 1211

mcbreak.stdinB.gdbD07-May-20241.5 KiB7473

mcbreak.stdout.expD07-May-2024303 98

mcbreak.stdoutB.expD07-May-20241.5 KiB5453

mcbreak.vgtestD07-May-2024419 1312

mcclean_after_fork.stderr.expD07-May-2024374 98

mcclean_after_fork.stderrB.expD07-May-2024155 54

mcclean_after_fork.stdinB.gdbD07-May-2024732 2625

mcclean_after_fork.stdoutB.expD07-May-2024401 1312

mcclean_after_fork.vgtestD07-May-2024393 1110

mchelp.stderr.expD07-May-20240 10

mchelp.stderrB.expD07-May-2024146 65

mchelp.stdoutB.expD07-May-20246.9 KiB125124

mchelp.vgtestD07-May-2024356 109

mcinfcallRU.stderr.expD07-May-2024214 54

mcinfcallRU.stderrB.expD07-May-20240 10

mcinfcallRU.stdinB.gdbD07-May-2024799 2019

mcinfcallRU.vgtestD07-May-2024695 1615

mcinfcallWSRU.stderr.expD07-May-2024344 87

mcinfcallWSRU.stderrB.expD07-May-20242 KiB5348

mcinfcallWSRU.stdinB.gdbD07-May-2024934 3029

mcinfcallWSRU.vgtestD07-May-2024775 1716

mcinvokeRU.stderr.expD07-May-20240 10

mcinvokeRU.stderrB.expD07-May-2024481 1514

mcinvokeRU.stdoutB.expD07-May-2024826 2423

mcinvokeRU.vgtestD07-May-2024727 1514

mcinvokeWS.stderr.expD07-May-20240 10

mcinvokeWS.stderrB.expD07-May-2024481 1514

mcinvokeWS.stdoutB.expD07-May-2024826 2423

mcinvokeWS.vgtestD07-May-2024536 1312

mcleak.stderr.expD07-May-20241.5 KiB3635

mcleak.stderrB.expD07-May-20243.8 KiB7978

mcleak.stdinB.gdbD07-May-20242.4 KiB8584

mcleak.stdoutB.expD07-May-20242.1 KiB4939

mcleak.vgtestD07-May-2024549 1413

mcmain_pic.stderr.expD07-May-2024330 87

mcmain_pic.stderr.exp-solarisD07-May-2024340 87

mcmain_pic.stderrB.expD07-May-202485 32

mcmain_pic.stdinB.gdbD07-May-2024333 1716

mcmain_pic.stdout.expD07-May-2024143 54

mcmain_pic.stdoutB.expD07-May-2024355 109

mcmain_pic.vgtestD07-May-2024601 1715

mcsignopass.stderr.expD07-May-2024566 1615

mcsignopass.stderrB.expD07-May-20240 10

mcsignopass.stdinB.gdbD07-May-2024994 4342

mcsignopass.stdoutB.expD07-May-20242 KiB6059

mcsignopass.vgtestD07-May-2024765 1816

mcsigpass.stderr.expD07-May-2024565 1615

mcsigpass.stderrB.expD07-May-20240 10

mcsigpass.stdinB.gdbD07-May-2024495 2826

mcsigpass.stdoutB.expD07-May-2024454 1514

mcsigpass.vgtestD07-May-2024493 1211

mcvabits.stderr.expD07-May-20240 10

mcvabits.stderrB.expD07-May-20242.4 KiB6059

mcvabits.stdinB.gdbD07-May-20242.6 KiB7675

mcvabits.stdoutB.expD07-May-2024347 1210

mcvabits.vgtestD07-May-2024398 1412

mcwatchpoints.stderr.expD07-May-2024637 2322

mcwatchpoints.stderrB.expD07-May-20240 10

mcwatchpoints.stdinB.gdbD07-May-2024615 3433

mcwatchpoints.stdoutB.expD07-May-20241.4 KiB4140

mcwatchpoints.vgtestD07-May-2024563 1513

mssnapshot.stderr.expD07-May-20240 10

mssnapshot.stderrB.expD07-May-20241.4 KiB2827

mssnapshot.stdinB.gdbD07-May-2024413 2423

mssnapshot.stdoutB.expD07-May-2024177 54

mssnapshot.vgtestD07-May-2024352 1211

nlcontrolc.stderr.expD07-May-2024291 127

nlcontrolc.stderrB.expD07-May-20240 10

nlcontrolc.stdinB.gdbD07-May-20241.2 KiB4140

nlcontrolc.stdoutB.expD07-May-2024616 2221

nlcontrolc.vgtestD07-May-20241 KiB2221

nlfork_chain.stderr.expD07-May-202454 201

nlfork_chain.stdout.expD07-May-2024262 1716

nlfork_chain.vgtestD07-May-2024199 54

nlgone_abrt.stderr.expD07-May-202461 63

nlgone_abrt.stderrB.expD07-May-202443 21

nlgone_abrt.stdinB.gdbD07-May-2024226 98

nlgone_abrt.stdoutB.expD07-May-2024171 76

nlgone_abrt.vgtestD07-May-2024380 1412

nlgone_exit.stderr.expD07-May-2024128 105

nlgone_exit.stderrB.expD07-May-202443 21

nlgone_exit.stdinB.gdbD07-May-2024324 1211

nlgone_exit.stdoutB.expD07-May-202441 32

nlgone_exit.vgtestD07-May-2024478 1514

nlgone_return.stderr.expD07-May-2024100 94

nlgone_return.stderrB.expD07-May-202443 21

nlgone_return.stdinB.gdbD07-May-2024186 76

nlgone_return.stdoutB.expD07-May-202437 32

nlgone_return.vgtestD07-May-2024395 1311

nlpasssigalrm.stderr.expD07-May-2024158 116

nlpasssigalrm.stderrB.expD07-May-202485 32

nlpasssigalrm.stdinB.gdbD07-May-2024731 3029

nlpasssigalrm.stdoutB.expD07-May-2024731 2322

nlpasssigalrm.vgtestD07-May-2024557 1614

nlself_invalidate.stderr.expD07-May-202475 92

nlself_invalidate.stderrB.expD07-May-202443 21

nlself_invalidate.stdinB.gdbD07-May-2024414 1514

nlself_invalidate.vgtestD07-May-2024567 1312

nlsigvgdb.stderr.expD07-May-2024118 73

nlsigvgdb.stderrB.expD07-May-2024229 76

nlsigvgdb.stdinB.gdbD07-May-2024518 1816

nlsigvgdb.vgtestD07-May-2024658 1615

nlvgdbsigqueue.stderr.expD07-May-2024314 128

nlvgdbsigqueue.stderrB.expD07-May-20240 10

nlvgdbsigqueue.stdinB.gdbD07-May-20241.4 KiB3433

nlvgdbsigqueue.stdoutB.expD07-May-2024549 1716

nlvgdbsigqueue.stdoutB.exp-solaris1D07-May-2024549 1716

nlvgdbsigqueue.stdoutB.exp-solaris2D07-May-2024567 1817

nlvgdbsigqueue.vgtestD07-May-2024554 1514

passsigalrm.cD07-May-20241.7 KiB7057

self_invalidate.cD07-May-2024914 3932

send_signalD07-May-2024703 3124

simulate_control_cD07-May-2024670 2821

sleepers.cD07-May-20245.5 KiB223189

t.cD07-May-20243.6 KiB155136

watchpoints.cD07-May-20241.8 KiB7548

README_DEVELOPERS

1Automatic regression tests:
2---------------------------
3The Valgrind gdbserver automatic tests are by default
4executed as part of the Valgrind test suite:
5   make regtest
6
7By default, these tests are running with the gdb found at
8Valgrind configure time.
9
10If you want to test with another gdb version, you can do:
11  make regtest GDB=/path/to/another/gdb
12
13or (to just run the gdbserver tests with another gdb):
14  cd gdbserver_tests
15  make check
16  cd ..
17  gdbserver_tests/make_local_links /path/to/another/gdb
18  perl tests/vg_regtest gdbserver_tests
19
20The minimum version to run the tests is gdb >= 6.5.
21    Previous versions do not have the 'target remote |' command.  It
22    would be possible to use an older version by using the option
23    --port of vgdb, and using the tcp/ip variant of the 'target remote'
24    GDB command.
25
26The tests have been run on various platforms using gdb versions >= 7.2
27and on some platforms gdb 7.0 and 7.1.
28Some gdb tests implies a gdb >= 7.2. (these are automatically disabled
29if testing with a lower version).
30Test behaviour with gdb < 7.0 is unknown: some might fail,
31some might block or loop for a very long time.
32
33Some tests implies to have a vgdb "ptrace invoker" capable.
34
35The prerequisite are established during make regtest (using marker files).
36Each test verifies the prerequisite using the prereq: line.
37
38In case of failing tests
39------------------------
40When executed with a new gdb version and/or depending on the OS version,
41gdbserver tests might often fail due to (irrelevant) differences.
42Such irrelevant differences have to be filtered by gdbserver_tests/filter_gdb.
43
44You are welcome to fix such bugs by enhancing filter_gdb.
45
46Alternatively, to report such problems, the best is to re-run
47the gdbserver tests the following way:
48   perl tests/vg_regtest --keep-unfiltered gdbserver_tests
49
50Then file a bug in bugzilla, giving the following information:
51  output of
52    gdbserver_tests/gdb --version
53    uname -a
54    cat /etc/issue
55    valgrind --version (and/or svn version)
56  and attach a tar file containing all the *.out and *.diff
57  files in gdbserver_tests directory
58
59If a gdbserver test fails for other reasons, you can run the test
60manually in two windows:
61  In one window, the valgrind
62  In another window, you launch gdb yourself, and you copy paste
63  the command from xxxx.stdinB.gdb. This might help to see what is
64  wrong.
65
66Another good trick is also to execute the same kind of actions
67using a gdb connected to the gdbserver part of gdb.
68You can examine what is happening by enabling the trace
69of the packets being sent using the gdb command:
70   set debug remote 1
71Note however that the packets might be different
72(e.g. the Valgrind gdbserver understands the 'P' packet,
73which might not be understood by the gdbserver of gdb).
74
75Naming conventions:
76-------------------
77
78The gdbserver tests are done with various Valgrind tools.  A gdbserver
79test using a tool xxxxxx should have its name starting with the 'short
80two letters code' of this tool.  For example, the test mcvabits.vgtest
81is using Memcheck tool, while the test mssnapshot.vgtest is using
82massif tool.
83
84Typically, a gdbserver test implies to launch two programs:
85     prog: a program running under valgrind
86     progB: another program (typically, either gdb or vgdb standalone)
87The conventions about how to specify the 2nd program in a .vgtest
88are explained in the file ../tests/vg_regtest.in
89Many tests are using gdb as progB. The input for gdb is named
90xxxxxx.stdinB.gdb.
91
92One day, we might imagine to run tests in parallel.
93So, each test gets its own '--vgdb-prefix' argument.
94This also help to avoid interactions between two successive tests:
95if a previous test stayed blocked, the vgdb of the next test
96will not report an error due to multiple possible FIFOs.
97
98
99Rational for test approach
100--------------------------
101Two approaches have been looked at:
102  V: use the 'vg_regtest' approach used by the rest of Valgrind tests
103  G: use the gdb Dejagnu test framework.
104
105Advantages of V: much simpler that G, known by Valgrind developers,
106no additional dependency for the Valgrind build and test.
107
108Disadvantages of V: not well suited to testing of interactive tools,
109very unflexible way to test the results (everything is in "template"
110files), templates contains often irrelevant data for the test but it
111can make the test fail.  After writing 13 tests, it looks like the
112template diff approach is quite fragile (e.g. changing the gdb version
113and/or the OS version influences the output of irrelevant things which
114are part of the template).
115
116A more flexible template filtering is needed.
117Maybe something like:
118The program under test is outputting its instructions to be filtered in
119special markers e.g.
120#pushf filter_addresses | filter_messages
121... some output
122#pushf an_additional_filter
123... some other output, filtered by both the first and second push
124#popf
125... here output filtered only by the first pushf
126#popf
127
128Advantages of G: much more powerful, well suited to test a gdb with a
129gdbserver, tests can verify specifically some output without being
130impacted by other output, allow to test Valgrind gdbserver with the
131all of the gdb test suite (but a lot of tests will rather test gdb
132than Valgrind gdbserver).
133
134Disadvantages: not an easy beast to understand and master, running the
135whole gdb testsuite with Valgrind gdbserver looks to be a challenge.
136
137Currently, tests are written with vg_regtest. Approach G will be looked at it
138again (e.g. to complement V) once a basic set of tests are available.
139
140
141Manual tests still to automate:
142-------------------------------
143
144Validate  monitor commands abbreviation recognition
145***************************************************
146mo v.info all_errors            # to show all errors recorded so far
147mo v.i a                        # the same
148mo v                            # must give an error: v can match v.set v.info
149mo v                            # the same            v
150mo v.                           # the same            v.
151
152test of gdb detaching or dying
153******************************
154valgrind --vgdb=yes --vgdb-error=0 --vgdb-poll=500 ./t
155
156in another window
157
158gdb ./t
159set remotetimeout 100
160target remote|vgdb
161detach                         valgrind continues
162target remote|vgdb             reattach
163detach                         valgrind continues
164target remote|vgdb             reattach
165monitor v.wait                 no effect
166
167
168
169test of valgrind/gdb output redirection
170***************************************
171valgrind --vgdb=yes --vgdb-error=1 --vgdb-poll=500 ./t
172
173in another window
174
175**** command to type***         ****** expected behaviour
176gdb ./t
177set remotetimeout 1000
178target remote | vgdb
179mo v.set vgdb-error 1000        # so that valgrind does stop only at error 1000 and after
180mo v.set gdb_output             # to have further valgrind errors output in gdb
181c                               # continue, some errors will appear
182C-c                             # interrupt program
183mo v.set log_output             # to set back the valgrind output to normal process log output
184mo l                            # leak output to appear in log of process
185mo v.set mixed_output
186mo l                            # leak output to appear in gdb
187
188
189
190test with a big executable: firefox
191***********************************
192valgrind --vgdb=yes --vgdb-error=1000 --vgdb-poll=50000 --trace-children=yes firefox 2>&1 | tee f.out
193
194wait for some messages from the "big" firefox executable to appear.
195Then:
196
197gdb /usr/lib/firefox-3.5/firefox
198target remote | vgdb
199... then you can do various next/print/bt/bt full/break/... to see it is working
200
201bulk test with the above
202************************
203to verify there is no race condition/no reentrance problem
204between gdbserver code and valgrind:
205start firefox like in the previous test.
206In another window, do:
207  while true
208  do
209    vgdb leak
210    sleep 1
211  done
212
213NB: this will make firefox run extremely slow, as it will do a leak
214search every second.
215
216
217Test of "jump" functionality
218----------------------------
219... to be done : put two breaks, jump over one.
220... same but when error is encountered
221
222
223* test with --max-invoke-ms=0
224-----------------------------
225valgrind --vgdb=yes ./t
226... wait till you see "petachounok sleeping 4 of 15
227then try to gdb it
228
229!!!! this often causes gdb to report a protocol timeout.
230use gdb set remotetimeout <a big time> to avoid that.
231The symptoms of a timeout are:
232    (gdb) tar rem|vgdb --max-invoke-ms=0
233    Remote debugging using |vgdb --max-invoke-ms=0
234    relaying data between gdb and process 2930
235    Ignoring packet error, continuing...
236    warning: unrecognized item "timeout" in "qSupported" response
237
238* tests of shadow registers
239----------------------------
240Show/modify shadow registers
241