luaforwindows/files/docs/wxlua/doxygen/html/wxldtarg_8h_source.html

173 lines
20 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>wxLua: /mnt/share/devel/lua/wxLua/modules/wxluasocket/include/wxldtarg.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="dir_15d5a205ad383328522db6a6be296af1.html">modules</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_7cd3065828d87458b0d7ef005e985a57.html">wxluasocket</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_a857424e6167482505b0cee7befbe354.html">include</a>
</div>
</div>
<div class="contents">
<h1>wxldtarg.h</h1><a href="wxldtarg_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/////////////////////////////////////////////////////////////////////////////</span>
<a name="l00002"></a>00002 <span class="comment"></span><span class="comment">// Purpose: Implements the client end of wxLua debugging session</span>
<a name="l00003"></a>00003 <span class="comment">// Author: J. Winwood, John Labenski, Ray Gilbert</span>
<a name="l00004"></a>00004 <span class="comment">// Created: May 2002</span>
<a name="l00005"></a>00005 <span class="comment">// RCS-ID: $Id: wxldtarg.h,v 1.26 2007/11/28 22:55:02 jrl1 Exp $</span>
<a name="l00006"></a>00006 <span class="comment">// Copyright: (c) 2002 Lomtick Software. All rights reserved.</span>
<a name="l00007"></a>00007 <span class="comment">// Licence: wxWidgets licence</span><span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment">/////////////////////////////////////////////////////////////////////////////</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="preprocessor">#ifndef LUA_DEBUG_TARGET_H</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define LUA_DEBUG_TARGET_H</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &quot;wx/thread.h&quot;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &quot;<a class="code" href="wxluasocketdefs_8h.html">wxluasocket/include/wxluasocketdefs.h</a>&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &quot;<a class="code" href="wxlua_8h.html">wxlua/include/wxlua.h</a>&quot;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;<a class="code" href="wxldebug_8h.html">wxluadebug/include/wxldebug.h</a>&quot;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &quot;<a class="code" href="wxlsock_8h.html">wxluasocket/include/wxlsock.h</a>&quot;</span>
<a name="l00018"></a>00018
<a name="l00019"></a>00019 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00020"></a>00020 <span class="comment">// wxLuaDebugTarget - a C++ socket target that the wxLuaDebuggerServer run in Lua</span>
<a name="l00021"></a>00021 <span class="comment">// communicates with. Handles the Debugger/Debuggee IO</span>
<a name="l00022"></a>00022 <span class="comment">// ----------------------------------------------------------------------------</span>
<a name="l00023"></a>00023
<a name="l00024"></a><a class="code" href="classwxLuaDebugTarget.html">00024</a> <span class="keyword">class </span><a class="code" href="wxluasocketdefs_8h.html#a59aa1606e0b31648f147e5eb694362d8">WXDLLIMPEXP_WXLUASOCKET</a> <a class="code" href="classwxLuaDebugTarget.html">wxLuaDebugTarget</a> : <span class="keyword">public</span> wxObject
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026 <span class="keyword">protected</span>:
<a name="l00027"></a>00027 <span class="comment">// -----------------------------------------------------------------------</span>
<a name="l00028"></a>00028 <span class="comment">// wxLuaDebugTarget::LuaThread - a wxThread for the wxLuaDebugTarget</span>
<a name="l00029"></a>00029 <span class="comment">// -----------------------------------------------------------------------</span>
<a name="l00030"></a><a class="code" href="classwxLuaDebugTarget_1_1LuaThread.html">00030</a> <span class="keyword">class </span><a class="code" href="classwxLuaDebugTarget_1_1LuaThread.html">LuaThread</a> : <span class="keyword">public</span> wxThread
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 <span class="keyword">public</span>:
<a name="l00033"></a><a class="code" href="classwxLuaDebugTarget_1_1LuaThread.html#a7a9e321e57b7fb7f4f2251cc419ba620">00033</a> <a class="code" href="classwxLuaDebugTarget_1_1LuaThread.html">LuaThread</a>(<a class="code" href="classwxLuaDebugTarget.html">wxLuaDebugTarget</a> *pTarget) : wxThread(wxTHREAD_JOINABLE),
<a name="l00034"></a>00034 m_pTarget(pTarget) {}
<a name="l00035"></a>00035 <span class="keyword">protected</span>:
<a name="l00036"></a>00036 <span class="keyword">virtual</span> <span class="keywordtype">void</span> *Entry(); <span class="comment">// thread execution starts here</span>
<a name="l00037"></a><a class="code" href="classwxLuaDebugTarget_1_1LuaThread.html#aee2b6c199fd4d0e15e41f2eb53baf2b9">00037</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classwxLuaDebugTarget_1_1LuaThread.html#aee2b6c199fd4d0e15e41f2eb53baf2b9">OnExit</a>() {} <span class="comment">// called when the thread exits</span>
<a name="l00038"></a>00038
<a name="l00039"></a><a class="code" href="classwxLuaDebugTarget_1_1LuaThread.html#aaea99618f6d0bd9472e7a2a68a511cf5">00039</a> <a class="code" href="classwxLuaDebugTarget.html">wxLuaDebugTarget</a> *m_pTarget;
<a name="l00040"></a>00040 };
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="keyword">public</span>:
<a name="l00043"></a>00043 <a class="code" href="classwxLuaDebugTarget.html">wxLuaDebugTarget</a>(<span class="keyword">const</span> <a class="code" href="classwxLuaState.html">wxLuaState</a>&amp; wxlState, <span class="keyword">const</span> wxString &amp;serverName,
<a name="l00044"></a>00044 <span class="keywordtype">int</span> portNumber);
<a name="l00045"></a>00045 <span class="keyword">virtual</span> ~<a class="code" href="classwxLuaDebugTarget.html">wxLuaDebugTarget</a>();
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="keywordtype">bool</span> Run();
<a name="l00048"></a>00048 <span class="keywordtype">void</span> Stop();
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="keywordtype">void</span> ThreadFunction();
<a name="l00051"></a>00051 <span class="keywordtype">bool</span> HandleDebuggerCmd(<span class="keywordtype">int</span> cmd);
<a name="l00052"></a><a class="code" href="classwxLuaDebugTarget.html#afd3a9c99349ff8a3f644c267943f0bd8">00052</a> <span class="keywordtype">void</span> <a class="code" href="classwxLuaDebugTarget.html#afd3a9c99349ff8a3f644c267943f0bd8">DisplayError</a>(<span class="keyword">const</span> wxString&amp; errorMsg) { NotifyError(errorMsg); }
<a name="l00053"></a>00053
<a name="l00054"></a>00054 <span class="keyword">protected</span>:
<a name="l00055"></a>00055
<a name="l00056"></a><a class="code" href="classwxLuaDebugTarget.html#a9b4b9e69ea2c97cad924049c624d7997">00056</a> <span class="keyword">enum</span> <a class="code" href="classwxLuaDebugTarget.html#a9b4b9e69ea2c97cad924049c624d7997">debugOperations</a>
<a name="l00057"></a>00057 {
<a name="l00058"></a><a class="code" href="classwxLuaDebugTarget.html#a9b4b9e69ea2c97cad924049c624d7997a4f26ffc501b7fa3c0b37a6f37225ab9e">00058</a> DEBUG_STEP,
<a name="l00059"></a><a class="code" href="classwxLuaDebugTarget.html#a9b4b9e69ea2c97cad924049c624d7997ade0956d2fcc762f965b9a5328771f29e">00059</a> DEBUG_STEPOVER,
<a name="l00060"></a><a class="code" href="classwxLuaDebugTarget.html#a9b4b9e69ea2c97cad924049c624d7997aeaa4641c892cd64314c730601a7f588c">00060</a> DEBUG_STEPOUT,
<a name="l00061"></a><a class="code" href="classwxLuaDebugTarget.html#a9b4b9e69ea2c97cad924049c624d7997a7282a170685c1f5f0c8fc52af8957a82">00061</a> DEBUG_GO
<a name="l00062"></a>00062 };
<a name="l00063"></a>00063
<a name="l00064"></a><a class="code" href="classwxLuaDebugTarget.html#aa7b18e8d3fd8fcd655b6530601764f30">00064</a> <a class="code" href="classwxLuaState.html">wxLuaState</a> m_wxlState;
<a name="l00065"></a><a class="code" href="classwxLuaDebugTarget.html#aa0a2d252727cea57958d316fae764b3c">00065</a> <span class="keywordtype">int</span> m_port_number;
<a name="l00066"></a><a class="code" href="classwxLuaDebugTarget.html#a8c1560dfc1f236049e039db501411b89">00066</a> wxString m_serverName;
<a name="l00067"></a><a class="code" href="classwxLuaDebugTarget.html#a73efb0de6a1e89b55edf8a5432aa4556">00067</a> wxSortedArrayString m_breakPointList;
<a name="l00068"></a><a class="code" href="classwxLuaDebugTarget.html#af9fcd5d0490623177e75fc30285a02e9">00068</a> wxMutex m_debugMutex;
<a name="l00069"></a><a class="code" href="classwxLuaDebugTarget.html#a3c276c52207da42ecaab334e97e45ded">00069</a> wxCondition m_debugCondition;
<a name="l00070"></a><a class="code" href="classwxLuaDebugTarget.html#ae16de2874c4423b5dd83dd9c65f700e1">00070</a> <a class="code" href="classwxLuaCSocket.html">wxLuaSocket</a> m_clientSocket;
<a name="l00071"></a><a class="code" href="classwxLuaDebugTarget.html#a441ef6e86cc958aa7c51d1e4aee6cbc5">00071</a> <a class="code" href="classwxLuaDebugTarget.html#a9b4b9e69ea2c97cad924049c624d7997">debugOperations</a> m_nextOperation;
<a name="l00072"></a><a class="code" href="classwxLuaDebugTarget.html#ac4c23b3f88cfafcc203e4f1944e0a16d">00072</a> <span class="keywordtype">bool</span> m_forceBreak;
<a name="l00073"></a><a class="code" href="classwxLuaDebugTarget.html#adaed17fdf97ca9c9a8dbbbd80cdd0a20">00073</a> <span class="keywordtype">bool</span> m_resetRequested;
<a name="l00074"></a><a class="code" href="classwxLuaDebugTarget.html#a2b54a6f95c7ae7d23371893d3eabe151">00074</a> <span class="keywordtype">bool</span> m_fConnected;
<a name="l00075"></a><a class="code" href="classwxLuaDebugTarget.html#ac88dbbac136f71799a9e3f2f8ae191c8">00075</a> <span class="keywordtype">bool</span> m_fRunning;
<a name="l00076"></a><a class="code" href="classwxLuaDebugTarget.html#ad674547956cc1ea9abfcd2ca1177ab88">00076</a> <span class="keywordtype">bool</span> m_fStopped;
<a name="l00077"></a><a class="code" href="classwxLuaDebugTarget.html#afbe5024e710d814f0bd37c40c68e2b87">00077</a> <span class="keywordtype">bool</span> m_fExiting;
<a name="l00078"></a><a class="code" href="classwxLuaDebugTarget.html#a849410aab1c4df17d1765db08625692d">00078</a> <span class="keywordtype">bool</span> m_fErrorsSeen;
<a name="l00079"></a><a class="code" href="classwxLuaDebugTarget.html#a8ba69841f4c36f4355362bf33ba19bb9">00079</a> <span class="keywordtype">int</span> m_nFramesUntilBreak;
<a name="l00080"></a><a class="code" href="classwxLuaDebugTarget.html#aa992fb05475be8259686529784ccf889">00080</a> wxMutex m_runMutex;
<a name="l00081"></a><a class="code" href="classwxLuaDebugTarget.html#ab3311eca5cf5b2439de9af1ae8856e0e">00081</a> wxCondition m_runCondition;
<a name="l00082"></a><a class="code" href="classwxLuaDebugTarget.html#a148f6ab6258954011999a97c3d3aec96">00082</a> wxArrayString m_bufferArray;
<a name="l00083"></a><a class="code" href="classwxLuaDebugTarget.html#ab9c448d8b9232ba6960b47cb4fa18e13">00083</a> <a class="code" href="classwxLuaDebugTarget_1_1LuaThread.html">LuaThread</a> *m_pThread;
<a name="l00084"></a><a class="code" href="classwxLuaDebugTarget.html#a02a76def2e89eed326e3986a236d3fe1">00084</a> wxArrayInt m_references;
<a name="l00085"></a><a class="code" href="classwxLuaDebugTarget.html#ab23ebf96e4dc8acdfc394890e7a846ef">00085</a> wxCriticalSection m_luaCriticalSection;
<a name="l00086"></a><a class="code" href="classwxLuaDebugTarget.html#a2146ca799d9b5a4195c77d5dd8db027c">00086</a> <span class="keyword">mutable</span> wxCriticalSection m_breakPointListCriticalSection;
<a name="l00087"></a>00087
<a name="l00088"></a>00088 <span class="comment">// Enter/Leave critical section for the threaded sockets</span>
<a name="l00089"></a><a class="code" href="classwxLuaDebugTarget.html#a0733d6639aaddd04eac1b4e952fb93e4">00089</a> <span class="keywordtype">void</span> <a class="code" href="classwxLuaDebugTarget.html#a0733d6639aaddd04eac1b4e952fb93e4">EnterLuaCriticalSection</a>() { m_luaCriticalSection.Enter(); }
<a name="l00090"></a><a class="code" href="classwxLuaDebugTarget.html#aec24b4ab8e55ce77ee3f7c4fbf2edfab">00090</a> <span class="keywordtype">void</span> <a class="code" href="classwxLuaDebugTarget.html#aec24b4ab8e55ce77ee3f7c4fbf2edfab">LeaveLuaCriticalSection</a>() { m_luaCriticalSection.Leave(); }
<a name="l00091"></a>00091
<a name="l00092"></a>00092 <span class="keywordtype">void</span> ExitThread();
<a name="l00093"></a>00093
<a name="l00094"></a>00094 <span class="comment">// Return a string (&quot;%d:%s&quot;, lineNumber, fileName) for the breakpoint</span>
<a name="l00095"></a>00095 wxString CreateBreakPoint(<span class="keyword">const</span> wxString &amp;fileName, <span class="keywordtype">int</span> lineNumber) <span class="keyword">const</span>;
<a name="l00096"></a>00096 <span class="comment">// Are we at a set breakpoint?</span>
<a name="l00097"></a>00097 <span class="keywordtype">bool</span> AtBreakPoint(<span class="keyword">const</span> wxString &amp;fileName, <span class="keywordtype">int</span> lineNumber) <span class="keyword">const</span>;
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="keywordtype">bool</span> AddBreakPoint(<span class="keyword">const</span> wxString &amp;fileName, <span class="keywordtype">int</span> lineNumber);
<a name="l00100"></a>00100 <span class="keywordtype">bool</span> RemoveBreakPoint(<span class="keyword">const</span> wxString &amp;fileName, <span class="keywordtype">int</span> lineNumber);
<a name="l00101"></a>00101 <span class="keywordtype">bool</span> ClearAllBreakPoints();
<a name="l00102"></a>00102 <span class="keywordtype">bool</span> Run(<span class="keyword">const</span> wxString &amp;fileName, <span class="keyword">const</span> wxString &amp;buffer);
<a name="l00103"></a>00103 <span class="keywordtype">bool</span> Step();
<a name="l00104"></a>00104 <span class="keywordtype">bool</span> StepOver();
<a name="l00105"></a>00105 <span class="keywordtype">bool</span> StepOut();
<a name="l00106"></a>00106 <span class="keywordtype">bool</span> Continue();
<a name="l00107"></a>00107 <span class="keywordtype">bool</span> Break();
<a name="l00108"></a>00108 <span class="keywordtype">bool</span> Reset();
<a name="l00109"></a>00109 <span class="keywordtype">bool</span> EnumerateStack();
<a name="l00110"></a>00110 <span class="keywordtype">bool</span> EnumerateStackEntry(<span class="keywordtype">int</span> stackRef);
<a name="l00111"></a>00111 <span class="keywordtype">bool</span> EnumerateTable(<span class="keywordtype">int</span> tableRef, <span class="keywordtype">int</span> nIndex, <span class="keywordtype">long</span> itemNode);
<a name="l00112"></a>00112 <span class="keywordtype">bool</span> EvaluateExpr(<span class="keywordtype">int</span> exprRef, <span class="keyword">const</span> wxString &amp;strExpr);
<a name="l00113"></a>00113
<a name="l00114"></a>00114 <span class="keywordtype">bool</span> NotifyBreak(<span class="keyword">const</span> wxString &amp;fileName, <span class="keywordtype">int</span> lineNumber);
<a name="l00115"></a>00115 <span class="keywordtype">bool</span> NotifyPrint(<span class="keyword">const</span> wxString &amp;errorMsg);
<a name="l00116"></a>00116 <span class="keywordtype">bool</span> NotifyError(<span class="keyword">const</span> wxString &amp;errorMsg);
<a name="l00117"></a>00117 <span class="keywordtype">bool</span> NotifyExit();
<a name="l00118"></a>00118 <span class="keywordtype">bool</span> NotifyStackEnumeration(<span class="keyword">const</span> <a class="code" href="classwxLuaDebugData.html">wxLuaDebugData</a>&amp; debugData);
<a name="l00119"></a>00119 <span class="keywordtype">bool</span> NotifyStackEntryEnumeration(<span class="keywordtype">int</span> stackRef, <span class="keyword">const</span> <a class="code" href="classwxLuaDebugData.html">wxLuaDebugData</a>&amp; debugData);
<a name="l00120"></a>00120 <span class="keywordtype">bool</span> NotifyTableEnumeration(<span class="keywordtype">long</span> itemNode, <span class="keyword">const</span> <a class="code" href="classwxLuaDebugData.html">wxLuaDebugData</a>&amp; debugData);
<a name="l00121"></a>00121 <span class="keywordtype">bool</span> NotifyEvaluateExpr(<span class="keywordtype">int</span> exprRef, <span class="keyword">const</span> wxString &amp;strResult);
<a name="l00122"></a>00122
<a name="l00123"></a>00123 <span class="comment">// Handle events from the static wxLuaDebugTarget::LuaDebugHook</span>
<a name="l00124"></a>00124 <span class="keywordtype">bool</span> DebugHook(<span class="keywordtype">int</span> event);
<a name="l00125"></a>00125
<a name="l00126"></a>00126 <span class="keywordtype">bool</span> IsConnected(<span class="keywordtype">bool</span> wait_for_connect = <span class="keyword">true</span>) <span class="keyword">const</span>;
<a name="l00127"></a>00127
<a name="l00128"></a>00128 <span class="comment">// Get the wxLuaDebugTarget that was pushed into Lua</span>
<a name="l00129"></a>00129 <span class="keyword">static</span> <a class="code" href="classwxLuaDebugTarget.html">wxLuaDebugTarget</a>* GetDebugTarget(lua_State* L);
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="comment">// Handle the events from lua_sethook()</span>
<a name="l00132"></a>00132 <span class="keyword">static</span> <span class="keywordtype">void</span> LUACALL LuaDebugHook(lua_State *L, lua_Debug *debug);
<a name="l00133"></a>00133 <span class="comment">// Forward the print statements to NotifyPrint()</span>
<a name="l00134"></a>00134 <span class="keyword">static</span> <span class="keywordtype">int</span> LUACALL LuaPrint (lua_State *L);
<a name="l00135"></a>00135 };
<a name="l00136"></a>00136
<a name="l00137"></a>00137 <span class="preprocessor">#endif // LUA_DEBUG_TARGET_H</span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 13 10:30:39 2010 for wxLua by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>