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

Side by Side Diff: breakpad/linux/minidump-2-core.cc

Issue 200013: Linux Breakpad: Use MD_MODULE_SIZE in place of sizeof(MDRawModule).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | breakpad/linux/minidump_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009, Google Inc. 1 // Copyright (c) 2009, 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 413 }
414 414
415 static void 415 static void
416 ParseModuleStream(CrashedProcess* crashinfo, MMappedRange range) { 416 ParseModuleStream(CrashedProcess* crashinfo, MMappedRange range) {
417 const uint32_t num_mappings = 417 const uint32_t num_mappings =
418 *(const uint32_t*) range.GetObject(0, sizeof(uint32_t)); 418 *(const uint32_t*) range.GetObject(0, sizeof(uint32_t));
419 for (unsigned i = 0; i < num_mappings; ++i) { 419 for (unsigned i = 0; i < num_mappings; ++i) {
420 CrashedProcess::Mapping mapping; 420 CrashedProcess::Mapping mapping;
421 const MDRawModule* rawmodule = 421 const MDRawModule* rawmodule =
422 (MDRawModule*) range.GetArrayElement(sizeof(uint32_t), 422 (MDRawModule*) range.GetArrayElement(sizeof(uint32_t),
423 sizeof(MDRawModule), i); 423 MD_MODULE_SIZE, i);
424 mapping.start_address = rawmodule->base_of_image; 424 mapping.start_address = rawmodule->base_of_image;
425 mapping.end_address = rawmodule->size_of_image + rawmodule->base_of_image; 425 mapping.end_address = rawmodule->size_of_image + rawmodule->base_of_image;
426 426
427 crashinfo->mappings.push_back(mapping); 427 crashinfo->mappings.push_back(mapping);
428 } 428 }
429 } 429 }
430 430
431 int 431 int
432 main(int argc, char** argv) { 432 main(int argc, char** argv) {
433 if (argc != 2) 433 if (argc != 2)
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 for (unsigned i = 0; i < crashinfo.threads.size(); ++i) { 594 for (unsigned i = 0; i < crashinfo.threads.size(); ++i) {
595 const CrashedProcess::Thread& thread = crashinfo.threads[i]; 595 const CrashedProcess::Thread& thread = crashinfo.threads[i];
596 if (!writea(1, thread.stack, thread.stack_length)) 596 if (!writea(1, thread.stack, thread.stack_length))
597 return 1; 597 return 1;
598 } 598 }
599 599
600 munmap(const_cast<void*>(bytes), st.st_size); 600 munmap(const_cast<void*>(bytes), st.st_size);
601 601
602 return 0; 602 return 0;
603 } 603 }
OLDNEW
« no previous file with comments | « no previous file | breakpad/linux/minidump_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698