<commit_before>//===-- RegisterContext.h ---------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_RegisterContext_h_
#define liblldb_RegisterContext_h_

// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Target/ExecutionContextScope.h"

namespace lldb_private {

class RegisterContext :
    public ExecutionContextScope
{
public:
    //------------------------------------------------------------------
    // Constructors and Destructors
    //------------------------------------------------------------------
    RegisterContext (Thread &thread, StackFrame *frame);

    virtual
    ~RegisterContext ();

    //------------------------------------------------------------------
    // Subclasses must override these functions
    //------------------------------------------------------------------
    virtual void
    Invalidate () = 0;

    virtual size_t
    GetRegisterCount () = 0;

    virtual const lldb::RegisterInfo *
    GetRegisterInfoAtIndex (uint32_t reg) = 0;

    virtual size_t
    GetRegisterSetCount () = 0;

    virtual const lldb::RegisterSet *
    GetRegisterSet (uint32_t reg_set) = 0;

    virtual bool
    ReadRegisterValue (uint32_t reg, Scalar &value) = 0;

    virtual bool
    ReadRegisterBytes (uint32_t reg, DataExtractor &data) = 0;

    virtual bool
    ReadAllRegisterValues (lldb::DataBufferSP &data_sp) = 0;

    virtual bool
    WriteRegisterValue (uint32_t reg, const Scalar &value) = 0;

    virtual bool
    WriteRegisterBytes (uint32_t reg, DataExtractor &data, uint32_t data_offset = 0) = 0;

    virtual bool
    WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) = 0;

    virtual uint32_t
    ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num) = 0;

    //------------------------------------------------------------------
    // Subclasses can override these functions if desired
    //------------------------------------------------------------------
    virtual uint32_t
    NumSupportedHardwareBreakpoints ();

    virtual uint32_t
    SetHardwareBreakpoint (lldb::addr_t addr, size_t size);

    virtual bool
    ClearHardwareBreakpoint (uint32_t hw_idx);

    virtual uint32_t
    NumSupportedHardwareWatchpoints ();

    virtual uint32_t
    SetHardwareWatchpoint (lldb::addr_t addr, size_t size, bool read, bool write);

    virtual bool
    ClearHardwareWatchpoint (uint32_t hw_index);

    virtual bool
    HardwareSingleStep (bool enable);

    //------------------------------------------------------------------
    // Subclasses should not override these
    //------------------------------------------------------------------
    lldb::tid_t
    GetThreadID() const;

    const lldb::RegisterInfo *<commit_msg>Added a Thread accessor to the register context.<commit_after>//===-- RegisterContext.h ---------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_RegisterContext_h_
#define liblldb_RegisterContext_h_

// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Target/ExecutionContextScope.h"

namespace lldb_private {

class RegisterContext :
    public ExecutionContextScope
{
public:
    //------------------------------------------------------------------
    // Constructors and Destructors
    //------------------------------------------------------------------
    RegisterContext (Thread &thread, StackFrame *frame);

    virtual
    ~RegisterContext ();

    //------------------------------------------------------------------
    // Subclasses must override these functions
    //------------------------------------------------------------------
    virtual void
    Invalidate () = 0;

    virtual size_t
    GetRegisterCount () = 0;

    virtual const lldb::RegisterInfo *
    GetRegisterInfoAtIndex (uint32_t reg) = 0;

    virtual size_t
    GetRegisterSetCount () = 0;

    virtual const lldb::RegisterSet *
    GetRegisterSet (uint32_t reg_set) = 0;

    virtual bool
    ReadRegisterValue (uint32_t reg, Scalar &value) = 0;

    virtual bool
    ReadRegisterBytes (uint32_t reg, DataExtractor &data) = 0;

    virtual bool
    ReadAllRegisterValues (lldb::DataBufferSP &data_sp) = 0;

    virtual bool
    WriteRegisterValue (uint32_t reg, const Scalar &value) = 0;

    virtual bool
    WriteRegisterBytes (uint32_t reg, DataExtractor &data, uint32_t data_offset = 0) = 0;

    virtual bool
    WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) = 0;

    virtual uint32_t
    ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num) = 0;

    //------------------------------------------------------------------
    // Subclasses can override these functions if desired
    //------------------------------------------------------------------
    virtual uint32_t
    NumSupportedHardwareBreakpoints ();

    virtual uint32_t
    SetHardwareBreakpoint (lldb::addr_t addr, size_t size);

    virtual bool
    ClearHardwareBreakpoint (uint32_t hw_idx);

    virtual uint32_t
    NumSupportedHardwareWatchpoints ();

    virtual uint32_t
    SetHardwareWatchpoint (lldb::addr_t addr, size_t size, bool read, bool write);

    virtual bool
    ClearHardwareWatchpoint (uint32_t hw_index);

    virtual bool
    HardwareSingleStep (bool enable);

    //------------------------------------------------------------------
    // Subclasses should not override these
    //------------------------------------------------------------------
    lldb::tid_t
    GetThreadID() const;

    Thread &
    GetThread ()
    {
        return m_thread;
    }

    const lldb::RegisterInfo *
{'fraction_non_alphanumeric': 0.2759119395789812, 'fraction_numerical': 0.014462477904547646, 'mean_word_length': 1.4876099120703437, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4538282', 'n_tokens_mistral': 1612, 'n_tokens_neox': 1504, 'n_words': 417}