Commit | Line | Data |
---|---|---|
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 | |
e22f8b7c | 5 | # the Free Software Foundation; either version 3 of the License, or |
ca4976a6 | 6 | # (at your option) any later version. |
e22f8b7c | 7 | # |
ca4976a6 MS |
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. | |
e22f8b7c | 12 | # |
ca4976a6 | 13 | # You should have received a copy of the GNU General Public License |
e22f8b7c | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
ca4976a6 MS |
15 | |
16 | # Please email any bugs, comments, and/or additions to this file to: | |
17 | # bug-gdb@prep.ai.mit.edu | |
18 | ||
19 | # This file was written by Michael Snyder (msnyder@redhat.com) | |
20 | # This is a test for the gdb command "info proc" | |
21 | ||
22 | if $tracelevel then { | |
23 | strace $tracelevel | |
24 | } | |
25 | ||
069ed931 UW |
26 | if { [is_remote target] } then { |
27 | continue | |
28 | } | |
29 | ||
ca4976a6 MS |
30 | set prms_id 0 |
31 | set bug_id 0 | |
32 | ||
ca4976a6 MS |
33 | set ws "\[ \t\]+" |
34 | ||
a1dea79a FF |
35 | set testfile "break" |
36 | set srcfile ${testfile}.c | |
37 | set srcfile1 ${testfile}1.c | |
38 | set binfile ${objdir}/${subdir}/${testfile} | |
39 | ||
fc91c6c2 | 40 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug nowarnings}] != "" } { |
b60f0898 JB |
41 | untested info-proc.exp |
42 | return -1 | |
a1dea79a FF |
43 | } |
44 | ||
fc91c6c2 | 45 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug nowarnings}] != "" } { |
b60f0898 JB |
46 | untested info-proc.exp |
47 | return -1 | |
a1dea79a FF |
48 | } |
49 | ||
fc91c6c2 | 50 | if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug nowarnings}] != "" } { |
b60f0898 JB |
51 | untested info-proc.exp |
52 | return -1 | |
ca4976a6 MS |
53 | } |
54 | ||
55 | # Start with a fresh gdb. | |
56 | ||
57 | gdb_exit | |
58 | gdb_start | |
59 | gdb_reinitialize_dir $srcdir/$subdir | |
60 | gdb_load ${binfile} | |
61 | ||
62 | # Does this gdb support info proc? | |
63 | send_gdb "help info proc\n" | |
64 | gdb_expect { | |
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" | |
68 | return -1; | |
69 | } | |
70 | -re "Show /proc process information about .*$gdb_prompt $" { | |
71 | pass "help info proc" | |
72 | } | |
73 | -re ".*$gdb_prompt $" { | |
74 | fail "help info proc" | |
75 | } | |
76 | timeout { | |
77 | fail "help info proc (timeout)" | |
78 | } | |
79 | } | |
80 | ||
81 | gdb_test "info proc" "No current process.*" "info proc without a process" | |
82 | ||
3ad13771 | 83 | if { ! [ runto_main ] } then { |
b60f0898 JB |
84 | untested info-proc.exp |
85 | return -1 | |
ca4976a6 MS |
86 | } |
87 | ||
88 | gdb_test "info proc" "process ${decimal}.*" "info proc with process" | |
89 | ||
90 | gdb_test "info proc mapping" \ | |
91 | ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \ | |
92 | "info proc mapping" |