aboutsummaryrefslogtreecommitdiff
path: root/src/common/module_unittest.cc
diff options
context:
space:
mode:
authorjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-05-05 17:35:10 +0000
committerjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-05-05 17:35:10 +0000
commit25b512d64dc9ec959d646151cf0cdc403ea0c335 (patch)
treef17ee11f3b5aa09c65accf8b9903b7c7c894363a /src/common/module_unittest.cc
parentBreakpad Linux dumper: Handle STABS-in-symbol-table, and line number records ... (diff)
downloadbreakpad-25b512d64dc9ec959d646151cf0cdc403ea0c335.tar.xz
Breakpad symbol dumper: Promise that Module::SetLoadAddress can be called at any time.
It's possible to imagine an implementation of google_breakpad::Module in which calling SetLoadAddress at different times as the Module is populated would produce different output. For the Mac dumper, we'd like to depend on its current behavior --- that the load address is subtracted off only when writing the symbol file, and can be set at any time prior to that. This patch makes that promise part of Module's contract, and adjusts the test suite to verify that that promise is met. a=jimblandy, r=thestig git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@588 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/module_unittest.cc')
-rw-r--r--src/common/module_unittest.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc
index 07903411..dab0dac3 100644
--- a/src/common/module_unittest.cc
+++ b/src/common/module_unittest.cc
@@ -140,8 +140,6 @@ TEST(Write, RelativeLoadAddress) {
FILE *f = checked_tmpfile();
Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
- m.SetLoadAddress(0x2ab698b0b6407073LL);
-
// Some source files. We will expect to see them in lexicographic order.
Module::File *file1 = m.FindFile("filename-b.cc");
Module::File *file2 = m.FindFile("filename-a.cc");
@@ -174,6 +172,10 @@ TEST(Write, RelativeLoadAddress) {
entry->rule_changes[0x30f9e5c83323973eULL]["Mister"] = "Death";
m.AddStackFrameEntry(entry);
+ // Set the load address. Doing this after adding all the data to
+ // the module must work fine.
+ m.SetLoadAddress(0x2ab698b0b6407073LL);
+
m.Write(f);
checked_fflush(f);
rewind(f);