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

Unified Diff: runtime/vm/disassembler_mips.cc

Issue 12903006: Drops into Simulator Debugger only in a session that is already interactive. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/vm/disassembler_ia32.cc ('k') | runtime/vm/disassembler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/disassembler_mips.cc
===================================================================
--- runtime/vm/disassembler_mips.cc (revision 20391)
+++ runtime/vm/disassembler_mips.cc (working copy)
@@ -15,8 +15,7 @@
MIPSDecoder(char* buffer, size_t buffer_size)
: buffer_(buffer),
buffer_size_(buffer_size),
- buffer_pos_(0),
- decode_failure_(false) {
+ buffer_pos_(0) {
buffer_[buffer_pos_] = '\0';
}
@@ -26,9 +25,6 @@
// Returns true if the instruction was successfully decoded, false otherwise.
void InstructionDecode(Instr* instr);
- void set_decode_failure(bool b) { decode_failure_ = b; }
- bool decode_failure() const { return decode_failure_; }
-
private:
// Bottleneck functions to print into the out_buffer.
void Print(const char* str);
@@ -53,8 +49,6 @@
size_t buffer_size_; // The size of the character buffer.
size_t buffer_pos_; // Current character position in buffer.
- bool decode_failure_; // Set to true when a failure to decode is detected.
-
DISALLOW_ALLOCATION();
DISALLOW_COPY_AND_ASSIGN(MIPSDecoder);
};
@@ -202,7 +196,6 @@
// which will just print "unknown" of the instruction bits.
void MIPSDecoder::Unknown(Instr* instr) {
Format(instr, "unknown");
- set_decode_failure(true);
}
@@ -428,9 +421,9 @@
}
-bool Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size,
- char* human_buffer, intptr_t human_size,
- int *out_instr_len, uword pc) {
+void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size,
+ char* human_buffer, intptr_t human_size,
+ int* out_instr_len, uword pc) {
MIPSDecoder decoder(human_buffer, human_size);
Instr* instr = Instr::At(pc);
decoder.InstructionDecode(instr);
@@ -438,16 +431,14 @@
if (out_instr_len) {
*out_instr_len = Instr::kInstrSize;
}
- return !decoder.decode_failure();
}
-bool Disassembler::Disassemble(uword start,
+void Disassembler::Disassemble(uword start,
uword end,
DisassemblyFormatter* formatter,
const Code::Comments& comments) {
ASSERT(formatter != NULL);
- bool success = true;
char hex_buffer[kHexadecimalBufferSize]; // Instruction in hexadecimal form.
char human_buffer[kUserReadableBufferSize]; // Human-readable instruction.
uword pc = start;
@@ -462,12 +453,10 @@
comment_finger++;
}
int instruction_length;
- bool res = DecodeInstruction(hex_buffer, sizeof(hex_buffer),
- human_buffer, sizeof(human_buffer),
- &instruction_length, pc);
- if (!res) {
- success = false;
- }
+ DecodeInstruction(hex_buffer, sizeof(hex_buffer),
+ human_buffer, sizeof(human_buffer),
+ &instruction_length, pc);
+
formatter->ConsumeInstruction(hex_buffer,
sizeof(hex_buffer),
human_buffer,
@@ -476,7 +465,7 @@
pc += instruction_length;
}
- return success;
+ return;
}
} // namespace dart
« no previous file with comments | « runtime/vm/disassembler_ia32.cc ('k') | runtime/vm/disassembler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698