an interface to a local or remote debugging platform. By default each host OS that supports LLDB should be registering a "default" platform that will be used unless a new platform is selected. Platforms are responsible for things such as: - getting process information by name or by processs ID - finding platform files. This is useful for remote debugging where there is an SDK with files that might already or need to be cached for debug access. - getting a list of platform supported architectures in the exact order they should be selected. This helps the native x86 platform on MacOSX select the correct x86_64/i386 slice from universal binaries. - Connect to remote platforms for remote debugging - Resolving an executable including finding an executable inside platform specific bundles (macosx uses .app bundles that contain files) and also selecting the appropriate slice of universal files for a given platform. So by default there is always a local platform, but remote platforms can be connected to. I will soon be adding a new "platform" command that will support the following commands: (lldb) platform connect --name machine1 macosx connect://host:port Connected to "machine1" platform. (lldb) platform disconnect macosx This allows LLDB to be well setup to do remote debugging and also once connected process listing and finding for things like: (lldb) process attach --name x<TAB> The currently selected platform plug-in can now auto complete any available processes that start with "x". The responsibilities for the platform plug-in will soon grow and expand. llvm-svn: 127286
90 lines
2.3 KiB
C++
90 lines
2.3 KiB
C++
//===-- AddressResolver.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_AddressResolver_h_
|
|
#define liblldb_AddressResolver_h_
|
|
|
|
#include <vector>
|
|
|
|
// C Includes
|
|
// C++ Includes
|
|
// Other libraries and framework includes
|
|
// Project includes
|
|
#include "lldb/lldb-private.h"
|
|
#include "lldb/Core/Address.h"
|
|
#include "lldb/Core/AddressRange.h"
|
|
#include "lldb/Host/FileSpec.h"
|
|
#include "lldb/Core/SearchFilter.h"
|
|
#include "lldb/Core/ConstString.h"
|
|
|
|
namespace lldb_private {
|
|
|
|
//----------------------------------------------------------------------
|
|
/// @class AddressResolver AddressResolver.h "lldb/Core/AddressResolver.h"
|
|
/// @brief This class works with SearchFilter to resolve function names and
|
|
/// source file locations to their concrete addresses.
|
|
//----------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------
|
|
/// General Outline:
|
|
/// The AddressResolver is a Searcher. In that protocol,
|
|
/// the SearchFilter asks the question "At what depth of the symbol context
|
|
/// descent do you want your callback to get called?" of the filter. The resolver
|
|
/// answers this question (in the GetDepth method) and provides the resolution callback.
|
|
//----------------------------------------------------------------------
|
|
|
|
class AddressResolver :
|
|
public Searcher
|
|
{
|
|
public:
|
|
|
|
typedef enum
|
|
{
|
|
Exact,
|
|
Regexp,
|
|
Glob
|
|
} MatchType;
|
|
|
|
|
|
AddressResolver ();
|
|
|
|
virtual
|
|
~AddressResolver ();
|
|
|
|
virtual void
|
|
ResolveAddress (SearchFilter &filter);
|
|
|
|
virtual void
|
|
ResolveAddressInModules (SearchFilter &filter,
|
|
ModuleList &modules);
|
|
|
|
virtual void
|
|
GetDescription (Stream *s) = 0;
|
|
|
|
std::vector<AddressRange> &
|
|
GetAddressRanges ();
|
|
|
|
size_t
|
|
GetNumberOfAddresses ();
|
|
|
|
AddressRange &
|
|
GetAddressRangeAtIndex (size_t idx);
|
|
|
|
protected:
|
|
|
|
std::vector<AddressRange> m_address_ranges;
|
|
|
|
private:
|
|
DISALLOW_COPY_AND_ASSIGN(AddressResolver);
|
|
};
|
|
|
|
} // namespace lldb_private
|
|
|
|
#endif // liblldb_AddressResolver_h_
|