]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/info-proc.exp
config:
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / info-proc.exp
CommitLineData
0fb0cc75 1# Copyright 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
ca4976a6
MS
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
ca4976a6 6# (at your option) any later version.
e22f8b7c 7#
ca4976a6
MS
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.
e22f8b7c 12#
ca4976a6 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
ca4976a6 15
ca4976a6
MS
16# This file was written by Michael Snyder (msnyder@redhat.com)
17# This is a test for the gdb command "info proc"
18
19if $tracelevel then {
20 strace $tracelevel
21}
22
069ed931
UW
23if { [is_remote target] } then {
24 continue
25}
26
ca4976a6
MS
27set prms_id 0
28set bug_id 0
29
ca4976a6
MS
30set ws "\[ \t\]+"
31
a1dea79a
FF
32set testfile "break"
33set srcfile ${testfile}.c
34set srcfile1 ${testfile}1.c
35set binfile ${objdir}/${subdir}/${testfile}
36
fc91c6c2 37if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
b60f0898
JB
38 untested info-proc.exp
39 return -1
a1dea79a
FF
40}
41
fc91c6c2 42if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
b60f0898
JB
43 untested info-proc.exp
44 return -1
a1dea79a
FF
45}
46
fc91c6c2 47if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
b60f0898
JB
48 untested info-proc.exp
49 return -1
ca4976a6
MS
50}
51
52# Start with a fresh gdb.
53
54gdb_exit
55gdb_start
56gdb_reinitialize_dir $srcdir/$subdir
57gdb_load ${binfile}
58
59# Does this gdb support info proc?
60send_gdb "help info proc\n"
61gdb_expect {
62 -re "Undefined info command: .proc.. Try .help info.*$gdb_prompt $" {
63 # info proc command not supported -- nothing to test here.
64 unsupported "gdb does not support info proc on this target"
65 return -1;
66 }
67 -re "Show /proc process information about .*$gdb_prompt $" {
68 pass "help info proc"
69 }
70 -re ".*$gdb_prompt $" {
71 fail "help info proc"
72 }
73 timeout {
74 fail "help info proc (timeout)"
75 }
76}
77
78gdb_test "info proc" "No current process.*" "info proc without a process"
79
3ad13771 80if { ! [ runto_main ] } then {
b60f0898
JB
81 untested info-proc.exp
82 return -1
ca4976a6
MS
83}
84
85gdb_test "info proc" "process ${decimal}.*" "info proc with process"
86
87gdb_test "info proc mapping" \
88 ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \
89 "info proc mapping"