2010-11-12 03:26:09 +08:00
|
|
|
//===-- ThreadPlan.cpp ------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// C Includes
|
|
|
|
// C++ Includes
|
2015-12-15 09:33:19 +08:00
|
|
|
#include <cstring>
|
|
|
|
|
2010-11-12 03:26:09 +08:00
|
|
|
// Other libraries and framework includes
|
|
|
|
// Project includes
|
2015-12-15 09:33:19 +08:00
|
|
|
#include "lldb/Target/ThreadPlan.h"
|
2010-11-12 11:22:21 +08:00
|
|
|
#include "lldb/Core/ArchSpec.h"
|
|
|
|
#include "lldb/Core/DataBufferHeap.h"
|
2015-03-04 07:11:11 +08:00
|
|
|
#include "lldb/Core/DataExtractor.h"
|
2010-11-12 03:26:09 +08:00
|
|
|
#include "lldb/Core/Debugger.h"
|
2010-11-12 11:22:21 +08:00
|
|
|
#include "lldb/Core/Disassembler.h"
|
2010-11-12 03:26:09 +08:00
|
|
|
#include "lldb/Core/Log.h"
|
<rdar://problem/11757916>
Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()
Cleaned up header includes a bit as well.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
#include "lldb/Core/Module.h"
|
2010-11-12 03:26:09 +08:00
|
|
|
#include "lldb/Core/State.h"
|
2014-01-28 07:43:24 +08:00
|
|
|
#include "lldb/Core/StreamFile.h"
|
2010-11-12 11:22:21 +08:00
|
|
|
#include "lldb/Core/Value.h"
|
|
|
|
#include "lldb/Symbol/TypeList.h"
|
2015-09-22 00:56:08 +08:00
|
|
|
#include "lldb/Symbol/TypeSystem.h"
|
2015-03-04 03:23:09 +08:00
|
|
|
#include "lldb/Target/ABI.h"
|
2010-11-12 03:26:09 +08:00
|
|
|
#include "lldb/Target/RegisterContext.h"
|
|
|
|
#include "lldb/Target/Thread.h"
|
|
|
|
#include "lldb/Target/Process.h"
|
2013-12-06 09:12:00 +08:00
|
|
|
#include "lldb/Target/SectionLoadList.h"
|
2010-11-12 03:26:09 +08:00
|
|
|
#include "lldb/Target/Target.h"
|
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2010-11-12 11:22:21 +08:00
|
|
|
#pragma mark ThreadPlanTracer
|
|
|
|
|
2010-11-12 03:26:09 +08:00
|
|
|
ThreadPlanTracer::ThreadPlanTracer (Thread &thread, lldb::StreamSP &stream_sp) :
|
2011-04-12 03:41:40 +08:00
|
|
|
m_thread (thread),
|
2010-11-12 03:26:09 +08:00
|
|
|
m_single_step(true),
|
|
|
|
m_enabled (false),
|
|
|
|
m_stream_sp (stream_sp)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ThreadPlanTracer::ThreadPlanTracer (Thread &thread) :
|
2011-04-12 03:41:40 +08:00
|
|
|
m_thread (thread),
|
2010-11-12 03:26:09 +08:00
|
|
|
m_single_step(true),
|
|
|
|
m_enabled (false),
|
|
|
|
m_stream_sp ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Stream *
|
|
|
|
ThreadPlanTracer::GetLogStream ()
|
|
|
|
{
|
2015-12-15 09:33:19 +08:00
|
|
|
if (m_stream_sp)
|
2010-11-12 03:26:09 +08:00
|
|
|
return m_stream_sp.get();
|
|
|
|
else
|
2012-02-21 08:09:25 +08:00
|
|
|
{
|
|
|
|
TargetSP target_sp (m_thread.CalculateTarget());
|
|
|
|
if (target_sp)
|
2014-01-28 07:43:24 +08:00
|
|
|
return target_sp->GetDebugger().GetOutputFile().get();
|
2012-02-21 08:09:25 +08:00
|
|
|
}
|
2015-12-15 09:33:19 +08:00
|
|
|
return nullptr;
|
2010-11-12 03:26:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ThreadPlanTracer::Log()
|
|
|
|
{
|
|
|
|
SymbolContext sc;
|
|
|
|
bool show_frame_index = false;
|
|
|
|
bool show_fullpaths = false;
|
|
|
|
|
2011-06-16 03:35:17 +08:00
|
|
|
Stream *stream = GetLogStream();
|
2012-10-13 01:34:26 +08:00
|
|
|
if (stream)
|
|
|
|
{
|
|
|
|
m_thread.GetStackFrameAtIndex(0)->Dump (stream, show_frame_index, show_fullpaths);
|
|
|
|
stream->Printf("\n");
|
|
|
|
stream->Flush();
|
|
|
|
}
|
2010-11-12 03:26:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ThreadPlanTracer::TracerExplainsStop ()
|
|
|
|
{
|
|
|
|
if (m_enabled && m_single_step)
|
|
|
|
{
|
|
|
|
lldb::StopInfoSP stop_info = m_thread.GetStopInfo();
|
2015-12-15 09:33:19 +08:00
|
|
|
return (stop_info->GetStopReason() == eStopReasonTrace);
|
2010-11-12 03:26:09 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
}
|
2010-11-12 11:22:21 +08:00
|
|
|
|
|
|
|
#pragma mark ThreadPlanAssemblyTracer
|
|
|
|
|
|
|
|
ThreadPlanAssemblyTracer::ThreadPlanAssemblyTracer (Thread &thread, lldb::StreamSP &stream_sp) :
|
|
|
|
ThreadPlanTracer (thread, stream_sp),
|
2012-08-02 02:50:59 +08:00
|
|
|
m_disassembler_sp (),
|
2011-08-13 05:40:01 +08:00
|
|
|
m_intptr_type (),
|
|
|
|
m_register_values ()
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
2010-11-18 04:19:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
ThreadPlanAssemblyTracer::ThreadPlanAssemblyTracer (Thread &thread) :
|
|
|
|
ThreadPlanTracer (thread),
|
2012-08-02 02:50:59 +08:00
|
|
|
m_disassembler_sp (),
|
2011-08-13 05:40:01 +08:00
|
|
|
m_intptr_type (),
|
|
|
|
m_register_values ()
|
2010-11-18 04:19:50 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-08-13 05:40:01 +08:00
|
|
|
Disassembler *
|
|
|
|
ThreadPlanAssemblyTracer::GetDisassembler ()
|
2010-11-18 04:19:50 +08:00
|
|
|
{
|
2015-12-15 09:33:19 +08:00
|
|
|
if (!m_disassembler_sp)
|
|
|
|
m_disassembler_sp = Disassembler::FindPlugin(m_thread.GetProcess()->GetTarget().GetArchitecture(), nullptr, nullptr);
|
2012-08-02 02:50:59 +08:00
|
|
|
return m_disassembler_sp.get();
|
2011-08-13 05:40:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TypeFromUser
|
|
|
|
ThreadPlanAssemblyTracer::GetIntPointerType()
|
|
|
|
{
|
|
|
|
if (!m_intptr_type.IsValid ())
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
2012-02-21 08:09:25 +08:00
|
|
|
TargetSP target_sp (m_thread.CalculateTarget());
|
|
|
|
if (target_sp)
|
2011-08-13 05:40:01 +08:00
|
|
|
{
|
2015-10-03 02:40:30 +08:00
|
|
|
TypeSystem *type_system = target_sp->GetScratchTypeSystemForLanguage(nullptr, eLanguageTypeC);
|
TypeSystem is now a plugin interface and removed any "ClangASTContext &Class::GetClangASTContext()" functions.
This cleans up type systems to be more pluggable. Prior to this we had issues:
- Module, SymbolFile, and many others has "ClangASTContext &GetClangASTContext()" functions. All have been switched over to use "TypeSystem *GetTypeSystemForLanguage()"
- Cleaned up any places that were using the GetClangASTContext() functions to use TypeSystem
- Cleaned up Module so that it no longer has dedicated type system member variables:
lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module.
lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module.
Now we have a type system map:
typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap;
TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module
- Many places in code were using ClangASTContext static functions to place with CompilerType objects and add modifiers (const, volatile, restrict) and to make typedefs, L and R value references and more. These have been made into CompilerType functions that are abstract:
class CompilerType
{
...
//----------------------------------------------------------------------
// Return a new CompilerType that is a L value reference to this type if
// this type is valid and the type system supports L value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetLValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType that is a R value reference to this type if
// this type is valid and the type system supports R value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetRValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a const modifier to this type if
// this type is valid and the type system supports const modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddConstModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a volatile modifier to this type if
// this type is valid and the type system supports volatile modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddVolatileModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a restrict modifier to this type if
// this type is valid and the type system supports restrict modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddRestrictModifier () const;
//----------------------------------------------------------------------
// Create a typedef to this type using "name" as the name of the typedef
// this type is valid and the type system supports typedefs, else return
// an invalid type.
//----------------------------------------------------------------------
CompilerType
CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const;
};
Other changes include:
- Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with "CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size);"
- Fixed code in Type.h to not request the full type for a type for no good reason, just request the forward type and let the type expand as needed
llvm-svn: 247953
2015-09-18 06:23:34 +08:00
|
|
|
if (type_system)
|
|
|
|
m_intptr_type = TypeFromUser(type_system->GetBuiltinTypeForEncodingAndBitSize(eEncodingUint, target_sp->GetArchitecture().GetAddressByteSize() * 8));
|
2011-08-13 05:40:01 +08:00
|
|
|
}
|
2010-11-12 11:22:21 +08:00
|
|
|
}
|
2011-08-13 05:40:01 +08:00
|
|
|
return m_intptr_type;
|
2010-11-12 11:22:21 +08:00
|
|
|
}
|
|
|
|
|
2015-12-15 09:33:19 +08:00
|
|
|
ThreadPlanAssemblyTracer::~ThreadPlanAssemblyTracer() = default;
|
2010-11-12 11:22:21 +08:00
|
|
|
|
2011-01-07 06:15:06 +08:00
|
|
|
void
|
|
|
|
ThreadPlanAssemblyTracer::TracingStarted ()
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
2011-01-07 06:15:06 +08:00
|
|
|
RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
|
2010-11-12 11:22:21 +08:00
|
|
|
|
2015-12-15 09:33:19 +08:00
|
|
|
if (m_register_values.empty())
|
2011-05-18 09:58:14 +08:00
|
|
|
m_register_values.resize (reg_ctx->GetRegisterCount());
|
2010-11-12 11:22:21 +08:00
|
|
|
}
|
|
|
|
|
2011-01-07 06:15:06 +08:00
|
|
|
void
|
|
|
|
ThreadPlanAssemblyTracer::TracingEnded ()
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
2011-05-18 09:58:14 +08:00
|
|
|
m_register_values.clear();
|
2010-11-12 11:22:21 +08:00
|
|
|
}
|
|
|
|
|
2011-01-07 06:15:06 +08:00
|
|
|
void
|
|
|
|
ThreadPlanAssemblyTracer::Log ()
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
|
|
|
Stream *stream = GetLogStream ();
|
|
|
|
|
|
|
|
if (!stream)
|
|
|
|
return;
|
|
|
|
|
2011-01-07 06:15:06 +08:00
|
|
|
RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
|
2010-11-12 11:22:21 +08:00
|
|
|
|
|
|
|
lldb::addr_t pc = reg_ctx->GetPC();
|
2012-02-21 08:09:25 +08:00
|
|
|
ProcessSP process_sp (m_thread.GetProcess());
|
2010-11-12 11:22:21 +08:00
|
|
|
Address pc_addr;
|
|
|
|
bool addr_valid = false;
|
2011-08-13 05:40:01 +08:00
|
|
|
uint8_t buffer[16] = {0}; // Must be big enough for any single instruction
|
2012-02-21 08:09:25 +08:00
|
|
|
addr_valid = process_sp->GetTarget().GetSectionLoadList().ResolveLoadAddress (pc, pc_addr);
|
2010-11-12 11:22:21 +08:00
|
|
|
|
2011-05-18 09:58:14 +08:00
|
|
|
pc_addr.Dump(stream, &m_thread, Address::DumpStyleResolvedDescription, Address::DumpStyleModuleWithFileAddress);
|
2011-06-23 05:13:28 +08:00
|
|
|
stream->PutCString (" ");
|
2010-11-12 11:22:21 +08:00
|
|
|
|
2011-08-13 05:40:01 +08:00
|
|
|
Disassembler *disassembler = GetDisassembler();
|
|
|
|
if (disassembler)
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
|
|
|
Error err;
|
2012-02-21 08:09:25 +08:00
|
|
|
process_sp->ReadMemory(pc, buffer, sizeof(buffer), err);
|
2010-11-12 11:22:21 +08:00
|
|
|
|
|
|
|
if (err.Success())
|
|
|
|
{
|
2011-08-13 05:40:01 +08:00
|
|
|
DataExtractor extractor(buffer, sizeof(buffer),
|
2012-02-21 08:09:25 +08:00
|
|
|
process_sp->GetByteOrder(),
|
|
|
|
process_sp->GetAddressByteSize());
|
2010-11-12 11:22:21 +08:00
|
|
|
|
2013-03-29 07:42:53 +08:00
|
|
|
bool data_from_file = false;
|
2010-11-12 11:22:21 +08:00
|
|
|
if (addr_valid)
|
2013-03-29 07:42:53 +08:00
|
|
|
disassembler->DecodeInstructions (pc_addr, extractor, 0, 1, false, data_from_file);
|
2010-11-12 11:22:21 +08:00
|
|
|
else
|
2013-03-29 07:42:53 +08:00
|
|
|
disassembler->DecodeInstructions (Address (pc), extractor, 0, 1, false, data_from_file);
|
2010-11-12 11:22:21 +08:00
|
|
|
|
2011-08-13 05:40:01 +08:00
|
|
|
InstructionList &instruction_list = disassembler->GetInstructionList();
|
Added the ability to get the min and max instruction byte size for
an architecture into ArchSpec:
uint32_t
ArchSpec::GetMinimumOpcodeByteSize() const;
uint32_t
ArchSpec::GetMaximumOpcodeByteSize() const;
Added an AddressClass to the Instruction class in Disassembler.h.
This allows decoded instructions to know know if they are code,
code with alternate ISA (thumb), or even data which can be mixed
into code. The instruction does have an address, but it is a good
idea to cache this value so we don't have to look it up more than
once.
Fixed an issue in Opcode::SetOpcodeBytes() where the length wasn't
getting set.
Changed:
bool
SymbolContextList::AppendIfUnique (const SymbolContext& sc);
To:
bool
SymbolContextList::AppendIfUnique (const SymbolContext& sc,
bool merge_symbol_into_function);
This function was typically being used when looking up functions
and symbols. Now if you lookup a function, then find the symbol,
they can be merged into the same symbol context and not cause
multiple symbol contexts to appear in a symbol context list that
describes the same function.
Fixed the SymbolContext not equal operator which was causing mixed
mode disassembly to not work ("disassembler --mixed --name main").
Modified the disassembler classes to know about the fact we know,
for a given architecture, what the min and max opcode byte sizes
are. The InstructionList class was modified to return the max
opcode byte size for all of the instructions in its list.
These two fixes means when disassemble a list of instructions and dump
them and show the opcode bytes, we can format the output more
intelligently when showing opcode bytes. This affects any architectures
that have varying opcode byte sizes (x86_64 and i386). Knowing the max
opcode byte size also helps us to be able to disassemble N instructions
without having to re-read data if we didn't read enough bytes.
Added the ability to set the architecture for the disassemble command.
This means you can easily cross disassemble data for any supported
architecture. I also added the ability to specify "thumb" as an
architecture so that we can force disassembly into thumb mode when
needed. In GDB this was done using a hack of specifying an odd
address when disassembling. I don't want to repeat this hack in LLDB,
so the auto detection between ARM and thumb is failing, just specify
thumb when disassembling:
(lldb) disassemble --arch thumb --name main
You can also have data in say an x86_64 file executable and disassemble
data as any other supported architecture:
% lldb a.out
Current executable set to 'a.out' (x86_64).
(lldb) b main
(lldb) run
(lldb) disassemble --arch thumb --count 2 --start-address 0x0000000100001080 --bytes
0x100001080: 0xb580 push {r7, lr}
0x100001082: 0xaf00 add r7, sp, #0
Fixed Target::ReadMemory(...) to be able to deal with Address argument object
that isn't section offset. When an address object was supplied that was
out on the heap or stack, target read memory would fail. Disassembly uses
Target::ReadMemory(...), and the example above where we disassembler thumb
opcodes in an x86 binary was failing do to this bug.
llvm-svn: 128347
2011-03-27 03:14:58 +08:00
|
|
|
const uint32_t max_opcode_byte_size = instruction_list.GetMaxOpcocdeByteSize();
|
|
|
|
|
2010-11-12 11:22:21 +08:00
|
|
|
if (instruction_list.GetSize())
|
|
|
|
{
|
2011-05-18 09:58:14 +08:00
|
|
|
const bool show_bytes = true;
|
|
|
|
const bool show_address = true;
|
2010-11-12 11:22:21 +08:00
|
|
|
Instruction *instruction = instruction_list.GetInstructionAtIndex(0).get();
|
2015-02-05 06:00:53 +08:00
|
|
|
const FormatEntity::Entry *disassemble_format = m_thread.GetProcess()->GetTarget().GetDebugger().GetDisassemblyFormat();
|
2015-12-15 09:33:19 +08:00
|
|
|
instruction->Dump(stream,
|
|
|
|
max_opcode_byte_size,
|
|
|
|
show_address,
|
|
|
|
show_bytes,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
disassemble_format,
|
|
|
|
0);
|
2010-11-12 11:22:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-21 08:09:25 +08:00
|
|
|
const ABI *abi = process_sp->GetABI().get();
|
2011-08-13 05:40:01 +08:00
|
|
|
TypeFromUser intptr_type = GetIntPointerType();
|
|
|
|
|
|
|
|
if (abi && intptr_type.IsValid())
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
|
|
|
ValueList value_list;
|
|
|
|
const int num_args = 1;
|
|
|
|
|
|
|
|
for (int arg_index = 0; arg_index < num_args; ++arg_index)
|
|
|
|
{
|
|
|
|
Value value;
|
|
|
|
value.SetValueType (Value::eValueTypeScalar);
|
2013-07-12 06:46:58 +08:00
|
|
|
// value.SetContext (Value::eContextTypeClangType, intptr_type.GetOpaqueQualType());
|
2015-08-25 07:46:31 +08:00
|
|
|
value.SetCompilerType (intptr_type);
|
2010-11-12 11:22:21 +08:00
|
|
|
value_list.PushValue (value);
|
|
|
|
}
|
|
|
|
|
2011-08-13 05:40:01 +08:00
|
|
|
if (abi->GetArgumentValues (m_thread, value_list))
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
|
|
|
for (int arg_index = 0; arg_index < num_args; ++arg_index)
|
|
|
|
{
|
2011-05-18 09:58:14 +08:00
|
|
|
stream->Printf("\n\targ[%d]=%llx", arg_index, value_list.GetValueAtIndex(arg_index)->GetScalar().ULongLong());
|
2010-11-12 11:22:21 +08:00
|
|
|
|
|
|
|
if (arg_index + 1 < num_args)
|
2011-05-18 09:58:14 +08:00
|
|
|
stream->PutCString (", ");
|
2010-11-12 11:22:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-12-15 09:33:19 +08:00
|
|
|
|
2011-05-18 09:58:14 +08:00
|
|
|
RegisterValue reg_value;
|
|
|
|
for (uint32_t reg_num = 0, num_registers = reg_ctx->GetRegisterCount();
|
|
|
|
reg_num < num_registers;
|
|
|
|
++reg_num)
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
2011-05-18 09:58:14 +08:00
|
|
|
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg_num);
|
|
|
|
if (reg_ctx->ReadRegister (reg_info, reg_value))
|
2010-11-12 11:22:21 +08:00
|
|
|
{
|
2011-05-18 09:58:14 +08:00
|
|
|
assert (reg_num < m_register_values.size());
|
|
|
|
if (m_register_values[reg_num].GetType() == RegisterValue::eTypeInvalid ||
|
|
|
|
reg_value != m_register_values[reg_num])
|
|
|
|
{
|
|
|
|
if (reg_value.GetType() != RegisterValue::eTypeInvalid)
|
|
|
|
{
|
|
|
|
stream->PutCString ("\n\t");
|
|
|
|
reg_value.Dump(stream, reg_info, true, false, eFormatDefault);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_register_values[reg_num] = reg_value;
|
2010-11-12 11:22:21 +08:00
|
|
|
}
|
|
|
|
}
|
2011-05-18 09:58:14 +08:00
|
|
|
stream->EOL();
|
2011-06-16 03:35:17 +08:00
|
|
|
stream->Flush();
|
2010-11-12 11:22:21 +08:00
|
|
|
}
|