[PATCHv7 0/4] gdb: allow 'until' to work in outermost frame

Andrew Burgess <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
In v7:

  - Addressed Simon's feedback for patch #2.  Changes are all minor,
    and this patch now has Simon's Approved-By tag.

  - While addressing feedback on patch #3 I realised that the approach
    taken wouldn't work.  Simon pointed out that setting the frame
    stop reason was incorrect, but removing that ended up triggering
    some assertion failures.  As a result I had to take a different
    approach with this patch.  This is the patch that changed the most.

  - Commit message for patch #4 is updated after changes to patch #3.

  - Some improvements to testing in both #2 and #3.  All pretty minor
    though.

  - Rebased to HEAD of master branch and retested.

In v6:

  - More adjustments to the test in patch #2 to address issues the
    Linaro CI testing highlighted.  Nothing serious, just minor tweaks
    to some patterns to handle different output patterns.

  - Rebased to HEAD.

In v5:

  - Update to test in patch #2 to allow the test to work on machines
    that build PIE by default.  I actually extended the test to build
    both PIE and non-PIE executables, and test with both.

In v4:

  - Rebase to current HEAD of master.

  - In patch #2, added a supports_process_entry_point proc as
    suggested by Pedro, and make use of this in the new test.

Updates to address review comments from v2 series:

  - Doc updates based on Eli's feedback.

  - Patch #2:

    + Avoid swallowing Ctrl-C in try/catch.  That whole try/catch
      block has been removed in v3, so problem sorted!

    + Rewrote entry address calculation as suggested by Pedro, now
      pulls all required information from the inferior.

    + Use 'objdump -f' rather than readelf to get the entry address in
      the test.

    + Added a helper proc for is_svr4_target, which includes a larger
      list of targets beyond just Linux.  This is then used in the test.

    + Test updated to use -lbl flag in gdb_test_multiple.

  - Patch #3:

    + Use 'frame' rather than 'bt 1'

    + Loosen the test regexp after the 'starti' command, this should
      now work on Windows targets, or any target with multiple threads
      at startup.

    + Test updated to use -lbl in gdb_test_multiple.

  - In patch #3 the entry frame detection is moved from
    `frame_unwind_caller_frame` into `get_prev_frame_always`, I hope
    this will address Guinevere's concerns about having to add the
    additional entry frame detection in multiple locations.  Guinevere
    also had some concerns about the naming of existing functions
    (i.e. not things added by me in this commit), I don't plan to make
    any naming changes to the get_prev_frame* functions in this series.

  - Patch #4 is new, this adds some caching to avoid repeatedly
    looking up the entry address.  The new approach requires reading
    target memory, which can be expensive, especially on remote
    targets.

---

Andrew Burgess (4):
  gdb: rename program_space::entry_point_address* functions
  gdb: introduce program_space::get_entry_point_info function
  gdb: allow 'until' to work in outermost frame
  gdb: cache program space entry point information

 gdb/NEWS                                      |   7 +
 gdb/arc-tdep.c                                |   2 +-
 gdb/arch-utils.c                              |   2 +-
 gdb/doc/gdb.texinfo                           |  22 ++
 gdb/frame.c                                   |  74 +++--
 gdb/infcall.c                                 |   2 +-
 gdb/linux-tdep.c                              |   2 +-
 gdb/progspace.c                               | 105 +++++++-
 gdb/progspace.h                               |  68 ++++-
 gdb/solib-frv.c                               |   2 +-
 gdb/solib-svr4.c                              |  85 ++++++
 gdb/solib-svr4.h                              |   1 +
 gdb/solib.h                                   |  14 +
 gdb/testsuite/gdb.base/bt-after-starti.exp    | 253 ++++++++++++++++++
 gdb/testsuite/gdb.base/until-in-entry-frame.c |  22 ++
 .../gdb.base/until-in-entry-frame.exp         | 173 ++++++++++++
 gdb/testsuite/lib/gdb.exp                     |  39 +++
 17 files changed, 844 insertions(+), 29 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/bt-after-starti.exp
 create mode 100644 gdb/testsuite/gdb.base/until-in-entry-frame.c
 create mode 100644 gdb/testsuite/gdb.base/until-in-entry-frame.exp


base-commit: ca8bf5f5dd69eba877e74ca8bc0796388070401f
-- 
2.25.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.