Add the -file-list-exec-source-files command to MI.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi2-file.exp
1 # Copyright 1999 Free Software Foundation, Inc.
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 2 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
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17 # Please email any bugs, comments, and/or additions to this file to:
18 # bug-gdb@prep.ai.mit.edu
19
20 #
21 # Test essential Machine interface (MI) operations
22 #
23 # Verify that, using the MI, we can run a simple program and perform basic
24 # debugging activities like: insert breakpoints, run the program,
25 # step, next, continue until it ends and, last but not least, quit.
26 #
27 # The goal is not to test gdb functionality, which is done by other tests,
28 # but to verify the correct output response to MI operations.
29 #
30
31 load_lib mi-support.exp
32 set MIFLAGS "-i=mi2"
33
34 gdb_exit
35 if [mi_gdb_start] {
36 continue
37 }
38
39 set testfile "basics"
40 set srcfile ${testfile}.c
41 set binfile ${objdir}/${subdir}/${testfile}
42 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
43 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
44 }
45
46 mi_delete_breakpoints
47 mi_gdb_reinitialize_dir $srcdir/$subdir
48 mi_gdb_load ${binfile}
49
50 proc test_file_list_exec_source_file {} {
51 global srcfile
52 global srcdir
53 global subdir
54 set srcfilepath [string_to_regexp ${srcdir}/${subdir}/${srcfile}]
55
56 # get the path and absolute path to the current executable
57 mi_gdb_test "111-file-list-exec-source-file" \
58 "111\\\^done,line=\"23\",file=\"${srcfilepath}\",fullname=\"/.*/${srcfile}\"" \
59 "request path info of current source file (${srcfile})"
60 }
61
62 proc test_file_list_exec_source_files {} {
63 global srcfile
64
65 # get the path and absolute path to the current executable
66 mi_gdb_test "222-file-list-exec-source-files" \
67 "222\\\^done,files=\\\[\{file=\".*/${srcfile}\",fullname=\"/.*/${srcfile}\"\},\{file=\".*\"\},\{file=\".*\"\},\{file=\".*\"\},\{file=\".*\"\}\\\]" \
68 "Getting a list of source files."
69 }
70
71 test_file_list_exec_source_file
72 test_file_list_exec_source_files
73
74 mi_gdb_exit
75 return 0
This page took 0.036642 seconds and 5 git commands to generate.