Update copyright year range in all GDB files.
[binutils-gdb.git] / gdb / testsuite / gdb.perf / disassemble.exp
blob948602d3869ced466ccffa2c87e008e547333359
1 # Copyright (C) 2013-2020 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 # This test case is to test the speed of GDB when it is doing disassemble
17 # some large functions in GDB.
18 load_lib perftest.exp
20 if [skip_perf_tests] {
21     return 0
24 global GDB
26 standard_testfile .c
27 # Overwrite $binfile
28 set binfile $GDB
30 PerfTest::assemble {
31     # Don't have compilation step.
32     return 0
33 } {
34     global srcdir subdir
35     global binfile
37     gdb_exit
38     gdb_start
39     gdb_reinitialize_dir $srcdir/$subdir
41     # When GDB is debugging GDB, the prompt is changed to "(top-gdb) ".
42     # In order to avoid the confusion of pattern matching, set the
43     # gdb_prompt to '(top-gdb)' temporarily.
44     with_gdb_prompt "(top-gdb)" {
45         gdb_load ${binfile}
46     }
48     # The prompt of both parent GDB and child GDB is '(gdb)', but
49     # child GDB's prompt doesn't confuse pattern matching because but
50     # we only run to main function of child GDB, so child GDB's
51     # prompt can't be printed out.
52     if ![runto_main] {
53         return -1
54     }
56     return 0
57 } {
58     gdb_test "python Disassemble\(\).run()"
59     return 0