Fix ARM stepping over Thumb-mode "bx pc" or "blx pc"

Pedro Alves palves@redhat.com
Wed Aug 22 18:01:00 GMT 2012


Hi Joseph,

I'm not an ARM expert, but this looks fine to me.  Go ahead.

On 08/13/2012 05:30 PM, Joseph S. Myers wrote:

> +if [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] {
> +    untested ${testfile}.exp

See <http://sourceware.org/gdb/wiki/GDBTestcaseCookbook>.

"In untested calls, please spell out the reason the test ends up untested, instead of just writing
 the test name, as with the latter we just end up with the test name duplicated in
 the gdb.sum output. For example: "

Something like:

  untested "Failed to compile $srcfile"

is sufficient.

> +    return -1
> +}
> +
> +if ![runto_main] then {
> +    untested ${testfile}.exp

  untested "could not run to main"

> +    return -1
> +}
> +
> +gdb_test "stepi" "0x\[0-9a-fA-F\]+ in main \\(\\)" "stepi for bx pc"

You can use dejagnu's $hex global instead of "0x\[0-9a-fA-F\]+" .

> +
> +gdb_test "x /i \$pc" \
> +    "0x\[0-9a-fA-F\]+ <main\\+4>:\[ \t\]+mov\[ \t\]+r0,\[ \t\]+#0.*" \
> +    "stepi reached correct instruction"
> 

Ditto.

-- 
Pedro Alves



More information about the Gdb-patches mailing list