Get start and end address of main in dwz.exp
authorYao Qi <yao@codesourcery.com>
Fri, 14 Nov 2014 00:53:08 +0000 (08:53 +0800)
committerYao Qi <yao@codesourcery.com>
Fri, 14 Nov 2014 00:55:06 +0000 (08:55 +0800)
commit0f6e71e32ffee942879c37cbab162f9dcee7e683
tree840479b4d66e67523df4f2cf165a04af14606c67
parent876c4df94765ce9409e867ff035ab2203c9f4a3b
Get start and end address of main in dwz.exp

On arm-none-eabi target thumb mode, I see the following fail,

p the_int^M
$2 = 99^M
(gdb) FAIL: gdb.dwarf2/dwz.exp: p the_int

and on powerpc64 target, we even can't get function main from object
file,

disassemble main^M
No function contains specified address.^M
(gdb) FAIL: gdb.dwarf2/dwz.exp: disassemble main

This patch is to use MACRO_AT_func attribute to get the main's start
address and end address correctly, and also remove some code dwz.exp
getting main's length.  This patch fixes fails on both thumb mode and
powerpc64 target.

PASS: gdb.dwarf2/dwz.exp: p other_int
PASS: gdb.dwarf2/dwz.exp: p the_int

gdb/testsuite:

2014-11-14  Yao Qi  <yao@codesourcery.com>

* gdb.dwarf2/dwz.exp: Remove the code to compile main.c to
object and get function length.
(Dwarf::assemble): Replace name, low_pc and high_pc attributes
with MACRO_AT_func.
(top-level): Replace gdb_compile and clean_restart with
prepare_for_testing.
* gdb.dwarf2/main.c (main): Add label main_label.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dwz.exp
gdb/testsuite/gdb.dwarf2/main.c