llvm-project/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h
Jonas Devlieghere 924d560867 Convert a location information from PDB to a DWARF expression
The current version of SymbolFilePDB::ParseVariableForPDBData function
always initializes variables with an empty location. This patch adds the
converter of a location information from PDB to a DWARF expression, so
it becomes possible to watch values of variables of primitive data
types. At the moment the converter supports only Static, TLS, RegRel,
Enregistered and Constant PDB location types, but it seems that it's
enough for most cases. There are still some problems with retrieving
values of variables (e.g. we can't watch variables of composite types),
but they look not relevant to the conversion to DWARF.

Patch by: Aleksandr Urakov

Differential revision: https://reviews.llvm.org/D49018

llvm-svn: 336988
2018-07-13 10:29:27 +00:00

46 lines
1.5 KiB
C++

//===-- PDBLocationToDWARFExpression.h --------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef lldb_Plugins_SymbolFile_PDB_PDBLocationToDWARFExpression_h_
#define lldb_Plugins_SymbolFile_PDB_PDBLocationToDWARFExpression_h_
#include "lldb/Core/Module.h"
namespace lldb_private {
class DWARFExpression;
}
namespace llvm {
namespace pdb {
class PDBSymbolData;
}
} // namespace llvm
//------------------------------------------------------------------------------
/// Converts a location information from a PDB symbol to a DWARF expression
///
/// @param[in] module
/// The module \a symbol belongs to.
///
/// @param[in] symbol
/// The symbol with a location information to convert.
///
/// @param[out] is_constant
/// Set to \b true if the result expression is a constant value data,
/// and \b false if it is a DWARF bytecode.
///
/// @return
/// The DWARF expression corresponding to the location data of \a symbol.
//------------------------------------------------------------------------------
lldb_private::DWARFExpression
ConvertPDBLocationToDWARFExpression(lldb::ModuleSP module,
const llvm::pdb::PDBSymbolData &symbol,
bool &is_constant);
#endif