1 # Copyright 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
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 3 of the License, or
6 # (at your option) any later version.
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.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 # Please email any bugs, comments, and/or additions to this file to:
17 # bug-gdb@prep.ai.mit.edu
19 # This file was written by Michael Snyder (msnyder@redhat.com)
20 # This is a test for the gdb command "info proc"
26 if { [is_remote target] } then {
36 set srcfile ${testfile}.c
37 set srcfile1 ${testfile}1.c
38 set binfile ${objdir}/${subdir}/${testfile}
40 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
41 untested info-proc.exp
45 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
46 untested info-proc.exp
50 if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
51 untested info-proc.exp
55 # Start with a fresh gdb.
59 gdb_reinitialize_dir $srcdir/$subdir
62 # Does this gdb support info proc?
63 send_gdb "help info proc\n"
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"
70 -re "Show /proc process information about .*$gdb_prompt $" {
73 -re ".*$gdb_prompt $" {
77 fail "help info proc (timeout)"
81 gdb_test "info proc" "No current process.*" "info proc without a process"
83 if { ! [ runto_main ] } then {
84 untested info-proc.exp
88 gdb_test "info proc" "process ${decimal}.*" "info proc with process"
90 gdb_test "info proc mapping" \
91 ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \