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

Unified Diff: src/platform-solaris.cc

Issue 6676019: Sample correct registers on solaris
Patch Set: Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-solaris.cc
diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc
index 7c8effcd4c08caadcc3d60f520f1a641a70b7159..25efb0fa1ac80767b9e63b644efae45112d36329 100644
--- a/src/platform-solaris.cc
+++ b/src/platform-solaris.cc
@@ -45,7 +45,7 @@
#include <errno.h>
#include <ieeefp.h> // finite()
#include <signal.h> // sigemptyset(), etc
-#include <sys/kdi_regs.h>
+#include <sys/regset.h>
#undef MAP_TYPE
@@ -632,17 +632,10 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
mcontext_t& mcontext = ucontext->uc_mcontext;
sample->state = Top::current_vm_state();
-#if V8_HOST_ARCH_IA32
- sample->pc = reinterpret_cast<Address>(mcontext.gregs[KDIREG_EIP]);
- sample->sp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_ESP]);
- sample->fp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_EBP]);
-#elif V8_HOST_ARCH_X64
- sample->pc = reinterpret_cast<Address>(mcontext.gregs[KDIREG_RIP]);
- sample->sp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_RSP]);
- sample->fp = reinterpret_cast<Address>(mcontext.gregs[KDIREG_RBP]);
-#else
- UNIMPLEMENTED();
-#endif
+ sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_PC]);
+ sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_SP]);
+ sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_FP]);
+
active_sampler_->SampleStack(sample);
active_sampler_->Tick(sample);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698