run copyright.sh for 2011.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / info-proc.exp
CommitLineData
7b6bb8da 1# Copyright 2002, 2003, 2004, 2007, 2008, 2009, 2010, 2011
4c38e0a4 2# Free Software Foundation, Inc.
ca4976a6
MS
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
e22f8b7c 6# the Free Software Foundation; either version 3 of the License, or
ca4976a6 7# (at your option) any later version.
e22f8b7c 8#
ca4976a6
MS
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
e22f8b7c 13#
ca4976a6 14# You should have received a copy of the GNU General Public License
e22f8b7c 15# along with this program. If not, see <http://www.gnu.org/licenses/>.
ca4976a6 16
ca4976a6
MS
17# This file was written by Michael Snyder (msnyder@redhat.com)
18# This is a test for the gdb command "info proc"
19
20if $tracelevel then {
21 strace $tracelevel
22}
23
069ed931
UW
24if { [is_remote target] } then {
25 continue
26}
27
ca4976a6 28
ca4976a6
MS
29set ws "\[ \t\]+"
30
a1dea79a
FF
31set testfile "break"
32set srcfile ${testfile}.c
33set srcfile1 ${testfile}1.c
34set binfile ${objdir}/${subdir}/${testfile}
35
fc91c6c2 36if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
b60f0898
JB
37 untested info-proc.exp
38 return -1
a1dea79a
FF
39}
40
fc91c6c2 41if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
b60f0898
JB
42 untested info-proc.exp
43 return -1
a1dea79a
FF
44}
45
fc91c6c2 46if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
b60f0898
JB
47 untested info-proc.exp
48 return -1
ca4976a6
MS
49}
50
51# Start with a fresh gdb.
52
53gdb_exit
54gdb_start
55gdb_reinitialize_dir $srcdir/$subdir
56gdb_load ${binfile}
57
58# Does this gdb support info proc?
a76e022a 59gdb_test_multiple "help info proc" "help info proc" {
ca4976a6
MS
60 -re "Undefined info command: .proc.. Try .help info.*$gdb_prompt $" {
61 # info proc command not supported -- nothing to test here.
62 unsupported "gdb does not support info proc on this target"
63 return -1;
64 }
65 -re "Show /proc process information about .*$gdb_prompt $" {
66 pass "help info proc"
67 }
ca4976a6
MS
68}
69
70gdb_test "info proc" "No current process.*" "info proc without a process"
71
3ad13771 72if { ! [ runto_main ] } then {
b60f0898
JB
73 untested info-proc.exp
74 return -1
ca4976a6
MS
75}
76
77gdb_test "info proc" "process ${decimal}.*" "info proc with process"
78
79gdb_test "info proc mapping" \
80 ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \
81 "info proc mapping"
This page took 0.935349 seconds and 4 git commands to generate.