124943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner//===-- AddressResolver.cpp -------------------------------------*- C++ -*-===//
224943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner//
324943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner//                     The LLVM Compiler Infrastructure
424943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner//
524943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner// This file is distributed under the University of Illinois Open Source
624943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner// License. See LICENSE.TXT for details.
724943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner//
824943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner//===----------------------------------------------------------------------===//
924943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
1024943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/Core/AddressResolver.h"
1124943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
1224943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
1324943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner// Project includes
1424943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
1524943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/Core/Address.h"
1624943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/Core/Log.h"
1724943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/Core/ModuleList.h"
1824943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/Core/SearchFilter.h"
1924943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/Core/Stream.h"
2024943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/Core/StreamString.h"
2124943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/Symbol/SymbolContext.h"
2224943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/Target/Target.h"
2324943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner#include "lldb/lldb-private-log.h"
2424943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
2524943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattnerusing namespace lldb_private;
2624943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
2724943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner//----------------------------------------------------------------------
2824943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner// AddressResolver:
2924943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner//----------------------------------------------------------------------
3024943d2ee8bfaa7cf5893e4709143924157a5c1eChris LattnerAddressResolver::AddressResolver ()
3124943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner{
3224943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner}
3324943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
3424943d2ee8bfaa7cf5893e4709143924157a5c1eChris LattnerAddressResolver::~AddressResolver ()
3524943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner{
3624943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
3724943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner}
3824943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
3924943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattnervoid
4024943d2ee8bfaa7cf5893e4709143924157a5c1eChris LattnerAddressResolver::ResolveAddressInModules (SearchFilter &filter, ModuleList &modules)
4124943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner{
4224943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner    filter.SearchInModuleList(*this, modules);
4324943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner}
4424943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
4524943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattnervoid
4624943d2ee8bfaa7cf5893e4709143924157a5c1eChris LattnerAddressResolver::ResolveAddress (SearchFilter &filter)
4724943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner{
4824943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner    filter.Search (*this);
4924943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner}
5024943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
5124943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattnerstd::vector<AddressRange> &
5224943d2ee8bfaa7cf5893e4709143924157a5c1eChris LattnerAddressResolver::GetAddressRanges ()
5324943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner{
5424943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner    return m_address_ranges;
5524943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner}
5624943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
5724943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattnersize_t
5824943d2ee8bfaa7cf5893e4709143924157a5c1eChris LattnerAddressResolver::GetNumberOfAddresses ()
5924943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner{
6024943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner    return m_address_ranges.size();
6124943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner}
6224943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner
6324943d2ee8bfaa7cf5893e4709143924157a5c1eChris LattnerAddressRange &
6424943d2ee8bfaa7cf5893e4709143924157a5c1eChris LattnerAddressResolver::GetAddressRangeAtIndex (size_t idx)
6524943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner{
6624943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner  return m_address_ranges[idx];
6724943d2ee8bfaa7cf5893e4709143924157a5c1eChris Lattner}
68