Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash -e
g++ -Wall -Wextra -std=c++11 -O2 DWARFDebugInfoEntry.cpp \
-c -o DWARFDebugInfoEntry.o
g++ -Wall -Wextra -std=c++11 -O2 main.cpp -c -o main.o
g++ DWARFDebugInfoEntry.o main.o -o main
./main
//
#include <stdint.h>
#include <vector>
typedef std::vector<std::pair<uint64_t, uint64_t>> DWARFAddressRangesVector;
void dumpRanges(const DWARFAddressRangesVector& Ranges) {
for (const auto &Range: Ranges) {
(void)Range;
}
}
void collectChildrenAddressRanges(DWARFAddressRangesVector& Ranges)
{
const DWARFAddressRangesVector &DIERanges = DWARFAddressRangesVector();
Ranges.insert(Ranges.end(), DIERanges.begin(), DIERanges.end());
}
//
#include <stdint.h>
#include <vector>
typedef std::vector<std::pair<uint64_t, uint64_t>> DWARFAddressRangesVector;
void collectAddressRanges(DWARFAddressRangesVector &CURanges,
const DWARFAddressRangesVector &CUDIERanges)
{
CURanges.insert(CURanges.end(), CUDIERanges.begin(), CUDIERanges.end());
}
int main()
{
std::vector<std::pair<uint64_t, uint64_t>> CURanges;
std::vector<std::pair<uint64_t, uint64_t>> CUDIERanges{{1, 2}};
collectAddressRanges(CURanges, CUDIERanges);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment