mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-07-04 07:08:13 +00:00
Followup to address some review comments from Issue 259
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@297 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
324d84c2f6
commit
5f27d9125c
|
@ -328,12 +328,14 @@ static bool CompareAddress(T1 *a, T2 *b) {
|
||||||
// Sort the array into increasing ordered array based on the virtual address.
|
// Sort the array into increasing ordered array based on the virtual address.
|
||||||
// Return vector of pointers to the elements in the incoming array. So caller
|
// Return vector of pointers to the elements in the incoming array. So caller
|
||||||
// should make sure the returned vector lives longer than the incoming vector.
|
// should make sure the returned vector lives longer than the incoming vector.
|
||||||
template<class T>
|
template<class Container>
|
||||||
static std::vector<T *> SortByAddress(std::list<T> *array) {
|
static std::vector<typename Container::value_type *> SortByAddress(
|
||||||
typedef typename std::list<T>::iterator It;
|
Container *container) {
|
||||||
|
typedef typename Container::iterator It;
|
||||||
|
typedef typename Container::value_type T;
|
||||||
std::vector<T *> sorted_array_ptr;
|
std::vector<T *> sorted_array_ptr;
|
||||||
sorted_array_ptr.reserve(array->size());
|
sorted_array_ptr.reserve(container->size());
|
||||||
for (It it = array -> begin(); it != array -> end(); it++)
|
for (It it = container->begin(); it != container->end(); it++)
|
||||||
sorted_array_ptr.push_back(&(*it));
|
sorted_array_ptr.push_back(&(*it));
|
||||||
std::sort(sorted_array_ptr.begin(),
|
std::sort(sorted_array_ptr.begin(),
|
||||||
sorted_array_ptr.end(),
|
sorted_array_ptr.end(),
|
||||||
|
@ -379,7 +381,8 @@ static ElfW(Addr) NextAddress(
|
||||||
|
|
||||||
static int FindFileByNameIdx(uint32_t name_index,
|
static int FindFileByNameIdx(uint32_t name_index,
|
||||||
SourceFileInfoList &files) {
|
SourceFileInfoList &files) {
|
||||||
for (SourceFileInfoList::iterator it = files.begin(); it != files.end(); it++) {
|
for (SourceFileInfoList::iterator it = files.begin();
|
||||||
|
it != files.end(); it++) {
|
||||||
if (it->name_index == name_index)
|
if (it->name_index == name_index)
|
||||||
return it->source_id;
|
return it->source_id;
|
||||||
}
|
}
|
||||||
|
@ -391,7 +394,8 @@ static int FindFileByNameIdx(uint32_t name_index,
|
||||||
// Also fix the source id for the line info.
|
// Also fix the source id for the line info.
|
||||||
static void AddIncludedFiles(struct SymbolInfo *symbols,
|
static void AddIncludedFiles(struct SymbolInfo *symbols,
|
||||||
const ElfW(Shdr) *stabstr_section) {
|
const ElfW(Shdr) *stabstr_section) {
|
||||||
for (SourceFileInfoList::iterator source_file_it = symbols->source_file_info.begin();
|
for (SourceFileInfoList::iterator source_file_it =
|
||||||
|
symbols->source_file_info.begin();
|
||||||
source_file_it != symbols->source_file_info.end();
|
source_file_it != symbols->source_file_info.end();
|
||||||
++source_file_it) {
|
++source_file_it) {
|
||||||
struct SourceFileInfo &source_file = *source_file_it;
|
struct SourceFileInfo &source_file = *source_file_it;
|
||||||
|
@ -624,7 +628,8 @@ static bool WriteModuleInfo(int fd,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool WriteSourceFileInfo(int fd, const struct SymbolInfo &symbols) {
|
static bool WriteSourceFileInfo(int fd, const struct SymbolInfo &symbols) {
|
||||||
for (SourceFileInfoList::const_iterator it = symbols.source_file_info.begin();
|
for (SourceFileInfoList::const_iterator it =
|
||||||
|
symbols.source_file_info.begin();
|
||||||
it != symbols.source_file_info.end(); it++) {
|
it != symbols.source_file_info.end(); it++) {
|
||||||
if (it->source_id != -1) {
|
if (it->source_id != -1) {
|
||||||
const char *name = it->name;
|
const char *name = it->name;
|
||||||
|
@ -668,7 +673,8 @@ static bool WriteOneFunction(int fd,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool WriteFunctionInfo(int fd, const struct SymbolInfo &symbols) {
|
static bool WriteFunctionInfo(int fd, const struct SymbolInfo &symbols) {
|
||||||
for (SourceFileInfoList::const_iterator it = symbols.source_file_info.begin();
|
for (SourceFileInfoList::const_iterator it =
|
||||||
|
symbols.source_file_info.begin();
|
||||||
it != symbols.source_file_info.end(); it++) {
|
it != symbols.source_file_info.end(); it++) {
|
||||||
const struct SourceFileInfo &file_info = *it;
|
const struct SourceFileInfo &file_info = *it;
|
||||||
for (FuncInfoList::const_iterator fiIt = file_info.func_info.begin();
|
for (FuncInfoList::const_iterator fiIt = file_info.func_info.begin();
|
||||||
|
|
Loading…
Reference in a new issue