This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 0/3] Fix gdb.base/func-ptrs.exp fails in ppc64 and arm thumb mode


I see some test fails in gdb.base/func-ptrs.exp in arm thumb mode,
because the LSB bit is lost when we assign a function to a function
pointer in GDB.  I proposed a patch
https://sourceware.org/ml/gdb-patches/2016-06/msg00217.html but we
decided to fix this problem rather than skip the test, and agreed
that assignment in GDB should end up the same value as we do the
same in .c file.

When I looked into this problem again, I find such problem exists
on all targets which have function descriptors, IOW, function pointer
address isn't function address, like ppc64, ia64, frv and hppa32.
(Function pointer with LSB set in arm thumb mode can be regarded
as a function descriptor as well, IMO)

This issue was discussed in GNU Cauldron this year, and I got some
helpful insights from Pedro and Ulrich.  I finally have a RFC in
patch #2, which is the major part of this patch series.  As I
mentioned in patch #2, it has some user visible changes, and you can
see these changes in patch #3.  Comments are welcome!

Regression tested on ppc64-linux (gcc110) native and arm-linux gdbserver.
I failed to run ppc64-linux tests with gdbserver, because
process-dies-while-detaching.exp, IIRC, generates a lot of zombie
GDBservers and the following tests are slowed down and timeout.  I
didn't look into them in details.

*** BLURB HERE ***

Yao Qi (3):
  Use get_var_address in test cases
  Record function descriptor address instead of function address in
    value
  Update test cases

 gdb/arch-utils.c                                   |  6 +++++
 gdb/arch-utils.h                                   |  1 +
 gdb/arm-tdep.c                                     | 23 +++++++++++++++++
 gdb/ax-gdb.c                                       | 12 ++++++---
 gdb/findvar.c                                      |  5 ++++
 gdb/gdbarch.c                                      | 23 +++++++++++++++++
 gdb/gdbarch.h                                      |  6 +++++
 gdb/gdbarch.sh                                     |  4 +++
 gdb/infcall.c                                      |  2 +-
 gdb/ppc-linux-tdep.c                               |  2 ++
 gdb/ppc64-tdep.c                                   | 30 ++++++++++++++++++++++
 gdb/ppc64-tdep.h                                   |  3 ++-
 gdb/ppcfbsd-tdep.c                                 |  2 ++
 gdb/testsuite/gdb.base/break-fun-addr.exp          |  4 +--
 gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp |  2 +-
 gdb/testsuite/gdb.base/examine-backward.exp        |  3 ++-
 gdb/testsuite/gdb.mi/mi-var-cmd.exp                |  4 +--
 gdb/testsuite/gdb.python/py-events.exp             |  7 +----
 gdb/testsuite/gdb.trace/tracecmd.exp               |  9 +++----
 gdb/testsuite/lib/dwarf.exp                        |  5 ++--
 gdb/testsuite/lib/gdb.exp                          |  3 ++-
 gdb/value.c                                        |  4 ++-
 22 files changed, 134 insertions(+), 26 deletions(-)

-- 
1.9.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]