1 # Copyright (C) 2022-2023 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 file is part of the GDB testsuite. It checks for memory leaks
17 # associated with allocating and deallocation gdb.Inferior objects.
19 load_lib gdb-python.exp
23 save_vars { env(TERM) } {
24 # We need an ANSI-capable terminal to get the output, additionally
25 # we need to set LC_ALL so GDB knows the terminal is UTF-8
26 # capable, otherwise we'll get a UnicodeEncodeError trying to
30 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
34 if { [skip_python_tests] } { continue }
36 if { ![gdb_py_module_available "pygments"] } {
37 unsupported "pygments module not available"
45 gdb_test_no_output "maint set gnu-source-highlight enabled off"
47 gdb_test "maint flush source-cache" "Source cache flushed\\."
49 set seen_style_escape false
50 set line_number [gdb_get_line_number "List this line."]
51 gdb_test_multiple "list ${line_number}" "" {
52 -re "Python Exception.*" {
56 set seen_style_escape true
60 gdb_assert { $seen_style_escape }