[all-commits] [llvm/llvm-project] 723a8a: [dexter] Change line label reference syntax to ena...

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Fri May 21 00:59:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 723a8ae5dab25b329c6aebc25564b3630e8e7d17
      https://github.com/llvm/llvm-project/commit/723a8ae5dab25b329c6aebc25564b3630e8e7d17
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2021-05-21 (Fri, 21 May 2021)

  Changed paths:
    M debuginfo-tests/dexter/Commands.md
    M debuginfo-tests/dexter/dex/command/ParseCommand.py
    M debuginfo-tests/dexter/dex/command/commands/DexExpectProgramState.py
    M debuginfo-tests/dexter/dex/command/commands/DexExpectWatchBase.py
    M debuginfo-tests/dexter/dex/command/commands/DexLimitSteps.py
    A debuginfo-tests/dexter/feature_tests/subtools/test/err_bad_label_ref.cpp
    A debuginfo-tests/dexter/feature_tests/subtools/test/err_duplicate_label.cpp
    A debuginfo-tests/dexter/feature_tests/subtools/test/label_offset.cpp

  Log Message:
  -----------
  [dexter] Change line label reference syntax to enable label-relative offsets (1/2)

This patch changes how line labels are resolved in order to enable
label-relative offsets to be used in commands. This is a breaking change in
dexter. Instead of using label references directly as argument values, labels
will instead be referenced through a function `ref(str)`.

    // No way to use offsets currently.
    Currently: DexExpectWatchValue('x', '1', on_line='labled_line')
    Patched:   DexExpectWatchValue('x', '1', on_line=ref('labled_line'))
    Patched:   DexExpectWatchValue('x', '1', on_line=ref('labled_line') + 3)

A dexter command is "parsed" by finding the whole command and sending it off to
`eval`. This change adds a function called `ref` to the `eval` globals map that
simply looks up the name and returns an int. If the line name hasn't been
defined, or a name is defined more than once, an error is reported (see
err_bad_label_ref.cpp and err_duplicate_label.cpp). Label offsets can be
achieved by simply writing the desired expression.

The rationale behind removing the existing label referencing mechanic is for
consistency and to simplify the code required to make labels work.

I've separated the update to llvm's dexter tests into another patch for ease of
review here (D101148). Here is a small python script which can be used to
update tests to use the new syntax:
https://gist.github.com/OCHyams/8255efe7757cac266440ed2ba55f1442

If it helps anyone using dexter on downstream tests we can come up with a
deprecation plan instead out outright removing the existing syntax.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D101147


  Commit: 98e7911f9517cd9eab0f566ca445096d9e206a75
      https://github.com/llvm/llvm-project/commit/98e7911f9517cd9eab0f566ca445096d9e206a75
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2021-05-21 (Fri, 21 May 2021)

  Changed paths:
    M debuginfo-tests/dexter-tests/aggregate-indirect-arg.cpp
    M debuginfo-tests/dexter-tests/asan-deque.cpp
    M debuginfo-tests/dexter-tests/asan.c
    M debuginfo-tests/dexter-tests/ctor.cpp
    M debuginfo-tests/dexter-tests/dbg-arg.c
    M debuginfo-tests/dexter-tests/deferred_globals.cpp
    M debuginfo-tests/dexter-tests/global-constant.cpp
    M debuginfo-tests/dexter-tests/hello.c
    M debuginfo-tests/dexter-tests/inline-line-gap.cpp
    M debuginfo-tests/dexter-tests/memvars/bitcast.c
    M debuginfo-tests/dexter-tests/memvars/const-branch.c
    M debuginfo-tests/dexter-tests/memvars/ctrl-flow.c
    M debuginfo-tests/dexter-tests/memvars/implicit-ptr.c
    M debuginfo-tests/dexter-tests/memvars/inline-escaping-function.c
    M debuginfo-tests/dexter-tests/memvars/inlining-dse.c
    M debuginfo-tests/dexter-tests/memvars/inlining.c
    M debuginfo-tests/dexter-tests/memvars/loop.c
    M debuginfo-tests/dexter-tests/memvars/merged-store.c
    M debuginfo-tests/dexter-tests/memvars/ptr-to.c
    M debuginfo-tests/dexter-tests/memvars/struct-dse.c
    M debuginfo-tests/dexter-tests/memvars/unused-merged-value.c
    M debuginfo-tests/dexter-tests/namespace.cpp
    M debuginfo-tests/dexter-tests/nrvo-string.cpp
    M debuginfo-tests/dexter-tests/nrvo.cpp
    M debuginfo-tests/dexter-tests/optnone-fastmath.cpp
    M debuginfo-tests/dexter-tests/optnone-loops.cpp
    M debuginfo-tests/dexter-tests/optnone-simple-functions.cpp
    M debuginfo-tests/dexter-tests/optnone-struct-and-methods.cpp
    M debuginfo-tests/dexter-tests/optnone-vectors-and-functions.cpp
    M debuginfo-tests/dexter-tests/realigned-frame.cpp
    M debuginfo-tests/dexter-tests/stack-var.c
    M debuginfo-tests/dexter-tests/vla.c
    M debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp
    M debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_type.cpp
    M debuginfo-tests/dexter/feature_tests/commands/penalty/expect_watch_value.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/expect_program_state.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_type.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/expect_watch_value.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/limit_steps/limit_steps_check_json_step_count.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/limit_steps/limit_steps_expect_loop.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/limit_steps/limit_steps_expect_value.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/limit_steps/limit_steps_line_mismatch.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/limit_steps/limit_steps_overlapping_ranges.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/limit_steps/limit_steps_same_line_conditional.cpp
    M debuginfo-tests/dexter/feature_tests/commands/perfect/limit_steps/unconditional.cpp
    M debuginfo-tests/dexter/feature_tests/subtools/test/label_another_line.cpp
    A debuginfo-tests/dexter/feature_tests/subtools/test/label_another_line.cpp.rej
    M debuginfo-tests/dexter/feature_tests/subtools/test/source-root-dir.cpp
    M debuginfo-tests/dexter/feature_tests/subtools/view.cpp

  Log Message:
  -----------
  [dexter] Change line label reference syntax to enable label-relative offsets (2/2)

Update dexter tests to use the new line label reference syntax introduced in D101147.

Updated with:
https://gist.github.com/OCHyams/8255efe7757cac266440ed2ba55f1442

Reviewed By: chrisjackson, jmorse

Differential Revision: https://reviews.llvm.org/D101148


Compare: https://github.com/llvm/llvm-project/compare/5e327785da36...98e7911f9517


More information about the All-commits mailing list