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/9] Changes to frame selection.


This series of patches makes changes to how frames are selected.  This
effects the 'frame', 'select-frame', and 'info frame' commands.

If you only select frame by the gdb assigned frame number then nothing
should change for you.

If you select frames by frame address, or create temporary frames by
specifying addresses then you'll need to use a slightly longer command
in the future.

These changes have been discussed before at a high level:
  https://sourceware.org/ml/gdb-patches/2015-07/msg00241.html
  https://sourceware.org/ml/gdb/2014-11/msg00028.html

There's even a related bug:
  https://sourceware.org/bugzilla/show_bug.cgi?id=18074

The idea is to remove some of the over-loading in the frame selection
of the commands like 'frame'.  Currently the parameters passed to
'frame' are first treated as a frame number, then as an address to
look for, and finally, if that all fails, a frame is created using the
parameter as an address.

After this patch series we now have the following commands:

  (gdb) frame level NUMBER           # Find frame at level NUMBER
  (gdb) frame NUMBER                 # Same as 'frame level NUMBER'
  (gdb) frame address ADDRESS        # Find frame by stack ADDRESS
  (gdb) frame function NAME          # Find frame by function NAME
  (gdb) frame create STACK-ADDRESS   # Create frame at STACK-ADDRESS
  (gdb) frame create STACK-ADDRESS PC-ADDRESS
                                     # Create frame at STACK-ADDRESS
                                     # and PC-ADDRESS

[ The use of 'frame level' made sense to me, but I can change this to
  'frame number' if folk feel strongly. ]

The functions that find a frame will now error if a matching frame
can't be found.

This patch series includes two patches posted here:
  https://sourceware.org/ml/gdb-patches/2015-07/msg00626.html
they never got reviewed, and the versions in this patch series replace
the older versions.

All feedback welcome.

Thanks,
Andrew

---

Andrew Burgess (9):
  gdb: Check the selected-frame in frame_find_by_id.
  gdb: Select a frame for frame_info.
  gdb: Make use of safe-ctype.h header.
  gdb/doc: Restructure frame command documentation.
  gdb: Fix bug with dbx style func command.
  gdb: Avoid unneeded calls to parse_frame_specification.
  gdb: Simplify parse_frame_specification.
  gdb: Split func_command into two parts.
  gdb: Change how frames are selected for 'frame' and 'info frame'.

 gdb/ChangeLog                         |  76 ++++++
 gdb/NEWS                              |   6 +
 gdb/doc/ChangeLog                     |  14 +
 gdb/doc/gdb.texinfo                   | 349 +++++++++++++------------
 gdb/frame.c                           |  39 ++-
 gdb/frame.h                           |   4 +
 gdb/mi/mi-cmd-stack.c                 |  16 +-
 gdb/stack.c                           | 476 ++++++++++++++++++++++++----------
 gdb/stack.h                           |   2 +-
 gdb/testsuite/ChangeLog               |  23 ++
 gdb/testsuite/gdb.base/dbx.exp        |   6 +-
 gdb/testsuite/gdb.base/frame-cmds.c   |  52 ++++
 gdb/testsuite/gdb.base/frame-cmds.exp |  36 +++
 gdb/testsuite/gdb.mi/mi-var-frame.c   |  34 +++
 gdb/testsuite/gdb.mi/mi-var-frame.exp |  81 ++++++
 15 files changed, 902 insertions(+), 312 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/frame-cmds.c
 create mode 100644 gdb/testsuite/gdb.base/frame-cmds.exp
 create mode 100644 gdb/testsuite/gdb.mi/mi-var-frame.c
 create mode 100644 gdb/testsuite/gdb.mi/mi-var-frame.exp

-- 
2.5.1


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