Skip to content

Commit

Permalink
Cleanup so we build cleanly under boost 1.41/gcc 4.4 again.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwilliams committed Sep 8, 2016
1 parent 714b5c5 commit 1f24d02
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 93 deletions.
1 change: 1 addition & 0 deletions dataflowAPI/src/SymEvalPolicy.C
Expand Up @@ -350,6 +350,7 @@ Absloc SymEvalPolicy_64::convert(PowerpcRegisterClass regtype, int regNum)
case powerpc_regclass_sr:break;
case powerpc_last_register_class:break;
}
return Absloc();
}

Absloc SymEvalPolicy_64::convert(X86GeneralPurposeRegister r)
Expand Down
14 changes: 13 additions & 1 deletion symtabAPI/src/LineInformation.C
Expand Up @@ -44,6 +44,7 @@ using namespace Dyninst::SymtabAPI;
using std::vector;

#include "LineInformation.h"
#include <sstream>

LineInformation::LineInformation() : wasted_compares(0), num_queries(0), strings_(new StringTable)
{
Expand Down Expand Up @@ -195,7 +196,18 @@ std::pair<LineInformation::const_line_info_iterator, LineInformation::const_line
LineInformation::equal_range(std::string file, const unsigned int lineNo) const {
auto found = strings_->get<1>().find(file);
unsigned index = strings_->project<0>(found) - strings_->begin();
return get<traits::line_info>().equal_range(std::make_tuple(index, lineNo));
// auto search_info = std::make_tuple(index, lineNo);
std::pair<LineInformation::const_line_info_iterator, LineInformation::const_line_info_iterator > bounds;
bounds = get<traits::line_info>().equal_range(index);
while((*bounds.first)->getLine() < lineNo && bounds.first != bounds.second) {
++bounds.first;
}
while((*bounds.second)->getLine() > lineNo && bounds.second != bounds.first) {
--bounds.second;
}
if(bounds.second != get<traits::line_info>().end()) ++bounds.second;
return bounds;
// return get<traits::line_info>().equal_range(boost::cref<std::tuple<unsigned int, unsigned int> >(search_info));

}

Expand Down
23 changes: 11 additions & 12 deletions symtabAPI/src/Module.C
Expand Up @@ -45,6 +45,7 @@
#include "common/src/pathName.h"
#include "common/src/serialize.h"
#include "Object.h"
#include <boost/foreach.hpp>

using namespace Dyninst;
using namespace Dyninst::SymtabAPI;
Expand Down Expand Up @@ -183,9 +184,7 @@ bool Module::getSourceLines(std::vector<LineNoTuple> &lines, Offset addressInRan

LineInformation *Module::parseLineInformation() {
// Allocate if none
using std::placeholders::_1;
using std::bind;
using std::for_each;
using boost::bind;
if (!lineInfo_)
{
lineInfo_ = new LineInformation;
Expand All @@ -201,8 +200,8 @@ LineInformation *Module::parseLineInformation() {
exec()->getObject()->parseLineInfoForCU(*cu, lineInfo_);
}
// Add ranges corresponding to each statement
for_each(lineInfo_->begin(), lineInfo_->end(),
bind(&Module::addRange, this, bind(&Statement::startAddr, _1), bind(&Statement::endAddr, _1)));
std::for_each(lineInfo_->begin(), lineInfo_->end(),
boost::bind(&Module::addRange, this, boost::bind(&Statement::startAddr, _1), boost::bind(&Statement::endAddr, _1)));

// Update in symtab: this module covers all ranges in its line info
finalizeRanges();
Expand Down Expand Up @@ -319,8 +318,8 @@ Module::Module(supportedLanguages lang, Offset adr,
language_(lang),
addr_(adr),
exec_(img),
ranges_finalized(false),
strings_(new StringTable)
strings_(new StringTable),
ranges_finalized(false)
{
fileName_ = extract_pathname_tail(fullNm);
}
Expand All @@ -333,8 +332,8 @@ Module::Module() :
language_(lang_Unknown),
addr_(0),
exec_(NULL),
ranges_finalized(false),
strings_(new StringTable)
strings_(new StringTable),
ranges_finalized(false)
{
}

Expand All @@ -346,10 +345,10 @@ Module::Module(const Module &mod) :
fullName_(mod.fullName_),
language_(mod.language_),
addr_(mod.addr_),
exec_(mod.exec_),
info_(mod.info_),
ranges_finalized(mod.ranges_finalized),
strings_(mod.strings_)
exec_(mod.exec_),
strings_(mod.strings_),
ranges_finalized(mod.ranges_finalized)

{
}
Expand Down
7 changes: 1 addition & 6 deletions symtabAPI/src/Object-elf.C
Expand Up @@ -2466,7 +2466,6 @@ bool Object::fix_global_symbol_modules_static_dwarf()
convertDebugOffset(start + len, actual_end);
Module* m = associated_symtab->getOrCreateModule(modname, actual_start);
m->addRange(actual_start, actual_end);
// cout << hex << "Set range from dw_aranges: " << modname << ": [" << actual_start << ", " << actual_end << ")" << endl;
m->setDebugInfo(cu_die);
dies_seen.insert(cu_die_off);
dwarf_dealloc(dbg, ranges[i], DW_DLA_ARANGE);
Expand Down Expand Up @@ -2510,11 +2509,7 @@ bool Object::fix_global_symbol_modules_static_dwarf()
}
dwarf_dealloc(dbg, ranges, DW_DLA_LIST);

// ModuleFixer m(dbg, this);
// bool result = m.parse();
// freeList.push_back(m.getFreeList());
// return result;

return true;
}

#else
Expand Down
2 changes: 1 addition & 1 deletion symtabAPI/src/Object.h
Expand Up @@ -148,7 +148,7 @@ class AObject {
SYMTAB_EXPORT virtual ~AObject();
// explicitly protected
SYMTAB_EXPORT AObject(MappedFile *, void (*err_func)(const char *), Symtab*);
virtual void parseLineInfoForCU(Module::DebugInfoT module_debug_info, LineInformation* li) { }
virtual void parseLineInfoForCU(Module::DebugInfoT , LineInformation* ) { }

MappedFile *mf;

Expand Down
75 changes: 2 additions & 73 deletions symtabAPI/src/dwarfWalker.h
Expand Up @@ -50,9 +50,9 @@ namespace Dyninst {
Dwarf_Debug dbg_;
public:
DwarfParseActions(Symtab* s, Dwarf_Debug d) :
symtab_(s),
mod_(NULL),
dbg_(d),
mod_(NULL)
symtab_(s)
{}
typedef std::vector<std::pair<Address, Address> > range_set_t;
typedef boost::shared_ptr<std::vector<std::pair<Address, Address> > > range_set_ptr;
Expand Down Expand Up @@ -374,77 +374,6 @@ namespace Dyninst {
virtual Symbol *findSymbolForCommonBlock(const std::string &commonBlockName);
};

class ModuleFixer: public DwarfWalker {
private:
virtual bool findType(Type *&type, bool defaultToVoid) {
return true;
}
public:
virtual std::string filename() const {
return obj()->getFileName();
}

ModuleFixer(Dwarf_Debug dbg, Object* obj)
: DwarfWalker(NULL, dbg), m_obj(obj) {}
virtual ~ModuleFixer() {}
protected:
virtual void setFuncReturnType() {
}
virtual Object* obj() const {
return m_obj;
}

virtual void createLocalVariable(const std::vector<VariableLocation> &locs, Type *type,
Dwarf_Unsigned variableLineNo,
const std::string &fileName) {
}


virtual bool createInlineFunc() {}

virtual void setFuncFromLowest(Address lowest) {
m_obj->setModuleForOffset(lowest, modname);
//setParseChild(false);
}


virtual void createParameter(const std::vector<VariableLocation> &locs, Type *paramType, Dwarf_Unsigned lineNo,
const std::string &fileName) {
}


virtual void setRanges(FunctionBase *func) {
}


virtual void createGlobalVariable(const std::vector<VariableLocation> &locs, Type *type) {
}


virtual bool addStaticClassVariable(const std::vector<VariableLocation> &locs, Type *type) {
return true;
}


virtual typeCommon *getCommonBlockType(std::string &commonBlockName) {
return NULL;
}
virtual void setModuleFromName(std::string moduleName) {
modname = moduleName;
}


virtual Symbol *findSymbolForCommonBlock(const std::string &commonBlockName) {
return NULL;
}
virtual bool parseVariable() {
return true;
}
private:
Object *m_obj;
std::string modname;
};

};
};

Expand Down

0 comments on commit 1f24d02

Please sign in to comment.