OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.trace/] [tracecmd.exp] - Blame information for rev 178

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
#   Copyright 1998, 2007, 2008 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 .
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@cygnus.com)
20
 
21
load_lib "trace-support.exp";
22
 
23
if $tracelevel then {
24
    strace $tracelevel
25
}
26
 
27
set prms_id 0
28
set bug_id 0
29
 
30
gdb_exit
31
gdb_start
32
if [istarget "m68k-*-elf"] then {
33
    set srcfile gdb_c_test.c
34
    set binfile [board_info target d490_binfile];
35
} else {
36
    set testfile "actions"
37
    set srcfile ${testfile}.c
38
    set binfile $objdir/$subdir/$testfile
39
    if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
40
            executable {debug nowarnings}] != "" } {
41
        untested tracecmd.exp
42
        return -1
43
    }
44
}
45
gdb_reinitialize_dir $srcdir/$subdir
46
 
47
# If testing on a remote host, download the source file.
48
# remote_download host $srcdir/$subdir/$srcfile
49
 
50
gdb_file_cmd $binfile
51
 
52
# define relative source line numbers:
53
# all subsequent line numbers are relative to this first one (baseline)
54
set baseline  [gdb_find_recursion_test_baseline $srcfile];
55
if { $baseline == -1 } then {
56
    fail "Could not find gdb_recursion_test function"
57
    return;
58
}
59
 
60
set testline1 [expr $baseline + 1]
61
set testline2 [expr $baseline + 3]
62
 
63
#
64
# test "help tracepoints"
65
#
66
 
67
set helpcnt 0;
68
test_class_help "tracepoints" {
69
    "Tracing of program execution without stopping the program\.[\r\n\]+"
70
} "1.0: help tracepoints"
71
 
72
#
73
# test trace command:
74
#
75
 
76
# 1.1 trace source line
77
gdb_delete_tracepoints
78
gdb_test "trace $srcfile:$testline2" \
79
        "Tracepoint $decimal at $hex: file.*$srcfile, line $testline2." \
80
        "1.1a: set tracepoint at sourceline"
81
gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2" \
82
        "1.1b: trace sourcefile:line"
83
 
84
# 1.2 trace invalid source line
85
gdb_delete_tracepoints
86
gdb_test "trace $srcfile:99999" "No line 99999 in file \".*$srcfile\"." \
87
        "1.2a: trace invalid line in sourcefile"
88
gdb_test "info trace" "No tracepoints.*" \
89
        "1.2b: reject invalid line in srcfile"
90
 
91
# 1.3 trace line in invalid source file
92
gdb_delete_tracepoints
93
gdb_test "trace NoSuChFiLe.c:1" "No source file named NoSuChFiLe.c." \
94
        "1.3a: trace invalid source file"
95
gdb_test "info trace" "No tracepoints.*" \
96
        "1.3b: reject invalid srcfile"
97
 
98
# 1.4 trace function by name
99
gdb_delete_tracepoints
100
gdb_test "trace gdb_recursion_test" \
101
        "Tracepoint $decimal at $hex: file.*$srcfile, line $testline1." \
102
        "1.4a: trace function by name"
103
gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1" \
104
        "1.4b: trace function by name"
105
 
106
# 1.5 trace non-existant function
107
gdb_delete_tracepoints
108
gdb_test "trace NoSuChFuNc" "Function \"NoSuChFuNc\" not defined." \
109
        "1.5a: trace invalid function"
110
gdb_test "info trace" "No tracepoints.*" \
111
        "1.5b: reject invalid srcfile"
112
 
113
# 1.6 trace at a specific address
114
#     Collect the address of "gdb_asm_test", and use that.
115
send_gdb "print gdb_asm_test\n"
116
gdb_expect {
117
    -re "\[$\]\[0-9\].*0x(\[0-9a-fA-F\]+).*$gdb_prompt $" {
118
        set asm_test_addr $expect_out(1,string)
119
    }
120
    timeout { }
121
}
122
 
123
gdb_delete_tracepoints
124
gdb_test "trace \*0x$asm_test_addr" \
125
        "Tracepoint $decimal at .*$asm_test_addr.*" \
126
        "1.6a: trace at specific address"
127
gdb_test "info trace" "$asm_test_addr.*gdb_asm_test.*" \
128
        "1.6b: verify trace at specific address"
129
 
130
# 1.7 trace at function's exact address
131
#     Collect the address of the function for comparison
132
send_gdb "print gdb_recursion_test\n"
133
gdb_expect {
134
    -re "\[$\]\[0-9\].*0x(\[0-9a-fA-F\]+).*$gdb_prompt $" {
135
        set c_test_addr $expect_out(1,string)
136
    }
137
    timeout { }
138
}
139
 
140
gdb_delete_tracepoints
141
gdb_test "trace \*gdb_recursion_test" \
142
        "Tracepoint $decimal at .*$c_test_addr.*" \
143
        "1.7a: trace at function label (before prologue)"
144
gdb_test "info trace" "$c_test_addr.*in gdb_recursion_test.*:$baseline" \
145
        "1.7b: verify trace at specific address"
146
 
147
# 1.8 trace at invalid address
148
# no address is invalid
149
 
150
# 1.9 trace no arguments
151
gdb_test "trace" "trace command requires an argument" \
152
        "1.9: trace "
153
 
154
# 1.10 set large number of tracepoints
155
# deferred to limits test module
156
 
157
# 1.11 tracepoint conditions
158
# conditions on tracepoints not implemented
159
 
160
# 1.12 set tracepoint in prologue
161
# [see tfind.exp]
162
 
163
# 1.13 trace on recursion
164
# interesting only in "live" session: see backtrace.exp for live test.
165
 
166
# 1.14 help trace
167
gdb_test "help trace" "Set a tracepoint at .*" "1.14: help trace"
168
 
169
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.