[all-commits] [llvm/llvm-project] 55a363: [LLDB] Expose several methods in SBWatchpoint

danliew via All-commits all-commits at lists.llvm.org
Wed Mar 1 11:16:09 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 55a363fea18b20a81e8ebb9518997a3bda602f32
      https://github.com/llvm/llvm-project/commit/55a363fea18b20a81e8ebb9518997a3bda602f32
  Author: Dan Liew <dan at su-root.co.uk>
  Date:   2023-03-01 (Wed, 01 Mar 2023)

  Changed paths:
    M lldb/bindings/interface/SBWatchpointDocstrings.i
    M lldb/docs/python_api_enums.rst
    M lldb/include/lldb/API/SBType.h
    M lldb/include/lldb/API/SBWatchpoint.h
    M lldb/include/lldb/lldb-enumerations.h
    M lldb/source/API/SBWatchpoint.cpp
    M lldb/test/API/python_api/watchpoint/TestSetWatchpoint.py
    M lldb/test/API/python_api/watchpoint/watchlocation/TestSetWatchlocation.py

  Log Message:
  -----------
  [LLDB] Expose several methods in SBWatchpoint

This patch adds the following methods:

* `GetType()`
* `GetWatchValueKind()`
* `GetWatchSpec()`
* `IsWatchingReads()`
* `IsWatchingWrites()`

These mostly expose methods that `lldb_private::Watchpoint` already
had. Tests are included that exercise these new methods.

The motivation for exposing these are as follows:

* `GetType()` - With this information and the address from a watchpoint
  it is now possible to construct an SBValue from an SBWatchpoint.
  Previously this wasn't possible. The included test case illustrates
  doing this.
* `GetWatchValueKind()` - This allows the caller to determine whether the
  watchpoint is a variable watchpoint or an expression watchpoint. A new
  enum (`WatchpointValueKind`) has been introduced to represent the
  return values. Unfortunately the name `WatchpointKind` was already
  taken.
* `GetWatchSpec()` - This allows (at least for variable watchpoints)
  to use a sensible name for SBValues created from an SBWatchpoint.
* `IsWatchingReads()` - This allow checking if a watchpoint is
  monitoring read accesses.
* `IsWatchingWRites()` - This allow checking if a watchpoint is
  monitoring write accesses.

rdar://105606978

Reviewers: jingham, mib, bulbazord, jasonmolenda, JDevlieghere

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




More information about the All-commits mailing list