Ensure a proper LinuxDumper::crash_thread_ value

Patch by Mike Hommey <mh@glandium.org>, R=me at https://breakpad.appspot.com/582002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1185 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ted.mielczarek@gmail.com 2013-05-17 19:50:00 +00:00
parent bcf029f333
commit ecd727f386
2 changed files with 4 additions and 4 deletions

View file

@ -73,7 +73,7 @@ LinuxDumper::LinuxDumper(pid_t pid)
: pid_(pid), : pid_(pid),
crash_address_(0), crash_address_(0),
crash_signal_(0), crash_signal_(0),
crash_thread_(0), crash_thread_(pid),
threads_(&allocator_, 8), threads_(&allocator_, 8),
mappings_(&allocator_), mappings_(&allocator_),
auxv_(&allocator_, AT_MAX + 1) { auxv_(&allocator_, AT_MAX + 1) {

View file

@ -84,7 +84,7 @@ TEST(MinidumpWriterTest, SetupWithPath) {
AutoTempDir temp_dir; AutoTempDir temp_dir;
string templ = temp_dir.path() + kMDWriterUnitTestFileName; string templ = temp_dir.path() + kMDWriterUnitTestFileName;
// Set a non-zero tid to avoid tripping asserts. // Set a non-zero tid to avoid tripping asserts.
context.tid = 1; context.tid = child;
ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context))); ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context)));
struct stat st; struct stat st;
ASSERT_EQ(0, stat(templ.c_str(), &st)); ASSERT_EQ(0, stat(templ.c_str(), &st));
@ -114,7 +114,7 @@ TEST(MinidumpWriterTest, SetupWithFD) {
string templ = temp_dir.path() + kMDWriterUnitTestFileName; string templ = temp_dir.path() + kMDWriterUnitTestFileName;
int fd = open(templ.c_str(), O_CREAT | O_WRONLY, S_IRWXU); int fd = open(templ.c_str(), O_CREAT | O_WRONLY, S_IRWXU);
// Set a non-zero tid to avoid tripping asserts. // Set a non-zero tid to avoid tripping asserts.
context.tid = 1; context.tid = child;
ASSERT_TRUE(WriteMinidump(fd, child, &context, sizeof(context))); ASSERT_TRUE(WriteMinidump(fd, child, &context, sizeof(context)));
struct stat st; struct stat st;
ASSERT_EQ(0, stat(templ.c_str(), &st)); ASSERT_EQ(0, stat(templ.c_str(), &st));
@ -391,7 +391,7 @@ TEST(MinidumpWriterTest, DeletedBinary) {
string templ = temp_dir.path() + kMDWriterUnitTestFileName; string templ = temp_dir.path() + kMDWriterUnitTestFileName;
// Set a non-zero tid to avoid tripping asserts. // Set a non-zero tid to avoid tripping asserts.
context.tid = 1; context.tid = child_pid;
ASSERT_TRUE(WriteMinidump(templ.c_str(), child_pid, &context, ASSERT_TRUE(WriteMinidump(templ.c_str(), child_pid, &context,
sizeof(context))); sizeof(context)));
kill(child_pid, SIGKILL); kill(child_pid, SIGKILL);