]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/info-proc.exp
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / info-proc.exp
1 # Copyright 2002, 2003, 2004, 2007 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 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
23 if $tracelevel then {
24 strace $tracelevel
25 }
26
27 set prms_id 0
28 set bug_id 0
29
30 set ws "\[ \t\]+"
31
32 set testfile "break"
33 set srcfile ${testfile}.c
34 set srcfile1 ${testfile}1.c
35 set binfile ${objdir}/${subdir}/${testfile}
36
37 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } {
38 untested info-proc.exp
39 return -1
40 }
41
42 if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } {
43 untested info-proc.exp
44 return -1
45 }
46
47 if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } {
48 untested info-proc.exp
49 return -1
50 }
51
52 # Start with a fresh gdb.
53
54 gdb_exit
55 gdb_start
56 gdb_reinitialize_dir $srcdir/$subdir
57 gdb_load ${binfile}
58
59 # Does this gdb support info proc?
60 send_gdb "help info proc\n"
61 gdb_expect {
62 -re "Undefined info command: .proc.. Try .help info.*$gdb_prompt $" {
63 # info proc command not supported -- nothing to test here.
64 unsupported "gdb does not support info proc on this target"
65 return -1;
66 }
67 -re "Show /proc process information about .*$gdb_prompt $" {
68 pass "help info proc"
69 }
70 -re ".*$gdb_prompt $" {
71 fail "help info proc"
72 }
73 timeout {
74 fail "help info proc (timeout)"
75 }
76 }
77
78 gdb_test "info proc" "No current process.*" "info proc without a process"
79
80 if { ! [ runto_main ] } then {
81 untested info-proc.exp
82 return -1
83 }
84
85 gdb_test "info proc" "process ${decimal}.*" "info proc with process"
86
87 gdb_test "info proc mapping" \
88 ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \
89 "info proc mapping"