RegisterContextPOSIX.h revision 3d4d51cd1bdef32ab61ba9e1de75d5a4f4c1dbed
1//===-- RegisterContextPOSIX.h --------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_RegisterContextPOSIX_H_
11#define liblldb_RegisterContextPOSIX_H_
12
13// C Includes
14// C++ Includes
15// Other libraries and framework includes
16#include "lldb/Target/RegisterContext.h"
17
18//------------------------------------------------------------------------------
19/// @class RegisterContextPOSIX
20///
21/// @brief Extends RegisterClass with a few virtual operations useful on POSIX.
22class RegisterContextPOSIX
23    : public lldb_private::RegisterContext
24{
25public:
26    RegisterContextPOSIX(lldb_private::Thread &thread,
27                         uint32_t concrete_frame_idx)
28        : RegisterContext(thread, concrete_frame_idx) { }
29
30    /// Updates the register state of the associated thread after hitting a
31    /// breakpoint (if that make sense for the architecture).  Default
32    /// implementation simply returns true for architectures which do not
33    /// require any update.
34    ///
35    /// @return
36    ///    True if the operation succeeded and false otherwise.
37    virtual bool UpdateAfterBreakpoint() { return true; }
38
39    // Checks to see if a watchpoint specified by hw_index caused the inferior
40    // to stop.
41    virtual bool
42    IsWatchpointHit (uint32_t hw_index) { return false; }
43
44    // Resets any watchpoints that have been hit.
45    virtual bool
46    ClearWatchpointHits () { return false; }
47
48    // Returns the watchpoint address associated with a watchpoint hardware
49    // index.
50    virtual lldb::addr_t
51    GetWatchpointAddress (uint32_t hw_index) {return LLDB_INVALID_ADDRESS; }
52};
53
54#endif // #ifndef liblldb_RegisterContextPOSIX_H_
55