ChangeLog:
[deliverable/binutils-gdb.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 if { [is_remote target] } then {
20 continue
21 }
22
23
24 set ws "\[ \t\]+"
25
26 set testfile "break"
27 set srcfile ${testfile}.c
28 set srcfile1 ${testfile}1.c
29 set binfile ${objdir}/${subdir}/${testfile}
30
31 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
32 untested info-proc.exp
33 return -1
34 }
35
36 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
37 untested info-proc.exp
38 return -1
39 }
40
41 if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
42 untested info-proc.exp
43 return -1
44 }
45
46 # Start with a fresh gdb.
47
48 gdb_exit
49 gdb_start
50 gdb_reinitialize_dir $srcdir/$subdir
51 gdb_load ${binfile}
52
53 # Does this gdb support info proc?
54 gdb_test_multiple "help info proc" "help info proc" {
55 -re "Undefined info command: .proc.. Try .help info.*$gdb_prompt $" {
56 # info proc command not supported -- nothing to test here.
57 unsupported "gdb does not support info proc on this target"
58 return -1;
59 }
60 -re "Show /proc process information about .*$gdb_prompt $" {
61 pass "help info proc"
62 }
63 }
64
65 gdb_test "info proc" "No current process.*" "info proc without a process"
66
67 if { ! [ runto_main ] } then {
68 untested info-proc.exp
69 return -1
70 }
71
72 gdb_test "info proc" "process ${decimal}.*" "info proc with process"
73
74 gdb_test "info proc mapping" \
75 ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \
76 "info proc mapping"
This page took 0.036341 seconds and 4 git commands to generate.