OLD | NEW |
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 // Children are ready now. | 224 // Children are ready now. |
225 LinuxPtraceDumper dumper(child_pid); | 225 LinuxPtraceDumper dumper(child_pid); |
226 ASSERT_TRUE(dumper.Init()); | 226 ASSERT_TRUE(dumper.Init()); |
227 EXPECT_EQ((size_t)kNumberOfThreadsInHelperProgram, dumper.threads().size()); | 227 EXPECT_EQ((size_t)kNumberOfThreadsInHelperProgram, dumper.threads().size()); |
228 EXPECT_TRUE(dumper.ThreadsSuspend()); | 228 EXPECT_TRUE(dumper.ThreadsSuspend()); |
229 | 229 |
230 ThreadInfo one_thread; | 230 ThreadInfo one_thread; |
231 for (size_t i = 0; i < dumper.threads().size(); ++i) { | 231 for (size_t i = 0; i < dumper.threads().size(); ++i) { |
232 EXPECT_TRUE(dumper.GetThreadInfoByIndex(i, &one_thread)); | 232 EXPECT_TRUE(dumper.GetThreadInfoByIndex(i, &one_thread)); |
| 233 const void* stack; |
| 234 size_t stack_len; |
| 235 EXPECT_TRUE(dumper.GetStackInfo(&stack, &stack_len, |
| 236 one_thread.stack_pointer)); |
233 // In the helper program, we stored a pointer to the thread id in a | 237 // In the helper program, we stored a pointer to the thread id in a |
234 // specific register. Check that we can recover its value. | 238 // specific register. Check that we can recover its value. |
235 #if defined(__ARM_EABI__) | 239 #if defined(__ARM_EABI__) |
236 pid_t *process_tid_location = (pid_t *)(one_thread.regs.uregs[3]); | 240 pid_t *process_tid_location = (pid_t *)(one_thread.regs.uregs[3]); |
237 #elif defined(__i386) | 241 #elif defined(__i386) |
238 pid_t *process_tid_location = (pid_t *)(one_thread.regs.ecx); | 242 pid_t *process_tid_location = (pid_t *)(one_thread.regs.ecx); |
239 #elif defined(__x86_64) | 243 #elif defined(__x86_64) |
240 pid_t *process_tid_location = (pid_t *)(one_thread.regs.rcx); | 244 pid_t *process_tid_location = (pid_t *)(one_thread.regs.rcx); |
241 #else | 245 #else |
242 #error This test has not been ported to this platform. | 246 #error This test has not been ported to this platform. |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 EXPECT_TRUE(fileid.ElfFileIdentifier(identifier2)); | 428 EXPECT_TRUE(fileid.ElfFileIdentifier(identifier2)); |
425 char identifier_string1[37]; | 429 char identifier_string1[37]; |
426 char identifier_string2[37]; | 430 char identifier_string2[37]; |
427 FileID::ConvertIdentifierToString(identifier1, identifier_string1, | 431 FileID::ConvertIdentifierToString(identifier1, identifier_string1, |
428 37); | 432 37); |
429 FileID::ConvertIdentifierToString(identifier2, identifier_string2, | 433 FileID::ConvertIdentifierToString(identifier2, identifier_string2, |
430 37); | 434 37); |
431 EXPECT_STREQ(identifier_string1, identifier_string2); | 435 EXPECT_STREQ(identifier_string1, identifier_string2); |
432 close(fds[1]); | 436 close(fds[1]); |
433 } | 437 } |
OLD | NEW |