Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: src/common/dwarf_cu_to_module.cc

Issue 1605153004: unittests: fix -Wnarrowing build errors (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: convert to uint8_t Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 Google Inc. 1 // Copyright (c) 2010 Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 : filename_(filename), 133 : filename_(filename),
134 module_(module), 134 module_(module),
135 handle_inter_cu_refs_(handle_inter_cu_refs), 135 handle_inter_cu_refs_(handle_inter_cu_refs),
136 file_private_(new FilePrivate()) { 136 file_private_(new FilePrivate()) {
137 } 137 }
138 138
139 DwarfCUToModule::FileContext::~FileContext() { 139 DwarfCUToModule::FileContext::~FileContext() {
140 } 140 }
141 141
142 void DwarfCUToModule::FileContext::AddSectionToSectionMap( 142 void DwarfCUToModule::FileContext::AddSectionToSectionMap(
143 const string& name, const char* contents, uint64 length) { 143 const string& name, const uint8_t *contents, uint64 length) {
144 section_map_[name] = std::make_pair(contents, length); 144 section_map_[name] = std::make_pair(contents, length);
145 } 145 }
146 146
147 void DwarfCUToModule::FileContext::ClearSectionMapForTest() { 147 void DwarfCUToModule::FileContext::ClearSectionMapForTest() {
148 section_map_.clear(); 148 section_map_.clear();
149 } 149 }
150 150
151 const dwarf2reader::SectionMap& 151 const dwarf2reader::SectionMap&
152 DwarfCUToModule::FileContext::section_map() const { 152 DwarfCUToModule::FileContext::section_map() const {
153 return section_map_; 153 return section_map_;
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 dwarf2reader::SectionMap::const_iterator map_entry 807 dwarf2reader::SectionMap::const_iterator map_entry
808 = section_map.find(".debug_line"); 808 = section_map.find(".debug_line");
809 // Mac OS X puts DWARF data in sections whose names begin with "__" 809 // Mac OS X puts DWARF data in sections whose names begin with "__"
810 // instead of ".". 810 // instead of ".".
811 if (map_entry == section_map.end()) 811 if (map_entry == section_map.end())
812 map_entry = section_map.find("__debug_line"); 812 map_entry = section_map.find("__debug_line");
813 if (map_entry == section_map.end()) { 813 if (map_entry == section_map.end()) {
814 cu_context_->reporter->MissingSection(".debug_line"); 814 cu_context_->reporter->MissingSection(".debug_line");
815 return; 815 return;
816 } 816 }
817 const char *section_start = map_entry->second.first; 817 const uint8_t *section_start = map_entry->second.first;
818 uint64 section_length = map_entry->second.second; 818 uint64 section_length = map_entry->second.second;
819 if (offset >= section_length) { 819 if (offset >= section_length) {
820 cu_context_->reporter->BadLineInfoOffset(offset); 820 cu_context_->reporter->BadLineInfoOffset(offset);
821 return; 821 return;
822 } 822 }
823 line_reader_->ReadProgram(section_start + offset, section_length - offset, 823 line_reader_->ReadProgram(section_start + offset, section_length - offset,
824 cu_context_->file_context->module_, &lines_); 824 cu_context_->file_context->module_, &lines_);
825 } 825 }
826 826
827 namespace { 827 namespace {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 return dwarf_version >= 2; 1064 return dwarf_version >= 2;
1065 } 1065 }
1066 1066
1067 bool DwarfCUToModule::StartRootDIE(uint64 offset, enum DwarfTag tag) { 1067 bool DwarfCUToModule::StartRootDIE(uint64 offset, enum DwarfTag tag) {
1068 // We don't deal with partial compilation units (the only other tag 1068 // We don't deal with partial compilation units (the only other tag
1069 // likely to be used for root DIE). 1069 // likely to be used for root DIE).
1070 return tag == dwarf2reader::DW_TAG_compile_unit; 1070 return tag == dwarf2reader::DW_TAG_compile_unit;
1071 } 1071 }
1072 1072
1073 } // namespace google_breakpad 1073 } // namespace google_breakpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698