Reviewers: Jakob,

Message:
Avoid crashing with a segfault when stepping further when we already returned
from the JIT code executed by the simulator.

When we return from code executed by the simulator, the PC is set to a sentinel value (-2). If we try to decode the instruction at this point, dereferencing the
PC leads to a segfault.

This issue does not exist on MIPS.

PTAL.

Description:
Check for valid PC when stepping in the ARM sim debugger.


BUG=2134
TEST=


Please review this at http://codereview.chromium.org/10546169/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/arm/simulator-arm.cc


Index: src/arm/simulator-arm.cc
diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc
index 629c209ea2f30a3949ad123e51315d0e80bff0f3..79ada048c99ef7635129ccaaccb165fcbcb928f3 100644
--- a/src/arm/simulator-arm.cc
+++ b/src/arm/simulator-arm.cc
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+git // Copyright 2011 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -276,7 +276,7 @@ void ArmDebugger::Debug() {
   // make them invisible to all commands.
   UndoBreakpoints();

-  while (!done) {
+  while (!done && !sim_->has_bad_pc()) {
     if (last_pc != sim_->get_pc()) {
       disasm::NameConverter converter;
       disasm::Disassembler dasm(converter);


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to