2006-03-07 Paul Brook <paul@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / info-proc.exp
CommitLineData
3ad13771 1# Copyright 2002, 2003, 2004 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
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# This file was written by Michael Snyder (msnyder@redhat.com)
21# This is a test for the gdb command "info proc"
22
23if $tracelevel then {
24 strace $tracelevel
25}
26
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}] != "" } {
a1dea79a
FF
38 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
39}
40
fc91c6c2 41if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
a1dea79a
FF
42 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
43}
44
fc91c6c2 45if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
ca4976a6
MS
46 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
47}
48
49# Start with a fresh gdb.
50
51gdb_exit
52gdb_start
53gdb_reinitialize_dir $srcdir/$subdir
54gdb_load ${binfile}
55
56# Does this gdb support info proc?
57send_gdb "help info proc\n"
58gdb_expect {
59 -re "Undefined info command: .proc.. Try .help info.*$gdb_prompt $" {
60 # info proc command not supported -- nothing to test here.
61 unsupported "gdb does not support info proc on this target"
62 return -1;
63 }
64 -re "Show /proc process information about .*$gdb_prompt $" {
65 pass "help info proc"
66 }
67 -re ".*$gdb_prompt $" {
68 fail "help info proc"
69 }
70 timeout {
71 fail "help info proc (timeout)"
72 }
73}
74
75gdb_test "info proc" "No current process.*" "info proc without a process"
76
3ad13771 77if { ! [ runto_main ] } then {
ca4976a6
MS
78 gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
79}
80
81gdb_test "info proc" "process ${decimal}.*" "info proc with process"
82
83gdb_test "info proc mapping" \
84 ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \
85 "info proc mapping"
This page took 0.535467 seconds and 4 git commands to generate.