This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patchv3] Fix warning: Invalid entry in .debug_gdb_scripts section
On 03/19/2017 10:38 PM, Jan Kratochvil wrote:
> On Thu, 16 Mar 2017 18:39:13 +0100, Jan Kratochvil wrote:
>> > OK, I will update the patch later.
> Included.
>
> OK for check-in?
Thanks.
> gdb/ChangeLog
> 2017-03-16 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * auto-load.c (auto_load_section_scripts): Check SEC_HAS_CONTENTS.
>
> gdb/testsuite/ChangeLog
> 2017-03-19 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * gdb.python/py-section-script.exp (sepdebug): New testcases.
>
> diff --git a/gdb/testsuite/gdb.python/py-section-script.exp b/gdb/testsuite/gdb.python/py-section-script.exp
> index 52e1e3e..cf6b631 100644
> --- a/gdb/testsuite/gdb.python/py-section-script.exp
> +++ b/gdb/testsuite/gdb.python/py-section-script.exp
> @@ -114,3 +114,38 @@ gdb_test "continue" ".*Breakpoint.*"
> gdb_test "print ss" " = a=<1> b=<2>"
>
> gdb_test "test-cmd 1 2 3" "test-cmd output, arg = 1 2 3"
> +
> +
> +with_test_prefix "sepdebug" {
Please add a leading comment here, helping folks reading this understand
what the test is about. Something like "eu-strip creates NOBITS
.debug_gdb_scripts sections in the debug files. Make sure those are
ignored silently."
OK with that change.
Thanks,
Pedro Alves
> + gdb_exit
> +
> + set result [catch "exec eu-strip -g -f ${binfile}.debug ${binfile}" output]
> + verbose "result is $result"
> + verbose "output is $output"
> + if {$result != 0 || $output != ""} {
> + unsupported "cannot produce separate debug info files"
> + return
> + }
> +
> + gdb_start
> + gdb_reinitialize_dir $srcdir/$subdir
> +
> + gdb_test_no_output "set auto-load safe-path ${remote_python_file}:${binfile}" \
> + "set auto-load safe-path"
> + set test "load sepdebug"
> + gdb_test_multiple "file $binfile" $test {
> + -re "\r\nwarning: Invalid entry in \\.debug_gdb_scripts section.*\r\n$gdb_prompt $" {
> + fail $test
> + }
> + -re "done\\.\r\n$gdb_prompt $" {
> + pass $test
> + }
> + }
> +
> + # Again, with a regexp this time.
> + gdb_test "info auto-load python-scripts ${testfile}" "Yes.*${testfile}.py.*"
> +
> + # Again, with a regexp that matches no scripts.
> + gdb_test "info auto-load python-scripts no-script-matches-this" \
> + "No auto-load scripts matching no-script-matches-this."
> +}
>