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

Side by Side Diff: src/a64/simulator-a64.cc

Issue 143413018: A64: Fix 'step instruction' ('si') in debugger (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2728 matching lines...) Expand 10 before | Expand all | Expand 10 after
2739 // Use sscanf to parse the individual parts of the command line. At the 2739 // Use sscanf to parse the individual parts of the command line. At the
2740 // moment no command expects more than two parameters. 2740 // moment no command expects more than two parameters.
2741 int argc = SScanF(line, 2741 int argc = SScanF(line,
2742 "%" XSTR(COMMAND_SIZE) "s " 2742 "%" XSTR(COMMAND_SIZE) "s "
2743 "%" XSTR(ARG_SIZE) "s " 2743 "%" XSTR(ARG_SIZE) "s "
2744 "%" XSTR(ARG_SIZE) "s", 2744 "%" XSTR(ARG_SIZE) "s",
2745 cmd, arg1, arg2); 2745 cmd, arg1, arg2);
2746 2746
2747 // stepi / si ------------------------------------------------------------ 2747 // stepi / si ------------------------------------------------------------
2748 if ((strcmp(cmd, "si") == 0) || (strcmp(cmd, "stepi") == 0)) { 2748 if ((strcmp(cmd, "si") == 0) || (strcmp(cmd, "stepi") == 0)) {
2749 int64_t number_of_instructions_to_execute = 1; 2749 // We are about to execute instructions, after which by default we
2750 if (argc >= 2) { 2750 // should increment the pc_. If it was set when reaching this debug
2751 // instruction, it has not been cleared because this instruction has not
2752 // completed yet. So clear it manually.
2753 pc_modified_ = false;
2754
2755 if (argc == 1) {
2756 ExecuteInstruction();
2757 } else {
2758 int64_t number_of_instructions_to_execute = 1;
2751 GetValue(arg1, &number_of_instructions_to_execute); 2759 GetValue(arg1, &number_of_instructions_to_execute);
2760
2761 set_log_parameters(log_parameters() | LOG_DISASM);
2762 while (number_of_instructions_to_execute-- > 0) {
2763 ExecuteInstruction();
2764 }
2765 set_log_parameters(log_parameters() & ~LOG_DISASM);
2766 PrintF("\n");
2752 } 2767 }
2753 // Prevent from printing the next instruction twice. 2768
2754 if (log_parameters_ & LOG_DISASM) { 2769 // If it was necessary, the pc has already been updated or incremented
2755 set_log_parameters(log_parameters_ & ~LOG_DISASM); 2770 // when executing the instruction. So we do not want it to be updated
2756 cleared_log_disasm_bit = true; 2771 // again. It will be cleared when exiting.
2757 } 2772 pc_modified_ = true;
2758 if (number_of_instructions_to_execute > 1) {
2759 // Execute one instruction and restore LOG_DISASM if necessary.
2760 ExecuteInstruction();
2761 --number_of_instructions_to_execute;
2762 if (cleared_log_disasm_bit == true) {
2763 set_log_parameters(log_parameters_ | LOG_DISASM);
2764 cleared_log_disasm_bit = false;
2765 }
2766 }
2767 // Execute the instructions.
2768 while (number_of_instructions_to_execute-- > 0) {
2769 ExecuteInstruction();
2770 }
2771 2773
2772 // next / n -------------------------------------------------------------- 2774 // next / n --------------------------------------------------------------
2773 } else if ((strcmp(cmd, "next") == 0) || (strcmp(cmd, "n") == 0)) { 2775 } else if ((strcmp(cmd, "next") == 0) || (strcmp(cmd, "n") == 0)) {
2774 // Tell the simulator to break after the next executed BL. 2776 // Tell the simulator to break after the next executed BL.
2775 break_on_next_ = true; 2777 break_on_next_ = true;
2776 // Continue. 2778 // Continue.
2777 done = true; 2779 done = true;
2778 2780
2779 // continue / cont / c --------------------------------------------------- 2781 // continue / cont / c ---------------------------------------------------
2780 } else if ((strcmp(cmd, "continue") == 0) || 2782 } else if ((strcmp(cmd, "continue") == 0) ||
(...skipping 11 matching lines...) Expand all
2792 if (argc >= 2) { // disasm <n of instrs> 2794 if (argc >= 2) { // disasm <n of instrs>
2793 GetValue(arg1, &n_of_instrs_to_disasm); 2795 GetValue(arg1, &n_of_instrs_to_disasm);
2794 } 2796 }
2795 if (argc >= 3) { // disasm <n of instrs> <address> 2797 if (argc >= 3) { // disasm <n of instrs> <address>
2796 GetValue(arg2, &address); 2798 GetValue(arg2, &address);
2797 } 2799 }
2798 2800
2799 // Disassemble. 2801 // Disassemble.
2800 PrintInstructionsAt(reinterpret_cast<Instruction*>(address), 2802 PrintInstructionsAt(reinterpret_cast<Instruction*>(address),
2801 n_of_instrs_to_disasm); 2803 n_of_instrs_to_disasm);
2804 PrintF("\n");
2802 2805
2803 // print / p ------------------------------------------------------------- 2806 // print / p -------------------------------------------------------------
2804 } else if ((strcmp(cmd, "print") == 0) || (strcmp(cmd, "p") == 0)) { 2807 } else if ((strcmp(cmd, "print") == 0) || (strcmp(cmd, "p") == 0)) {
2805 if (argc == 2) { 2808 if (argc == 2) {
2806 if (strcmp(arg1, "all") == 0) { 2809 if (strcmp(arg1, "all") == 0) {
2807 // TODO(all): better support for printing in the debugger. 2810 // TODO(all): better support for printing in the debugger.
2808 PrintRegisters(true); 2811 PrintRegisters(true);
2809 PrintFPRegisters(true); 2812 PrintFPRegisters(true);
2810 } else { 2813 } else {
2811 if (!PrintValue(arg1)) { 2814 if (!PrintValue(arg1)) {
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
3410 default: 3413 default:
3411 UNIMPLEMENTED(); 3414 UNIMPLEMENTED();
3412 } 3415 }
3413 } 3416 }
3414 3417
3415 #endif // USE_SIMULATOR 3418 #endif // USE_SIMULATOR
3416 3419
3417 } } // namespace v8::internal 3420 } } // namespace v8::internal
3418 3421
3419 #endif // V8_TARGET_ARCH_A64 3422 #endif // V8_TARGET_ARCH_A64
OLDNEW
« 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