⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 debugger.cpp

📁 浙江大学的悟空嵌入式系统模拟器
💻 CPP
字号:
/*
*  Copyright (c) 2005 Zhejiang University, P.R.China
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ 

//=============================================================================
/**
*  \file    Arch/MU0/Debugger.cpp
*
*  $Id: Debugger.cpp,v 1.2 2005/02/24 05:57:13 kehc Exp $
*
*  \author  Huacheng Ke <sese_zju@yahoo.com.cn>
*/
//=============================================================================

#include "stdafx.h"
#include "./Debugger.h"
#include "./Instruction.h"
#include "./Processor.h"

#include <iostream>

namespace MU0 {

	Debugger::Debugger(void)
	{
	}

	Debugger::~Debugger(void)
	{
	}

	void Debugger::debug(Core::Part & part)
	{
		std::cout<<"MU0_Debugger::debug()"<<std::endl;
		CPU & cpu = (CPU &)part;
		Core::u32 val;
		cpu.read_register(0, val);
		std::cout<<"ACC = "<<val<<std::endl;
		
		Core::Bytecode_Type buffer;
		Core::Memory<Core::u16> * mem = 
			(Core::Memory<Core::u16> *)Core::Wukong_Get_System().get_memory((Core::u16)100);
		mem->unchecked_access(Core::Memory<Core::u16>::MEMORY_READ, (Core::u16)100, 10, buffer);

		for (size_t i = 0; i < buffer.size(); ++i)
		{
			std::cout<<(int)buffer[i]<<"  ";
		}
		std::cout<<std::endl;
	}

	void Debugger::on_create()
	{
		name_ = "MU0_Debugger";

	}

} //namespace

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -