This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] breakpoints/19546: Fix crash after updating breakpoints


Thanks much Keith.

LGTM, with a couple nits addressed.

On 02/09/2016 07:12 PM, Keith Seitz wrote:

> gdb/ChangeLog
> 
> 	PR breakpoints/19546
> 	* breakpoint.c (breakpoint_event_location_empty_p): New function.
> 	(update_breakpoints_after_exec, bkpt_re_set): Use this new function
> 	instead of event_location_empty_p.
> 
> gdb/testsuite/ChangeLog
> 
> 	PR breakpoints/19546
> 	* gdb.base/inf-exec.c: New file.
> 	* gdb.base/inf-exec2.c: New file.
> 	* gdb.base/inf-exec.exp: New file.

Please rename these new files to infcall-*.  We have several other
infcall-specific tests named that way, which allows conveniently doing:

  make check TESTS="gdb.*/*infcall*.exp"

> +# Test an inferior function call which execs a new program.
> +# This is a test for breakpoints/19546.
> +
> +standard_testfile inf-exec.c

"standard_testfile" without a file name should work.

> +
> +set testfile2 "inf-exec2"
> +set srcfile2 "${testfile2}.c"
> +set binfile2 [standard_output_file $testfile2]
> +
> +# Build the two executables for the test.
> +if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable debug] != ""} {
> +    untested "could not build $binfile"
> +    return -1
> +}
> +if {[gdb_compile $srcdir/$subdir/$srcfile2 $binfile2 executable debug] != ""} {
> +    untested "could not build $binfile2"
> +    return -1
> +}
> +
> +gdb_exit

Not needed, clean_restart does that for you.

(guess you copied these from foll-exec.exp.)

> +clean_restart $binfile
> +
> +if {![runto_main]} {
> +    untested "could not run to main"
> +    return -1
> +}
> +
> +set expected_result "process \[0-9\]+ is executing new program: $binfile2"
> +append expected_result "\[\r\n\]+"
> +append expected_result "Breakpoint 1, main.*at .*/$srcfile2:\[0-9\]+"

No / before $srcfile2, for remote host testing (see e.g., 0e7a53fca6e4).

While at it, I'd add space after "main" ("main .*") and use $decimal.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]