This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Test case for entry values.
- From: Tom Tromey <tromey at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 20 Aug 2013 11:39:33 -0600
- Subject: Re: [PATCH 1/2] Test case for entry values.
- References: <1376379586-24150-1-git-send-email-yao at codesourcery dot com> <1376379586-24150-2-git-send-email-yao at codesourcery dot com>
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
Yao> This is a test case for "entry-values" in an arch-independent way. The
Yao> first part of entry-values.exp is to calculate the length of functions
Yao> and the offset of instruction call in function bar. Then, this test
Yao> uses Dwarf Assembler to emit some DIEs for "entry-values".
Thanks Yao. This is cool.
Yao> +# Start GDB and load object file, compute the function length and
Yao> +# the offset of branch instruction in function. They are needed
Yao> +# in the Dwarf Assembler below.
Nice technique! I'll have to use that.
Yao> +# Calculate the offset of the last instruction from the beginning.
Yao> +set test "disassemble foo"
Yao> +gdb_test_multiple $test $test {
Yao> + -re ".*$hex <\\+($decimal)>:\[^\r\n\]+\r\nEnd of assembler dump\.\r\n$gdb_prompt $" {
Yao> + set foo_length $expect_out(1,string)
Yao> + pass $test
Yao> + }
Yao> + -re ".*$gdb_prompt $" {
Yao> + fail $test
Yao> + }
Yao> +}
If this test fails then later on foo_length won't be set.
This will yield a Tcl error in the test suite.
It's probably better to just bail out here.
I think this applies elsewhere too.
Yao> + cu {addr_size 4} {
Will it still work on x86-64?
Tom