Switch the license of all .c files to GPLv3.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / info-proc.exp
CommitLineData
6aba47ca 1# Copyright 2002, 2003, 2004, 2007 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
069ed931
UW
27if { [is_remote target] } then {
28 continue
29}
30
ca4976a6
MS
31set prms_id 0
32set bug_id 0
33
ca4976a6
MS
34set ws "\[ \t\]+"
35
a1dea79a
FF
36set testfile "break"
37set srcfile ${testfile}.c
38set srcfile1 ${testfile}1.c
39set binfile ${objdir}/${subdir}/${testfile}
40
fc91c6c2 41if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
b60f0898
JB
42 untested info-proc.exp
43 return -1
a1dea79a
FF
44}
45
fc91c6c2 46if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
b60f0898
JB
47 untested info-proc.exp
48 return -1
a1dea79a
FF
49}
50
fc91c6c2 51if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
b60f0898
JB
52 untested info-proc.exp
53 return -1
ca4976a6
MS
54}
55
56# Start with a fresh gdb.
57
58gdb_exit
59gdb_start
60gdb_reinitialize_dir $srcdir/$subdir
61gdb_load ${binfile}
62
63# Does this gdb support info proc?
64send_gdb "help info proc\n"
65gdb_expect {
66 -re "Undefined info command: .proc.. Try .help info.*$gdb_prompt $" {
67 # info proc command not supported -- nothing to test here.
68 unsupported "gdb does not support info proc on this target"
69 return -1;
70 }
71 -re "Show /proc process information about .*$gdb_prompt $" {
72 pass "help info proc"
73 }
74 -re ".*$gdb_prompt $" {
75 fail "help info proc"
76 }
77 timeout {
78 fail "help info proc (timeout)"
79 }
80}
81
82gdb_test "info proc" "No current process.*" "info proc without a process"
83
3ad13771 84if { ! [ runto_main ] } then {
b60f0898
JB
85 untested info-proc.exp
86 return -1
ca4976a6
MS
87}
88
89gdb_test "info proc" "process ${decimal}.*" "info proc with process"
90
91gdb_test "info proc mapping" \
92 ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \
93 "info proc mapping"
This page took 0.588205 seconds and 4 git commands to generate.