Files
clang-p2996/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
Greg Clayton dda4f7b520 Centralized all disassembly into static functions in source/Core/Disassembler.cpp.
Added the ability to read memory from the target's object files when we aren't
running, so disassembling works before you run!

Cleaned up the API to lldb_private::Target::ReadMemory().

Cleaned up the API to the Disassembler to use actual "lldb_private::Address"
objects instead of just an "addr_t". This is nice because the Address objects
when resolved carry along their section and module which can get us the 
object file. This allows Target::ReadMemory to be used when we are not 
running.

Added a new lldb_private::Address dump style: DumpStyleDetailedSymbolContext
This will show a full breakdown of what an address points to. To see some
sample output, execute a "image lookup --address <addr>".

Fixed SymbolContext::DumpStopContext(...) to not require a live process in
order to be able to print function and symbol offsets.

llvm-svn: 107350
2010-06-30 23:03:03 +00:00

111 lines
2.8 KiB
C++

//===-- DisassemblerLLVM.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_DisassemblerLLVM_h_
#define liblldb_DisassemblerLLVM_h_
#include "lldb/Core/Disassembler.h"
#include "lldb/Host/Mutex.h"
struct EDDisassembler;
typedef EDDisassembler *EDDisassemblerRef;
struct EDInst;
typedef EDInst *EDInstRef;
class DisassemblerLLVM : public lldb_private::Disassembler
{
public:
class Instruction : public lldb_private::Disassembler::Instruction
{
public:
Instruction(EDDisassemblerRef disassembler);
virtual
~Instruction();
void
Dump (lldb_private::Stream *s,
lldb_private::Address *instr_addr_ptr,
const lldb_private::DataExtractor *bytes,
uint32_t bytes_offset,
const lldb_private::ExecutionContext& exe_ctx,
bool raw);
bool
DoesBranch () const;
size_t
GetByteSize() const;
size_t
Extract (const lldb_private::DataExtractor &data,
uint32_t data_offset);
protected:
EDDisassemblerRef m_disassembler;
EDInstRef m_inst;
};
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
static void
Initialize();
static void
Terminate();
static const char *
GetPluginNameStatic();
static const char *
GetPluginDescriptionStatic();
static lldb_private::Disassembler *
CreateInstance(const lldb_private::ArchSpec &arch);
DisassemblerLLVM(const lldb_private::ArchSpec &arch);
virtual
~DisassemblerLLVM();
size_t
DecodeInstructions (const lldb_private::DataExtractor& data,
uint32_t data_offset,
uint32_t num_instructions);
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual const char *
GetPluginName();
virtual const char *
GetShortPluginName();
virtual uint32_t
GetPluginVersion();
virtual void
GetPluginCommandHelp (const char *command, lldb_private::Stream *strm);
virtual lldb_private::Error
ExecutePluginCommand (lldb_private::Args &command, lldb_private::Stream *strm);
virtual lldb_private::Log *
EnablePluginLogging (lldb_private::Stream *strm, lldb_private::Args &command);
protected:
EDDisassemblerRef m_disassembler;
};
#endif // liblldb_DisassemblerLLVM_h_