From: Pedro Alves <palves@redhat.com>
To: Luis Machado <lgustavo@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Make gdb.python/python.exp more robust
Date: Fri, 20 Jan 2017 16:59:00 -0000 [thread overview]
Message-ID: <2899cd10-7498-6b56-c53b-f2eb1f87e5fa@redhat.com> (raw)
In-Reply-To: <1484923030-16656-1-git-send-email-lgustavo@codesourcery.com>
On 01/20/2017 02:37 PM, Luis Machado wrote:
> }
> gdb_test "python print (symtab\[1\]\[0\].symtab)" ".*${python_1_c}" "test decode_line func1 filename"
> -gdb_test "python print (symtab\[1\]\[0\].line)" "19" "test decode_line func1 line number"
> +
> +# Fetch the line GDB thinks func1 starts at. This may change depending
> +# on the architecture and on how GDB handles the prologue of the function.
> +gdb_test_multiple "info line func1" "info line func1" {
> + -re "Line ($decimal) of .* starts at address $hex <func1> and ends at $hex <func1\\+$decimal>\.\[\r\n\]+$gdb_prompt $" {
> + # Fetch the line number.
> + set func1_lineno $expect_out(1,string)
> + }
> +}
Do:
set func1_lineno "noline"
before gdb_test_multiple, so that in case the above FAILs, this:
> +
> +gdb_test "python print (symtab\[1\]\[0\].line)" "$func1_lineno" "test decode_line func1 line number"
FAILs too, instead of ERRORing out with a TCL error, due to
undefined $func1_lineno.
OK with that change.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-01-20 16:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 14:37 Luis Machado
2017-01-20 16:59 ` Pedro Alves [this message]
2017-01-20 19:17 ` Luis Machado
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2899cd10-7498-6b56-c53b-f2eb1f87e5fa@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=lgustavo@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox