[Lldb-commits] [PATCH] D38897: Add specific ppc64le hardware watchpoint handler
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Oct 20 13:09:35 PDT 2017
clayborg added inline comments.
================
Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp:284
+ switch (watch_flags) {
+ case write_mode:
+ rw_mode = PPC_BREAKPOINT_TRIGGER_WRITE;
----------------
anajuliapc wrote:
> clayborg wrote:
> > We should use the lldb::WatchpointKind from lldb-enumerations.h:
> >
> > ```
> > //----------------------------------------------------------------------
> > // Watchpoint Kind
> > // Indicates what types of events cause the watchpoint to fire.
> > // Used by Native*Protocol-related classes.
> > //----------------------------------------------------------------------
> > FLAGS_ENUM(WatchpointKind){eWatchpointKindRead = (1u << 0),
> > eWatchpointKindWrite = (1u << 1)};
> > ```
> >
> > The you look at the bits and do the right thing. "access_mode" used below will just be if read and write are set.
> Variable `watch_flags` is set in [[ https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp#L2561 | GDBRemoteCommunicationServerLLGS ]] with `read = 2` and `write = 1`.
> Where do you think I should change it?
I would switch them over to use eWatchpointKindRead and eWatchpointKindWrite and modify all code that falls out from that to use these definitions as well.
https://reviews.llvm.org/D38897
More information about the lldb-commits
mailing list