mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 09:58:19 +08:00
* lib/gdb.exp (gdb_get_line_number): Throw an
error instead of returning -1. * gdb.base/break.exp: Remove unused variable bp_location5. * gdb.base/hbreak2.exp: Likewise. * gdb.base/sepdebug.exp: Likewise.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2012-03-08 Keith Seitz <keiths@redhat.com>
|
||||||
|
|
||||||
|
* lib/gdb.exp (gdb_get_line_number): Throw an
|
||||||
|
error instead of returning -1.
|
||||||
|
* gdb.base/break.exp: Remove unused variable
|
||||||
|
bp_location5.
|
||||||
|
* gdb.base/hbreak2.exp: Likewise.
|
||||||
|
* gdb.base/sepdebug.exp: Likewise.
|
||||||
|
|
||||||
2012-03-08 Yao Qi <yao@codesourcery.com>
|
2012-03-08 Yao Qi <yao@codesourcery.com>
|
||||||
Pedro Alves <palves@redhat.com>
|
Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
@ -115,7 +115,6 @@ gdb_test "break multi_line_while_conditional" \
|
|||||||
"Breakpoint.*at.* file .*$srcfile, line $bp_location4\\." \
|
"Breakpoint.*at.* file .*$srcfile, line $bp_location4\\." \
|
||||||
"breakpoint at start of multi line while conditional"
|
"breakpoint at start of multi line while conditional"
|
||||||
|
|
||||||
set bp_location5 [gdb_get_line_number "set breakpoint 5 here"]
|
|
||||||
set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
|
set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
|
||||||
|
|
||||||
set main_line $bp_location6
|
set main_line $bp_location6
|
||||||
|
@ -130,7 +130,6 @@ gdb_test "hbreak multi_line_while_conditional" \
|
|||||||
"Hardware assisted breakpoint.*at.* file .*$srcfile, line $bp_location4\\." \
|
"Hardware assisted breakpoint.*at.* file .*$srcfile, line $bp_location4\\." \
|
||||||
"hardware breakpoint at start of multi line while conditional"
|
"hardware breakpoint at start of multi line while conditional"
|
||||||
|
|
||||||
set bp_location5 [gdb_get_line_number "set breakpoint 5 here"]
|
|
||||||
set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
|
set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
|
||||||
|
|
||||||
set main_line $bp_location6
|
set main_line $bp_location6
|
||||||
|
@ -150,7 +150,6 @@ gdb_test "break multi_line_while_conditional" \
|
|||||||
"Breakpoint.*at.* file .*$srcfile, line $bp_location4\\." \
|
"Breakpoint.*at.* file .*$srcfile, line $bp_location4\\." \
|
||||||
"breakpoint at start of multi line while conditional"
|
"breakpoint at start of multi line while conditional"
|
||||||
|
|
||||||
set bp_location5 [gdb_get_line_number "set breakpoint 5 here"]
|
|
||||||
set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
|
set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
|
||||||
|
|
||||||
set main_line $bp_location6
|
set main_line $bp_location6
|
||||||
|
@ -3243,7 +3243,7 @@ proc setup_kfail_for_target { PR target } {
|
|||||||
# gdb_get_line_number TEXT [FILE]
|
# gdb_get_line_number TEXT [FILE]
|
||||||
#
|
#
|
||||||
# Search the source file FILE, and return the line number of the
|
# Search the source file FILE, and return the line number of the
|
||||||
# first line containing TEXT. If no match is found, return -1.
|
# first line containing TEXT. If no match is found, an error is thrown.
|
||||||
#
|
#
|
||||||
# TEXT is a string literal, not a regular expression.
|
# TEXT is a string literal, not a regular expression.
|
||||||
#
|
#
|
||||||
@ -3316,15 +3316,13 @@ proc gdb_get_line_number { text { file "" } } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if { [ catch { set fd [open "$file"] } message ] } then {
|
if { [ catch { set fd [open "$file"] } message ] } then {
|
||||||
perror "$message"
|
error "$message"
|
||||||
return -1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set found -1
|
set found -1
|
||||||
for { set line 1 } { 1 } { incr line } {
|
for { set line 1 } { 1 } { incr line } {
|
||||||
if { [ catch { set nchar [gets "$fd" body] } message ] } then {
|
if { [ catch { set nchar [gets "$fd" body] } message ] } then {
|
||||||
perror "$message"
|
error "$message"
|
||||||
return -1
|
|
||||||
}
|
}
|
||||||
if { $nchar < 0 } then {
|
if { $nchar < 0 } then {
|
||||||
break
|
break
|
||||||
@ -3336,8 +3334,11 @@ proc gdb_get_line_number { text { file "" } } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if { [ catch { close "$fd" } message ] } then {
|
if { [ catch { close "$fd" } message ] } then {
|
||||||
perror "$message"
|
error "$message"
|
||||||
return -1
|
}
|
||||||
|
|
||||||
|
if {$found == -1} {
|
||||||
|
error "undefined tag \"$text\""
|
||||||
}
|
}
|
||||||
|
|
||||||
return $found
|
return $found
|
||||||
|
Reference in New Issue
Block a user