Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / info-proc.exp
CommitLineData
9b254dd1 1# Copyright 2002, 2003, 2004, 2007, 2008 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
MS
15
16# Please email any bugs, comments, and/or additions to this file to:
17# bug-gdb@prep.ai.mit.edu
18
19# This file was written by Michael Snyder (msnyder@redhat.com)
20# This is a test for the gdb command "info proc"
21
22if $tracelevel then {
23 strace $tracelevel
24}
25
069ed931
UW
26if { [is_remote target] } then {
27 continue
28}
29
ca4976a6
MS
30set prms_id 0
31set bug_id 0
32
ca4976a6
MS
33set ws "\[ \t\]+"
34
a1dea79a
FF
35set testfile "break"
36set srcfile ${testfile}.c
37set srcfile1 ${testfile}1.c
38set binfile ${objdir}/${subdir}/${testfile}
39
fc91c6c2 40if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
b60f0898
JB
41 untested info-proc.exp
42 return -1
a1dea79a
FF
43}
44
fc91c6c2 45if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
b60f0898
JB
46 untested info-proc.exp
47 return -1
a1dea79a
FF
48}
49
fc91c6c2 50if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
b60f0898
JB
51 untested info-proc.exp
52 return -1
ca4976a6
MS
53}
54
55# Start with a fresh gdb.
56
57gdb_exit
58gdb_start
59gdb_reinitialize_dir $srcdir/$subdir
60gdb_load ${binfile}
61
62# Does this gdb support info proc?
63send_gdb "help info proc\n"
64gdb_expect {
65 -re "Undefined info command: .proc.. Try .help info.*$gdb_prompt $" {
66 # info proc command not supported -- nothing to test here.
67 unsupported "gdb does not support info proc on this target"
68 return -1;
69 }
70 -re "Show /proc process information about .*$gdb_prompt $" {
71 pass "help info proc"
72 }
73 -re ".*$gdb_prompt $" {
74 fail "help info proc"
75 }
76 timeout {
77 fail "help info proc (timeout)"
78 }
79}
80
81gdb_test "info proc" "No current process.*" "info proc without a process"
82
3ad13771 83if { ! [ runto_main ] } then {
b60f0898
JB
84 untested info-proc.exp
85 return -1
ca4976a6
MS
86}
87
88gdb_test "info proc" "process ${decimal}.*" "info proc with process"
89
90gdb_test "info proc mapping" \
91 ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \
92 "info proc mapping"
This page took 0.586499 seconds and 4 git commands to generate.