Add dwarf2_per_bfd::start_reading
[binutils-gdb.git] / gdb / testsuite / gdb.perf / disassemble.exp
blob740ffe3410f2fdb9bbda77278cd0acbdb857752e
1 # Copyright (C) 2013-2024 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 require allow_perf_tests
22 global GDB
24 standard_testfile .c
25 # Overwrite $binfile
26 set binfile $GDB
28 PerfTest::assemble {
29     # Don't have compilation step.
30     return 0
31 } {
32     global binfile
34     clean_restart
36     # When GDB is debugging GDB, the prompt is changed to "(top-gdb) ".
37     # In order to avoid the confusion of pattern matching, set the
38     # gdb_prompt to '(top-gdb)' temporarily.
39     with_gdb_prompt "(top-gdb)" {
40         gdb_load ${binfile}
41     }
43     # The prompt of both parent GDB and child GDB is '(gdb)', but
44     # child GDB's prompt doesn't confuse pattern matching because but
45     # we only run to main function of child GDB, so child GDB's
46     # prompt can't be printed out.
47     if ![runto_main] {
48         return -1
49     }
51     return 0
52 } {
53     gdb_test_python_run "Disassemble\(\)"
54     return 0