[all-commits] [llvm/llvm-project] bcce8e: Fix the logic so stop-hooks get run after a breakp...

jimingham via All-commits all-commits at lists.llvm.org
Thu Jul 22 15:06:56 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bcce8e0fccc1d6c2f18ade0ffa7039fb705bade2
      https://github.com/llvm/llvm-project/commit/bcce8e0fccc1d6c2f18ade0ffa7039fb705bade2
  Author: Jim Ingham <jingham at apple.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M lldb/include/lldb/Target/Target.h
    M lldb/source/Target/Target.cpp
    M lldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py
    M lldb/test/API/commands/target/stop-hooks/TestStopHooks.py
    M lldb/test/API/commands/target/stop-hooks/main.c

  Log Message:
  -----------
  Fix the logic so stop-hooks get run after a breakpoint that ran an expression

Code was added to Target::RunStopHook to make sure that we don't run stop hooks when
you stop after an expression evaluation. But the way it was done was to check that we
hadn't run an expression since the last natural stop. That failed in the case where you
stopped for a breakpoint which had run an expression, because the stop-hooks get run
after the breakpoint actions, and so by the time we got to running the stop-hooks,
we had already run a user expression.

I fixed this by adding a target ivar tracking the last natural stop ID at which we had
run a stop-hook. Then we keep track of this and make sure we run the stop-hooks only
once per natural stop.

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




More information about the All-commits mailing list