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

📄 debugview.h

📁 这个也是我们的毕业设计课题
💻 H
字号:
#if !defined(AFX_DEBUGVIEW_H__B4466FDE_F226_40DD_B1C5_1226BE8A66A1__INCLUDED_)
#define AFX_DEBUGVIEW_H__B4466FDE_F226_40DD_B1C5_1226BE8A66A1__INCLUDED_


#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DebugView.h : header file
#include "DFY\type.h"	// Added by ClassView
#include "VariableDlg.h"	// Added by ClassView
struct MapFileInfo
{
	BOOL bIsCode;//TRUE if is a code line
	UNSHORT uAddr;
};
struct BreakInfo
{
	BOOL bIsSet;//TRUE if is been set break point
	DWORD dwCode;//the code in the memory ,this code will be 
				//insted after set break point
};
/////////////////////////////////////////////////////////////////////
// CDebugView view
class CDebugView : public CScrollView
{
protected:
	CDebugView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CDebugView)

// Attributes
public:

// Operations
public:
	WORD m_wGR[5];
	void SetIP(WORD wIP);
	void SetBreakInfoSize(UNSHORT uSize);//set the break info size and initialize the break point info
	void ResetVarInfo();//reset variable information
	void AddVarInfo(char* strVarName,UNSHORT uAddr);//add variable infromation
	void ClearCaret();//clear the caret
	void DrawCaret(CPoint point);//draw caret
	int GetLineY(CPoint point);//get the line Y postion
	UNSHORT GetLineNum(CPoint point);//get line number from point
	void FlushDisplay();//flush the screen
	void ResetSource();//reset source code
	void AddSource(CString strCode);//addd source code 
	
	void SetProExistState(BOOL bState);
	void SetFirstVisualPos(UNSHORT pos);
	void SetCodeSegSize(WORD wSize);//set code segmetn size 
	void ResetContent();//reset instruction cotent
	CString ChangeToHexStr(UNSHORT wData);//chang the wData format to hex format
	void AnylizeCode();//anylize and display the result to the output window
	void AddContent(CString str);//add instruction content
	void LoadMapInfo();//load map information
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDebugView)
	public:
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual void OnInitialUpdate();     // first time after construct
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~CDebugView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
	//{{AFX_MSG(CDebugView)
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnActionStep();
	afx_msg void OnActionGo();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnActionStepout();
	afx_msg void OnActionStepover();
	afx_msg void OnActionStopdebug();
	afx_msg void OnDestroy();
	afx_msg void OnEditSetbreakpoint();
	afx_msg void OnEditClearbreakpiont();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnActionReset();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	WORD m_wPC1;
	DWORD m_dwOP;
	WORD m_wFLAGS;
	WORD m_wSP;
	UNSHORT GetLineNumFromAddr(UNSHORT uAddr);//get the code line number
						//from the addr ,this operation will query the 
						//m_mapInfo
	void ClearBreakPoint(CPoint point);
	CPoint m_point1;
	void DrawBreakPoint(CPoint point);
	BreakInfo* m_breakInfo;//the break point information
	UNSHORT m_uCodeLineNum;
	MapFileInfo* m_mapInfo;//used to record map information
	VarInfo m_varInfo[2048];
	WORD m_wVarNum;
	CPoint m_point;//record the last caret position
	UNSHORT m_uLineIndex;//line number begin with 1
	CPoint m_caretPos2;//used to record the caret position
	CBitmap m_bitmapFlag;
	CPoint m_caretPos1;//record the arrow code position,
						//point to the source file
	void DrawFlag(CPoint point);
	UNSHORT m_uSourceLine;//record the source code lines
	CString m_strSource[2048];//keep the source file content
	UNSHORT m_uFirstVisualPos;//the first visual postion
	WORD m_wPC;//the PC register
	WORD m_wCodeSegSize;//the code segment size
	UNSHORT m_uScrollRange;//
	UNSHORT m_uContentNum;//record the instruction cotent number
	UNSHORT m_uIP;//the IP register
	CString m_strInstruction[2048];//keep the instruction content
	CPoint m_caretPos;//record the arrow code position
	BOOL m_bProExist;//TRUE if the program already load to the memory
	void ShowVariable(CDC* pDC);//
	void ShowRegisters(CDC* pDC);
	void ReportState(CString strState);
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DEBUGVIEW_H__B4466FDE_F226_40DD_B1C5_1226BE8A66A1__INCLUDED_)

⌨️ 快捷键说明

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