Click here to Skip to main content
15,886,519 members
Articles / Database Development / SQL Server

A scripted SQL query generation framework with IDE: SQLpp (v1.4)

Rate me:
Please Sign up or sign in to vote.
4.98/5 (47 votes)
12 Sep 200311 min read 411.1K   5.4K   133  
A helper framework for generation of SQL queries in C++ and Lua
// Debugger.h: interface for the CDebugger class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DEBUGGER_H__344DB359_4B39_4DAF_BF7D_B2BFE030E7DB__INCLUDED_)
#define AFX_DEBUGGER_H__344DB359_4B39_4DAF_BF7D_B2BFE030E7DB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "LuaHelper.h"
class CLuaEditor;
class CProject;

#include "DebuggerMessages.h"

#define DMOD_NONE					0
#define DMOD_STEP_INTO				1
#define DMOD_STEP_OVER				2
#define DMOD_STEP_OUT				3
#define DMOD_RUN_TO_CURSOR			4

#define DMOD_BREAK					10
#define DMOD_STOP					11

typedef struct
{
	const char* szDesc;
	const char* szFile;
	int nLine;
} StackTrace;

typedef struct
{
	const char* szName;
	const char* szType;
	const char* szValue;
} Variable;

class CDebugger  
{
public:
	void Execute();
	CString Eval(CString strCode);
	static void EndThread();
	BOOL GetCalltip(const char* szWord, char* szCalltip);
	void AddLocalVariable(const char* name, const char* type, const char* value);
	void ClearLocalVariables();
	void AddGlobalVariable(const char* name, const char* type, const char* value);
	void ClearGlobalVariables();
	void StackLevelChanged();
	void Break();
	void Stop();
	void DebugBreak(const char* szFile, int nLine);
	void LineHook(const char* szFile, int nLine);
	void FunctionHook(const char* szFile, int nLine, BOOL bCall);
	void Write(const char* szMsg);
	BOOL Start();
	BOOL Prepare();
	CDebugger();
	virtual ~CDebugger();

	void Go();
	void StepInto();
	void StepOver();
	void StepOut();
	void RunToCursor();

	void ClearStackTrace();
	void AddStackTrace(const char* strDesc, const char* strFile, int nLine);
	int GetStackTraceLevel();

	static CDebugger* GetDebugger() { return m_pDebugger; };
	lua_State* GetLuaState() { return m_lua.GetState(); };
	HWND GetMainWnd() { return m_hWndMainFrame; };
protected:
	static UINT StartDebugger( LPVOID pParam );	

	CLuaHelper m_lua;
	HWND m_hWndMainFrame;
	CEvent m_event;

	int m_nMode;
	CString m_strPathName;
	int m_nLine, m_nLevel;
	CWinThread* m_pThread;

	static CDebugger* m_pDebugger;
};

#endif // !defined(AFX_DEBUGGER_H__344DB359_4B39_4DAF_BF7D_B2BFE030E7DB__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Engineer
United States United States
Jonathan de Halleux is Civil Engineer in Applied Mathematics. He finished his PhD in 2004 in the rainy country of Belgium. After 2 years in the Common Language Runtime (i.e. .net), he is now working at Microsoft Research on Pex (http://research.microsoft.com/pex).

Comments and Discussions