[python] Consistently use $srcfile in py-breakpoint.exp
Commit Message
This patch replaces py-breakpoint.exp's inconsistent use of string
literals for source file name checks and replaces all instances
with checks against $srcfile.
Cheers,
Phil
2018-04-30 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-breakpoint.exp (test_bkpt_basic): Use $srcfile
over hard-coded test inferior source name.
(test_bkpt_invisible): Ditto.
(test_bkpt_temporary): Ditto.
--
Comments
On 04/30/2018 01:04 PM, Phil Muldoon wrote:
> This patch replaces py-breakpoint.exp's inconsistent use of string
> literals for source file name checks and replaces all instances
> with checks against $srcfile.
Nit: I think there's one "replaces" too many above. I think
something like this would be clearer:
This patch fixes py-breakpoint.exp's inconsistent use of both
string literals and $srcfile for source file name checks by
using $srcfile throughout.
OK with that fixed. Please push.
Thanks,
Pedro Alves
@@ -70,7 +70,7 @@ proc_with_prefix test_bkpt_basic { } {
"<gdb.Breakpoint object at $hex>" "Check obj exists @mult_line"
gdb_test "python print (blist\[1\].location)" \
- "py-breakpoint\.c:${mult_line}*" \
+ "$srcfile:${mult_line}*" \
"check breakpoint location @mult_line"
# Check hit and ignore counts.
@@ -219,10 +219,10 @@ proc_with_prefix test_bkpt_invisible { } {
gdb_test "python print (ilist\[0\])" \
"<gdb.Breakpoint object at $hex>" "Check invisible bp obj exists 1"
gdb_test "python print (ilist\[0\].location)" \
- "py-breakpoint\.c:$ibp_location*" "Check breakpoint location 1"
+ "$srcfile:$ibp_location*" "Check breakpoint location 1"
gdb_test "python print (ilist\[0\].visible)" \
"True" "Check breakpoint visibility 1"
- gdb_test "info breakpoints" "py-breakpoint\.c:$ibp_location.*" \
+ gdb_test "info breakpoints" "$srcfile:$ibp_location.*" \
"Check info breakpoints shows visible breakpoints"
delete_breakpoints
gdb_py_test_silent_cmd "python ibp = gdb.Breakpoint(\"$ibp_location\", internal=True)" \
@@ -232,13 +232,13 @@ proc_with_prefix test_bkpt_invisible { } {
gdb_test "python print (ilist\[0\])" \
"<gdb.Breakpoint object at $hex>" "Check invisible bp obj exists 2"
gdb_test "python print (ilist\[0\].location)" \
- "py-breakpoint\.c:$ibp_location*" "Check breakpoint location 2"
+ "$srcfile:$ibp_location*" "Check breakpoint location 2"
gdb_test "python print (ilist\[0\].visible)" \
"False" "Check breakpoint visibility 2"
gdb_test "info breakpoints" "No breakpoints or watchpoints.*" \
"Check info breakpoints does not show invisible breakpoints"
gdb_test "maint info breakpoints" \
- "py-breakpoint\.c:$ibp_location.*" \
+ "$srcfile:$ibp_location.*" \
"Check maint info breakpoints shows invisible breakpoints"
}
@@ -436,9 +436,9 @@ proc_with_prefix test_bkpt_temporary { } {
gdb_py_test_silent_cmd "python ibp = temp_bp(\"$ibp_location\", temporary=True)" \
"Set temporary breakpoint" 0
gdb_test "info breakpoints" \
- "2.*breakpoint.*del.*py-breakpoint\.c:$ibp_location.*" \
+ "2.*breakpoint.*del.*$srcfile:$ibp_location.*" \
"Check info breakpoints shows breakpoint with temporary status"
- gdb_test "python print (ibp.location)" "py-breakpoint\.c:$ibp_location*" \
+ gdb_test "python print (ibp.location)" "$srcfile:$ibp_location*" \
"Check temporary breakpoint location"
gdb_test "python print (ibp.temporary)" "True" \
"Check breakpoint temporary status"