Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
source/Breakpoint/Watchpoint.cpp
Show All 11 Lines | |||||
#include "lldb/Core/Value.h" | #include "lldb/Core/Value.h" | ||||
#include "lldb/Core/ValueObject.h" | #include "lldb/Core/ValueObject.h" | ||||
#include "lldb/Core/ValueObjectMemory.h" | #include "lldb/Core/ValueObjectMemory.h" | ||||
#include "lldb/Expression/UserExpression.h" | #include "lldb/Expression/UserExpression.h" | ||||
#include "lldb/Symbol/TypeSystem.h" | #include "lldb/Symbol/TypeSystem.h" | ||||
#include "lldb/Target/Process.h" | #include "lldb/Target/Process.h" | ||||
#include "lldb/Target/Target.h" | #include "lldb/Target/Target.h" | ||||
#include "lldb/Target/ThreadSpec.h" | #include "lldb/Target/ThreadSpec.h" | ||||
#include "lldb/Utility/Log.h" | |||||
#include "lldb/Utility/Stream.h" | #include "lldb/Utility/Stream.h" | ||||
using namespace lldb; | using namespace lldb; | ||||
using namespace lldb_private; | using namespace lldb_private; | ||||
Watchpoint::Watchpoint(Target &target, lldb::addr_t addr, uint32_t size, | Watchpoint::Watchpoint(Target &target, lldb::addr_t addr, uint32_t size, | ||||
const CompilerType *type, bool hardware) | const CompilerType *type, bool hardware) | ||||
: StoppointLocation(0, addr, size, hardware), m_target(target), | : StoppointLocation(0, addr, size, hardware), m_target(target), | ||||
m_enabled(false), m_is_hardware(hardware), m_is_watch_variable(false), | m_enabled(false), m_is_hardware(hardware), m_is_watch_variable(false), | ||||
m_is_ephemeral(false), m_disabled_count(0), m_watch_read(0), | m_is_ephemeral(false), m_disabled_count(0), m_watch_read(0), | ||||
m_watch_write(0), m_watch_was_read(0), m_watch_was_written(0), | m_watch_write(0), m_watch_was_read(0), m_watch_was_written(0), | ||||
m_ignore_count(0), m_false_alarms(0), m_decl_str(), m_watch_spec_str(), | m_ignore_count(0), m_false_alarms(0), m_decl_str(), m_watch_spec_str(), | ||||
m_type(), m_error(), m_options(), m_being_created(true) { | m_type(), m_error(), m_options(), m_being_created(true) { | ||||
if (type && type->IsValid()) | if (type && type->IsValid()) | ||||
m_type = *type; | m_type = *type; | ||||
else { | else { | ||||
// If we don't have a known type, then we force it to unsigned int of the | // If we don't have a known type, then we force it to unsigned int of the | ||||
// right size. | // right size. | ||||
TypeSystem *ast_context = | auto type_system_or_err = | ||||
target.GetScratchTypeSystemForLanguage(nullptr, eLanguageTypeC); | target.GetScratchTypeSystemForLanguage(eLanguageTypeC); | ||||
m_type = ast_context->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, | if (auto err = type_system_or_err.takeError()) { | ||||
8 * size); | LLDB_LOG_ERROR( | ||||
lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_WATCHPOINTS), | |||||
JDevlieghereUnsubmitted Done ReplyInline ActionsJDevlieghere: ```LLDB_LOG(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_WATCHPOINTS), "Watchpoint… | |||||
std::move(err), "Failed to set type."); | |||||
} else { | |||||
m_type = type_system_or_err->GetBuiltinTypeForEncodingAndBitSize( | |||||
eEncodingUint, 8 * size); | |||||
} | |||||
} | } | ||||
// Set the initial value of the watched variable: | // Set the initial value of the watched variable: | ||||
if (m_target.GetProcessSP()) { | if (m_target.GetProcessSP()) { | ||||
ExecutionContext exe_ctx; | ExecutionContext exe_ctx; | ||||
m_target.GetProcessSP()->CalculateExecutionContext(exe_ctx); | m_target.GetProcessSP()->CalculateExecutionContext(exe_ctx); | ||||
CaptureWatchedValue(exe_ctx); | CaptureWatchedValue(exe_ctx); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 331 Lines • Show Last 20 Lines |