ChangeLog:
[external/binutils.git] / gdb / testsuite / gdb.base / info-proc.exp
1 # Copyright 2002-2004, 2007-2012 Free Software Foundation, Inc.
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 3 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, see <http://www.gnu.org/licenses/>.
15
16 # This file was written by Michael Snyder (msnyder@redhat.com)
17 # This is a test for the gdb command "info proc"
18
19 set ws "\[ \t\]+"
20
21 set testfile "break"
22 set srcfile ${testfile}.c
23 set srcfile1 ${testfile}1.c
24 set binfile ${objdir}/${subdir}/${testfile}
25
26 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
27      untested info-proc.exp
28      return -1
29 }
30
31 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
32      untested info-proc.exp
33      return -1
34 }
35
36 if  { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
37      untested info-proc.exp
38      return -1
39 }
40
41 # Start with a fresh gdb.
42
43 gdb_exit
44 gdb_start
45 gdb_reinitialize_dir $srcdir/$subdir
46 gdb_load ${binfile}
47
48 gdb_test "help info proc" "Show /proc process information about .*"
49
50 gdb_test "info proc" "No current process.*" "info proc without a process"
51
52 if { ! [ runto_main ] } then {
53     untested info-proc.exp
54     return -1
55 }
56
57 # Does this gdb support info proc?
58 gdb_test_multiple "info proc" "info proc" {
59     -re "Not supported on this target.*$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 "process ${decimal}.*$gdb_prompt $" {
65         pass "info proc with process"
66     }
67 }
68
69 gdb_test "info proc mapping" \
70         ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \
71         "info proc mapping"