Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / expand-psymtabs.exp
CommitLineData
88b9d363 1# Copyright 2007-2022 Free Software Foundation, Inc.
5158f3e3
CES
2#
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.
7#
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.
12#
13# You should have received a copy of the GNU General Public License
1cc75e92 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
5158f3e3
CES
15#
16# This file is part of the gdb testsuite.
17
4fe42e7f
JB
18# It's possible to have a program that contains two compilation units
19# for the same source file name, that have code at different lines.
20# For example, in this test, we compile expand-psymtabs.c twice with
21# different preprocessor symbols #defined; the first .o only has
22# 'main' at some earlier source lines, while the second .o only has
23# 'foo' at later source lines. So when setting breakpoints by line
c7a69933 24# number, which full symtab we need depends on the line number in
4fe42e7f
JB
25# question.
26#
27# This test is meant to verify that, even with lazy partial symtab
28# reading in effect, GDB can set breakpoints by line number
29# successfully in either compilation unit.
5158f3e3 30
289f9037 31standard_testfile
5158f3e3
CES
32
33# What compiler are we using?
4c93b1db 34if [get_compiler_info] {
5158f3e3
CES
35 return -1
36}
37
289f9037 38# We intentionally compile the source file in twice.
5b362f04 39if {[prepare_for_testing_full "failed to prepare" \
289f9037
TT
40 [list $testfile debug $srcfile {debug additional_flags=-DFIRST} \
41 $srcfile debug]]} {
42 return -1
5158f3e3
CES
43}
44
5158f3e3 45set foo_bp [gdb_get_line_number "Break here"]
cdc7edd7 46gdb_test "break $foo_bp" "Breakpoint.*" "expand psymtabs"
5158f3e3 47
This page took 2.018456 seconds and 4 git commands to generate.