[v3,00/17] DWARF expression evaluator design cleanup

Message ID 20210528154648.60881-1-zoran.zaric@amd.com
Headers show
Series
  • DWARF expression evaluator design cleanup
Related show

Message

Tom de Vries via Gdb-patches May 28, 2021, 3:46 p.m.
The idea of this patch series is to cleanup the design of the DWARF
expression evaluator (dwarf_expr_context class) and allow a future
extensions of that evaluator needed for the upcoming vendor specific
DWARF extensions.

Main motivation behind this series of patches is AMD’s effort to
improve DWARF support for heavily optimized code, but more
specifically, optimized code for SIMD and SIMT architectures.

For the interested parties, the AMD’s DWARF standard extensions
documentation can be found at:

https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html

That being said, the patch series can also be viewed as a standalone 
series that introduces a welcome cleanup of the DWARF expression 
evaluator module.

Zoran Zaric (17):
  Replace the symbol needs evaluator with a parser
  Cleanup of the dwarf_expr_context constructor
  Move frame context info to dwarf_expr_context
  Remove get_frame_cfa from dwarf_expr_context
  Move compilation unit info to dwarf_expr_context
  Move dwarf_call to dwarf_expr_context
  Move get_object_address to dwarf_expr_context
  Move read_mem to dwarf_expr_context
  Move push_dwarf_reg_entry_value to expr.c
  Inline get_reg_value method of dwarf_expr_context
  Remove empty frame and full evaluators
  Merge evaluate_for_locexpr_baton evaluator
  Move piece_closure and its support to expr.c
  Make value_copy also copy the stack data member
  Make DWARF evaluator return a single struct value
  Simplify dwarf_expr_context class interface
  Add as_lval argument to expression evaluator

 gdb/dwarf2/expr.c                             | 1190 ++++++++++--
 gdb/dwarf2/expr.h                             |  152 +-
 gdb/dwarf2/frame.c                            |  117 +-
 gdb/dwarf2/loc.c                              | 1672 +++++------------
 gdb/dwarf2/loc.h                              |   30 +-
 gdb/testsuite/gdb.dwarf2/symbol_needs_eval.c  |   25 +
 .../gdb.dwarf2/symbol_needs_eval_fail.exp     |  112 ++
 .../gdb.dwarf2/symbol_needs_eval_timeout.exp  |  131 ++
 .../amd64-py-framefilter-invalidarg.S         |    1 -
 gdb/testsuite/lib/dwarf.exp                   |    4 +
 gdb/value.c                                   |    2 +
 11 files changed, 1927 insertions(+), 1509 deletions(-)
 create mode 100644 gdb/testsuite/gdb.dwarf2/symbol_needs_eval.c
 create mode 100644 gdb/testsuite/gdb.dwarf2/symbol_needs_eval_fail.exp
 create mode 100644 gdb/testsuite/gdb.dwarf2/symbol_needs_eval_timeout.exp

-- 
2.17.1

Comments

Tom de Vries via Gdb-patches June 9, 2021, 1:04 a.m. | #1
On 2021-05-28 11:46 a.m., Zoran Zaric via Gdb-patches wrote:
> The idea of this patch series is to cleanup the design of the DWARF

> expression evaluator (dwarf_expr_context class) and allow a future

> extensions of that evaluator needed for the upcoming vendor specific

> DWARF extensions.

> 

> Main motivation behind this series of patches is AMD’s effort to

> improve DWARF support for heavily optimized code, but more

> specifically, optimized code for SIMD and SIMT architectures.

> 

> For the interested parties, the AMD’s DWARF standard extensions

> documentation can be found at:

> 

> https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html

> 

> That being said, the patch series can also be viewed as a standalone 

> series that introduces a welcome cleanup of the DWARF expression 

> evaluator module.

> 

> Zoran Zaric (17):

>   Replace the symbol needs evaluator with a parser

>   Cleanup of the dwarf_expr_context constructor

>   Move frame context info to dwarf_expr_context

>   Remove get_frame_cfa from dwarf_expr_context

>   Move compilation unit info to dwarf_expr_context

>   Move dwarf_call to dwarf_expr_context

>   Move get_object_address to dwarf_expr_context

>   Move read_mem to dwarf_expr_context

>   Move push_dwarf_reg_entry_value to expr.c

>   Inline get_reg_value method of dwarf_expr_context

>   Remove empty frame and full evaluators

>   Merge evaluate_for_locexpr_baton evaluator

>   Move piece_closure and its support to expr.c

>   Make value_copy also copy the stack data member

>   Make DWARF evaluator return a single struct value

>   Simplify dwarf_expr_context class interface

>   Add as_lval argument to expression evaluator

> 

>  gdb/dwarf2/expr.c                             | 1190 ++++++++++--

>  gdb/dwarf2/expr.h                             |  152 +-

>  gdb/dwarf2/frame.c                            |  117 +-

>  gdb/dwarf2/loc.c                              | 1672 +++++------------

>  gdb/dwarf2/loc.h                              |   30 +-

>  gdb/testsuite/gdb.dwarf2/symbol_needs_eval.c  |   25 +

>  .../gdb.dwarf2/symbol_needs_eval_fail.exp     |  112 ++

>  .../gdb.dwarf2/symbol_needs_eval_timeout.exp  |  131 ++

>  .../amd64-py-framefilter-invalidarg.S         |    1 -

>  gdb/testsuite/lib/dwarf.exp                   |    4 +

>  gdb/value.c                                   |    2 +

>  11 files changed, 1927 insertions(+), 1509 deletions(-)

>  create mode 100644 gdb/testsuite/gdb.dwarf2/symbol_needs_eval.c

>  create mode 100644 gdb/testsuite/gdb.dwarf2/symbol_needs_eval_fail.exp

>  create mode 100644 gdb/testsuite/gdb.dwarf2/symbol_needs_eval_timeout.exp

> 


Hi Zoran,

I sent some minor comments, just a few nits that need to be fixed or
questions answered, but otherwise this LGTM, it's ok to push once all
these are addressed.

Simon
Tom de Vries via Gdb-patches Aug. 5, 2021, 4:38 p.m. | #2
[AMD Official Use Only]

> 

> Hi Zoran,

> 

> I sent some minor comments, just a few nits that need to be fixed or

> questions answered, but otherwise this LGTM, it's ok to push once all these

> are addressed.

> 

> Simon


This patch set has been submitted just now.

Thanks for all the reviews guys,
Zoran