Compute the function length instead of hard coding it
authorYao Qi <yao@codesourcery.com>
Thu, 24 Apr 2014 08:51:33 +0000 (16:51 +0800)
committerYao Qi <yao@codesourcery.com>
Sat, 26 Apr 2014 02:45:06 +0000 (10:45 +0800)
commit9730e6ccc4307a03ae2a0dd5c8a17a30fcf9b1f2
tree3276cd4ee82bc798c7c6e0a68e60fd4e07586f4b
parentcec9d598f54503baaead6c8009a7998a0cd731fa
Compute the function length instead of hard coding it

In Dwarf::assemble in dwz.exp, 10 is hard-coded in it,

      subprogram {
  {name main}
  {low_pc main addr}
{high_pc "main + 10" addr}
      }

however, the length of main function varies on architectures.  The
hard-coded 10 here causes dwz.exp fails on some targets, such as
nios2.

This patch is to add some code to compute the length of function main,
which is similar to what we are doing in entry-values.exp.

gdb/testsuite:

2014-04-26  Yao Qi  <yao@codesourcery.com>

* gdb.dwarf2/dwz.exp: Compile main.c to object.  Restart GDB
and compute the length of function main.  Save it in
$main_length.
(Dwarf::assemble): Use $main_length instead of hard-coded 10.
(top-level): Use gdb_compile to compile objects into
executable and restart GDB.  Remove invocation to
prepare_for_testing.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dwz.exp
This page took 0.026247 seconds and 4 git commands to generate.