dbgrcomm.h 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795
  1. /*++
  2. Copyright (c) 2012 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. dbgrcomm.h
  9. Abstract:
  10. This header contains definitions for the debugger protocol communication
  11. helper routines.
  12. Author:
  13. Evan Green 3-Jul-2012
  14. --*/
  15. //
  16. // ---------------------------------------------------------------- Definitions
  17. //
  18. #define ARM_INSTRUCTION_LENGTH 4
  19. #define ARM_FUNCTION_PROLOGUE 0xE1A0C00D
  20. #define DEBUGGER_MAX_COMMAND_ARGUMENTS 32
  21. //
  22. // Define the maximum number of call stack elements that can be printed.
  23. //
  24. #define MAX_CALL_STACK 4096
  25. //
  26. // Define debugger flags.
  27. //
  28. //
  29. // This flag is set if the debugger is in the process of exiting the
  30. // application.
  31. //
  32. #define DEBUGGER_FLAG_EXITING 0x00000001
  33. //
  34. // This flag is set if the debugger should echo commands sent to standard in.
  35. //
  36. #define DEBUGGER_FLAG_ECHO_COMMANDS 0x00000002
  37. //
  38. // This flag is set to enable stepping by source line numbers, or cleared to
  39. // step by instruction.
  40. //
  41. #define DEBUGGER_FLAG_SOURCE_LINE_STEPPING 0x00000004
  42. //
  43. // This flag is set if the debugger should print source file and line numbers
  44. // along with each address symbol.
  45. //
  46. #define DEBUGGER_FLAG_PRINT_LINE_NUMBERS 0x00000008
  47. //
  48. // This flag is set if the user would like an initial break-in upon
  49. // connection.
  50. //
  51. #define DEBUGGER_FLAG_INITIAL_BREAK 0x00000010
  52. //
  53. // This flag is set if the user wants to print all attempted source file loads
  54. // (useful when trying to figure out why source display isn't working).
  55. //
  56. #define DEBUGGER_FLAG_PRINT_SOURCE_LOADS 0x00000020
  57. //
  58. // Define debugger target flags.
  59. //
  60. //
  61. // This flag is set if the target is running.
  62. //
  63. #define DEBUGGER_TARGET_RUNNING 0x00000001
  64. //
  65. // x86 Flags.
  66. //
  67. #define IA32_EFLAG_CF 0x00000001
  68. #define IA32_EFLAG_PF 0x00000004
  69. #define IA32_EFLAG_AF 0x00000010
  70. #define IA32_EFLAG_ZF 0x00000040
  71. #define IA32_EFLAG_SF 0x00000080
  72. #define IA32_EFLAG_TF 0x00000100
  73. #define IA32_EFLAG_IF 0x00000200
  74. #define IA32_EFLAG_DF 0x00000400
  75. #define IA32_EFLAG_OF 0x00000800
  76. #define IA32_EFLAG_IOPL_MASK 0x00003000
  77. #define IA32_EFLAG_IOPL_SHIFT 12
  78. #define IA32_EFLAG_NT 0x00004000
  79. #define IA32_EFLAG_RF 0x00010000
  80. #define IA32_EFLAG_VM 0x00020000
  81. #define IA32_EFLAG_AC 0x00040000
  82. #define IA32_EFLAG_VIF 0x00080000
  83. #define IA32_EFLAG_VIP 0x00100000
  84. #define IA32_EFLAG_ID 0x00200000
  85. #define IA32_EFLAG_ALWAYS_0 0xFFC08028
  86. #define IA32_EFLAG_ALWAYS_1 0x00000002
  87. //
  88. // ARM Processor modes.
  89. //
  90. #define ARM_MODE_USER 0x00000010
  91. #define ARM_MODE_FIQ 0x00000011
  92. #define ARM_MODE_IRQ 0x00000012
  93. #define ARM_MODE_SVC 0x00000013
  94. #define ARM_MODE_ABORT 0x00000017
  95. #define ARM_MODE_UNDEF 0x0000001B
  96. #define ARM_MODE_SYSTEM 0x0000001F
  97. #define ARM_MODE_MASK 0x0000001F
  98. //
  99. // ARM Program Status Register flags.
  100. //
  101. #define PSR_FLAG_NEGATIVE 0x80000000
  102. #define PSR_FLAG_ZERO 0x40000000
  103. #define PSR_FLAG_CARRY 0x20000000
  104. #define PSR_FLAG_OVERFLOW 0x10000000
  105. #define PSR_FLAG_SATURATION 0x08000000
  106. #define PSR_FLAG_JAZELLE 0x01000000
  107. #define PSR_FLAG_THUMB 0x00000020
  108. #define PSR_FLAG_IRQ 0x00000080
  109. #define PSR_FLAG_FIQ 0x00000040
  110. //
  111. // ARM Instruction information.
  112. //
  113. #define ARM_BREAK_INSTRUCTION 0xE7F000F3
  114. #define ARM_BREAK_INSTRUCTION_LENGTH ARM_INSTRUCTION_LENGTH
  115. #define THUMB_BREAK_INSTRUCTION 0xDE20
  116. #define THUMB_BREAK_INSTRUCTION_LENGTH 2
  117. #define ARM_THUMB_BIT 0x00000001
  118. #define X86_BREAK_INSTRUCTION 0xCC
  119. #define X86_BREAK_INSTRUCTION_LENGTH 1
  120. //
  121. // ------------------------------------------------------ Data Type Definitions
  122. //
  123. typedef enum _DEBUGGER_BREAK_POINT_TYPE {
  124. BreakpointTypeInvalid,
  125. BreakpointTypeExecution,
  126. BreakpointTypeRead,
  127. BreakpointTypeWrite,
  128. BreakpointTypeReadWrite
  129. } DEBUGGER_BREAK_POINT_TYPE, *PDEBUGGER_BREAK_POINT_TYPE;
  130. /*++
  131. Structure Description:
  132. This structure defines a breakpoint.
  133. Members:
  134. ListEntry - Stores pointers to the next and previous breakpoints in the
  135. global list of breakpoints.
  136. Index - Stores the index of the breakpoint.
  137. Type - Stores the type of breakpoint, whether it be software or some sort of
  138. hardware breakpoint.
  139. Address - Stores the virtual address of the breakpoint.
  140. AccessSize - Stores the access size of the breakpoint if it is a break on
  141. access type of breakpoint.
  142. OriginalValue - Stores the original contents of the instruction stream
  143. before the breakpoint was inserted. This only applies to software
  144. execution breakpoints.
  145. Enabled - Stores a flag indicating whether or not this breakpoint is
  146. currently active in the system.
  147. --*/
  148. typedef struct _DEBUGGER_BREAK_POINT {
  149. LIST_ENTRY ListEntry;
  150. LONG Index;
  151. DEBUGGER_BREAK_POINT_TYPE Type;
  152. ULONGLONG Address;
  153. UCHAR AccessSize;
  154. ULONG OriginalValue;
  155. BOOL Enabled;
  156. } DEBUGGER_BREAK_POINT, *PDEBUGGER_BREAK_POINT;
  157. /*++
  158. Structure Description:
  159. This structure defines parameters for dumping memory.
  160. Members:
  161. Virtual - Stores a boolean indicating if the address is virtual (TRUE) or
  162. physical (FALSE).
  163. PrintCharacters - Stores a boolean indicating if characters should be
  164. printed as well.
  165. NextAddress - Stores the next address to dump.
  166. Columns - Stores the desired number of columns.
  167. TotalValues - Stores the desired total number of values to dump.
  168. --*/
  169. typedef struct _DEBUGGER_DUMP_MEMORY_PARAMETERS {
  170. BOOL Virtual;
  171. BOOL PrintCharacters;
  172. ULONGLONG NextAddress;
  173. ULONG Columns;
  174. ULONG TotalValues;
  175. } DEBUGGER_DUMP_MEMORY_PARAMETERS, *PDEBUGGER_DUMP_MEMORY_PARAMETERS;
  176. /*++
  177. Structure Description:
  178. This structure defines a mutable array of pointer sized elements.
  179. Members:
  180. Elements - Stores the array of pointers.
  181. Size - Stores the number of valid elements in the array.
  182. Capacity - Storse the maximum number of elements that can be put in the
  183. array before the array itself needs to be reallocated.
  184. --*/
  185. typedef struct _POINTER_ARRAY {
  186. PVOID *Elements;
  187. ULONGLONG Size;
  188. ULONGLONG Capacity;
  189. } POINTER_ARRAY, *PPOINTER_ARRAY;
  190. /*++
  191. Structure Description:
  192. This structure defines thread profiling parameters.
  193. Members:
  194. StatisticsListHead - Stores the head of the list of thread statistics data.
  195. StatisticsListLock - Stores a handle to the lock serializing access to the
  196. thread statistics list.
  197. StatisticsLock - Stores a handle to the lock serializing access to the
  198. pointer arrays and other thread profiling data.
  199. ContextSwaps - Stores the array of context swap data.
  200. Processes - Stores the array of process data.
  201. Threads - Stores the array of thread data.
  202. ProcessorCount - Stores the number of processors in the system.
  203. ReferenceTime - Stores the reference time for thread profiling data.
  204. ProcessNameWidth - Stores the width in characters of the process name field.
  205. ThreadNameWidth - Stores the width in characters of the thread name field.
  206. --*/
  207. typedef struct _DEBUGGER_THREAD_PROFILING_DATA {
  208. LIST_ENTRY StatisticsListHead;
  209. HANDLE StatisticsListLock;
  210. HANDLE StatisticsLock;
  211. PPOINTER_ARRAY ContextSwaps;
  212. PPOINTER_ARRAY Processes;
  213. PPOINTER_ARRAY Threads;
  214. ULONG ProcessorCount;
  215. PROFILER_THREAD_TIME_COUNTER ReferenceTime;
  216. ULONG ProcessNameWidth;
  217. ULONG ThreadNameWidth;
  218. } DEBUGGER_THREAD_PROFILING_DATA, *PDEBUGGER_THREAD_PROFILING_DATA;
  219. /*++
  220. Structure Description:
  221. This structure stores profiling information.
  222. Members:
  223. StackListHead - Stores the head of the list of stack sampling data.
  224. StackListLock - Stores a handle to the lock serializing access to the stack
  225. list.
  226. MemoryListHead - Stores the head of the list of memory profiling data.
  227. MemoryListLock - Stores a handle to the lock serializing access to the
  228. memory list.
  229. MemoryCollectionActive - Stores a boolean indicating if memory data is
  230. being collected.
  231. CommandLineStackRoot - Stores the stack profiling root node when running
  232. from the command line.
  233. CommandLinePoolListHead - Stores a pointer to the most recent pool when
  234. running command line commands.
  235. CommandLineBaseListHead - Stores a pointer to the base line memory list
  236. list when running command line commands.
  237. --*/
  238. typedef struct _DEBUGGER_PROFILING_DATA {
  239. LIST_ENTRY StackListHead;
  240. HANDLE StackListLock;
  241. LIST_ENTRY MemoryListHead;
  242. HANDLE MemoryListLock;
  243. BOOL MemoryCollectionActive;
  244. PSTACK_DATA_ENTRY CommandLineStackRoot;
  245. PLIST_ENTRY CommandLinePoolListHead;
  246. PLIST_ENTRY CommandLineBaseListHead;
  247. } DEBUGGER_PROFILING_DATA, *PDEBUGGER_PROFILING_DATA;
  248. /*++
  249. Structure Description:
  250. This structure stores information pertaining to the maintenance of standard
  251. output.
  252. Members:
  253. Lock - Stores the handle to the lock synchronizing access to the console
  254. buffer.
  255. ConsoleBuffer - Stores a pointer to the console buffer.
  256. ConsoleBufferSize - Stores the number of valid bytes in the console
  257. buffer, including the null terminator if there is one.
  258. ConsoleBufferCapacity - Stores the allocation size of the console buffer.
  259. Prompt - Stores the current prompt.
  260. --*/
  261. typedef struct _DEBUGGER_STANDARD_OUT {
  262. HANDLE Lock;
  263. PCHAR ConsoleBuffer;
  264. ULONGLONG ConsoleBufferSize;
  265. ULONGLONG ConsoleBufferCapacity;
  266. PSTR Prompt;
  267. } DEBUGGER_STANDARD_OUT, *PDEBUGGER_STANDARD_OUT;
  268. /*++
  269. Structure Description:
  270. This structure stores information pertaining to the maintenance of standard
  271. input.
  272. Members:
  273. Lock - Stores a lock serializing access to the remote command list.
  274. RemoteCommandList - Stores the head of the list of remote commands waiting
  275. to be executed.
  276. --*/
  277. typedef struct _DEBUGGER_STANDARD_IN {
  278. HANDLE Lock;
  279. LIST_ENTRY RemoteCommandList;
  280. } DEBUGGER_STANDARD_IN, *PDEBUGGER_STANDARD_IN;
  281. /*++
  282. Structure Description:
  283. This structure stores information pertaining to managing a remote debug
  284. server.
  285. Members:
  286. Socket - Stores the socket listening to incoming connections.
  287. Host - Stores the host name or IP the server is listening on.
  288. Port - Stores the port the server is listening on.
  289. ShutDown - Stores a value indicating that the server should be shut down.
  290. ClientList - Stores the list of connected clients.
  291. --*/
  292. typedef struct _DEBUGGER_SERVER_CONTEXT {
  293. int Socket;
  294. char *Host;
  295. int Port;
  296. volatile int ShutDown;
  297. LIST_ENTRY ClientList;
  298. } DEBUGGER_SERVER_CONTEXT, *PDEBUGGER_SERVER_CONTEXT;
  299. /*++
  300. Structure Description:
  301. This structure stores information about the remote connection of the client
  302. (this application) to a remote server.
  303. Members:
  304. Socket - Stores the socket connected to the server.
  305. ShutDown - Stores a value indicating that the client network thread is
  306. finished.
  307. --*/
  308. typedef struct _DEBUGGER_CLIENT_CONTEXT {
  309. volatile int ShutDown;
  310. int Socket;
  311. } DEBUGGER_CLIENT_CONTEXT, *PDEBUGGER_CLIENT_CONTEXT;
  312. /*++
  313. Structure Description:
  314. This structure stores information about the current source line.
  315. Members:
  316. Path - Stores the full path to the source file, as represented in the
  317. debug symbols. This needs to be freed.
  318. ActualPath - Stores the full path to the source file where it was actually
  319. found. This needs to be freed.
  320. Contents - Stores the contents of the source file. This needs to be freed.
  321. Size - Stores the size of the file in bytes.
  322. LineNumber - Stores the currently highlighted line number, or 0 if no line
  323. is highlighted.
  324. --*/
  325. typedef struct _DEBUGGER_SOURCE_FILE {
  326. PSTR Path;
  327. PSTR ActualPath;
  328. PVOID Contents;
  329. ULONGLONG Size;
  330. ULONGLONG LineNumber;
  331. } DEBUGGER_SOURCE_FILE, *PDEBUGGER_SOURCE_FILE;
  332. /*++
  333. Structure Description:
  334. This structure stores information about the current source line.
  335. Members:
  336. ListEntry - Stores pointers to the next and previous source paths.
  337. Prefix - Stores a pointer to the prefix to pull off of the potential
  338. source path. If the source in question does not match, it will be
  339. skipped. An empty prefix matches everything.
  340. PrefixLength - Stores the length of the prefix in characters, not including
  341. the null terminator.
  342. Path - Stores a pointer to the path to search for sources in.
  343. PathLength - Stores the length of the path string in characters, not
  344. including the null terminator.
  345. --*/
  346. typedef struct _DEBUGGER_SOURCE_PATH {
  347. LIST_ENTRY ListEntry;
  348. PSTR Prefix;
  349. UINTN PrefixLength;
  350. PSTR Path;
  351. UINTN PathLength;
  352. } DEBUGGER_SOURCE_PATH, *PDEBUGGER_SOURCE_PATH;
  353. /*++
  354. Structure Description:
  355. This structure defines an instance of the debugger application.
  356. Members:
  357. Flags - Stores a bitfield of global flags, see DEBUGGER_FLAG_* for
  358. definitions.
  359. TargetFlags - Stores a bitfield of flags regarding the target connection.
  360. See DEBUGGER_TARGET_* definitions.
  361. SymbolPath - Stores a pointer to an array of strings containing the symbol
  362. path to search when trying to load symbols.
  363. SymbolPathCount - Stores the number of elements in the symbol path array.
  364. RangeStepValid - Stores a boolean indicating whether the range step
  365. parameters are active.
  366. RangeStepParameters - Stores the parameters for the current range step.
  367. OneTimeBreakValid - Stores a boolean indicating if the one-time breakpoint
  368. (used for "g <addr>") is valid.
  369. OneTimeBreakAddress - Stores the target memory address of the one-time
  370. breakpoint.
  371. OneTimeBreakOriginalValue - Stores the original value at the one-time
  372. break address.
  373. LastMemoryDump - Stores the parameters used in the most recent memory
  374. dump.
  375. BreakpointList - Stores the head of the list of breakpoints.
  376. BreakpointToRestore - Stores a pointer to the breakpoint to reset after
  377. stepping off of it.
  378. PreviousProcess - Stores the process ID of the last debugger event, used to
  379. determine if the symbol list should be reloaded.
  380. BreakInstructionLength - Stores the length of the instruction of the most
  381. recent break.
  382. DisassemblyAddress - Stores the address of the next disassembly command if
  383. no address is provided.
  384. LoadedExtensions - Stores the list head of loaded debugger extensions.
  385. SourceFile - Stores information about the currently displayed source file.
  386. SourcePathList - Stores the head of the list of DEBUGGER_SOURCE_PATHs.
  387. ModuleList - Stores the loaded module list.
  388. RemoteModuleListSignature - Stores the most recent loaded module list
  389. signature.
  390. MachineType - Stores the target machine type.
  391. ThreadProfiling - Stores the thread profiling data.
  392. ProfilingData - Stores generic profiling data.
  393. StandardOut - Stores the standard out information.
  394. StandardIn - Stores the standard in information.
  395. CommandBuffer - Stores the buffer that holds the currently running debugger
  396. command.
  397. CommandBufferSize - Stores the total size of the command buffer in bytes.
  398. CommandHistory - Stores the debugger command history array.
  399. CommandHistorySize - Stores the size of the command history array. Not all
  400. of these elements are necessarily valid.
  401. CommandHistoryNextIndex - Stores the index where the next history entry
  402. will be deposited.
  403. Server - Stores context when this debugger is acting as a remote server.
  404. Client - Stores context when this debugger is acting as a remote client.
  405. CurrentEvent - Stores the current debug event.
  406. ConnectionType - Stores the current debug connection type.
  407. FrameRegisters - Stores the registers as unwound to the currently displayed
  408. stack frame.
  409. CurrentFrame - Stores the current stack frame index.
  410. --*/
  411. struct _DEBUGGER_CONTEXT {
  412. ULONG Flags;
  413. ULONG TargetFlags;
  414. PSTR *SymbolPath;
  415. ULONG SymbolPathCount;
  416. BOOL RangeStepValid;
  417. RANGE_STEP RangeStepParameters;
  418. BOOL OneTimeBreakValid;
  419. ULONGLONG OneTimeBreakAddress;
  420. ULONG OneTimeBreakOriginalValue;
  421. DEBUGGER_DUMP_MEMORY_PARAMETERS LastMemoryDump;
  422. LIST_ENTRY BreakpointList;
  423. PDEBUGGER_BREAK_POINT BreakpointToRestore;
  424. ULONG PreviousProcess;
  425. ULONG BreakInstructionLength;
  426. ULONGLONG DisassemblyAddress;
  427. LIST_ENTRY LoadedExtensions;
  428. DEBUGGER_SOURCE_FILE SourceFile;
  429. LIST_ENTRY SourcePathList;
  430. ULONG HighlightedLineNumber;
  431. DEBUGGER_MODULE_LIST ModuleList;
  432. ULONGLONG RemoteModuleListSignature;
  433. ULONG MachineType;
  434. DEBUGGER_THREAD_PROFILING_DATA ThreadProfiling;
  435. DEBUGGER_PROFILING_DATA ProfilingData;
  436. DEBUGGER_STANDARD_OUT StandardOut;
  437. DEBUGGER_STANDARD_IN StandardIn;
  438. PSTR CommandBuffer;
  439. ULONG CommandBufferSize;
  440. PSTR *CommandHistory;
  441. ULONG CommandHistorySize;
  442. ULONG CommandHistoryNextIndex;
  443. DEBUGGER_SERVER_CONTEXT Server;
  444. DEBUGGER_CLIENT_CONTEXT Client;
  445. DEBUGGER_EVENT CurrentEvent;
  446. DEBUG_CONNECTION_TYPE ConnectionType;
  447. REGISTERS_UNION FrameRegisters;
  448. ULONG CurrentFrame;
  449. };
  450. typedef
  451. INT
  452. (*PDEBUGGER_COMMAND_ROUTINE) (
  453. PDEBUGGER_CONTEXT Context,
  454. PSTR *Arguments,
  455. ULONG ArgumentCount
  456. );
  457. /*++
  458. Routine Description:
  459. This routine implements a registered debugger command.
  460. Arguments:
  461. Context - Supplies a pointer to the application context.
  462. Arguments - Supplies an array of strings containing the arguments. The
  463. first argument is the command itself.
  464. ArgumentCount - Supplies the count of arguments. This is always at least
  465. one.
  466. Return Value:
  467. 0 on success.
  468. Returns an error code on failure.
  469. --*/
  470. /*++
  471. Structure Description:
  472. This structure defines a debugger command registration entry.
  473. Members:
  474. Command - Stores a pointer to a string containing the name of the command
  475. to register.
  476. CommandRoutine - Stores a pointer to the routine to execute when this
  477. command is invoked.
  478. HelpText - Stores a pointer to a one-liner string describing what the
  479. command does.
  480. --*/
  481. typedef struct _DEBUGGER_COMMAND_ENTRY {
  482. PSTR Command;
  483. PDEBUGGER_COMMAND_ROUTINE CommandRoutine;
  484. PSTR HelpText;
  485. } DEBUGGER_COMMAND_ENTRY, *PDEBUGGER_COMMAND_ENTRY;
  486. //
  487. // -------------------------------------------------------------------- Globals
  488. //
  489. //
  490. // ------------------------------------------------------------------ Functions
  491. //
  492. BOOL
  493. DbgrGetCommand (
  494. PDEBUGGER_CONTEXT Context
  495. );
  496. /*++
  497. Routine Description:
  498. This routine retrieves a command from the user or a remote client.
  499. Arguments:
  500. Context - Supplies a pointer to the application context.
  501. Return Value:
  502. Returns TRUE on success, FALSE on failure.
  503. --*/
  504. VOID
  505. DbgrpSetPromptText (
  506. PDEBUGGER_CONTEXT Context,
  507. PSTR Prompt
  508. );
  509. /*++
  510. Routine Description:
  511. This routine sets the command prompt to the given string.
  512. Arguments:
  513. Context - Supplies a pointer to the application context.
  514. Prompt - Supplies a pointer to the null terminated string containing the
  515. prompt to set.
  516. Return Value:
  517. None.
  518. --*/
  519. BOOL
  520. DbgrpSplitCommandArguments (
  521. PSTR Input,
  522. PSTR Arguments[DEBUGGER_MAX_COMMAND_ARGUMENTS],
  523. PULONG ArgumentCount
  524. );
  525. /*++
  526. Routine Description:
  527. This routine splits a command line into its arguments.
  528. Arguments:
  529. Input - Supplies a pointer to the input command line buffer.
  530. Arguments - Supplies a pointer to an array of strings that will receive any
  531. additional arguments.
  532. ArgumentCount - Supplies a pointer where the count of arguments will be
  533. returned.
  534. Return Value:
  535. Returns TRUE on success, FALSE on failure.
  536. --*/
  537. //
  538. // Profiling functions
  539. //
  540. INT
  541. DbgrProfilerInitialize (
  542. PDEBUGGER_CONTEXT Context
  543. );
  544. /*++
  545. Routine Description:
  546. This routine initializes the debugger for profiler data consumption.
  547. Arguments:
  548. Context - Supplies a pointer to the application context.
  549. Return Value:
  550. 0 on success.
  551. Returns an error code on failure.
  552. --*/
  553. VOID
  554. DbgrProfilerDestroy (
  555. PDEBUGGER_CONTEXT Context
  556. );
  557. /*++
  558. Routine Description:
  559. This routine destroys any structures used to consume profiler data.
  560. Arguments:
  561. Context - Supplies a pointer to the application context.
  562. Return Value:
  563. None.
  564. --*/
  565. INT
  566. DbgrDispatchProfilerCommand (
  567. PDEBUGGER_CONTEXT Context,
  568. PSTR *Arguments,
  569. ULONG ArgumentCount
  570. );
  571. /*++
  572. Routine Description:
  573. This routine handles a profiler command.
  574. Arguments:
  575. Context - Supplies a pointer to the application context.
  576. Arguments - Supplies an array of strings containing the arguments.
  577. ArgumentCount - Supplies the number of arguments in the Arguments array.
  578. Return Value:
  579. 0 on success.
  580. Returns an error code on failure.
  581. --*/
  582. VOID
  583. DbgrProcessProfilerNotification (
  584. PDEBUGGER_CONTEXT Context
  585. );
  586. /*++
  587. Routine Description:
  588. This routine processes a profiler notification that the debuggee sends to
  589. the debugger. The routine should collect the profiler data and return as
  590. quickly as possible.
  591. Arguments:
  592. Context - Supplies a pointer to the application context.
  593. Return Value:
  594. None.
  595. --*/
  596. //
  597. // General debugger functions
  598. //
  599. PDEBUGGER_COMMAND_ENTRY
  600. DbgrLookupCommand (
  601. PSTR Command
  602. );
  603. /*++
  604. Routine Description:
  605. This routine attempts to find a debugger command entry.
  606. Arguments:
  607. Command - Supplies a pointer to the null-terminated string containing the
  608. name of the command that was invoked. This command is split on the
  609. period character, and the first segment is looked up.
  610. Return Value:
  611. Returns a pointer to the command entry on success.
  612. NULL if there no such command, or on failure.
  613. --*/
  614. INT
  615. DbgrInitialize (
  616. PDEBUGGER_CONTEXT Context,
  617. DEBUG_CONNECTION_TYPE ConnectionType
  618. );
  619. /*++
  620. Routine Description:
  621. This routine initializes data structures for common debugger functionality.
  622. Arguments:
  623. Context - Supplies a pointer to the application context.
  624. ConnectionType - Supplies the type of debug connection to set the debugger
  625. up in.
  626. Return Value:
  627. 0 on success.
  628. Returns an error number on failure.
  629. --*/
  630. VOID
  631. DbgrDestroy (
  632. PDEBUGGER_CONTEXT Context,
  633. DEBUG_CONNECTION_TYPE ConnectionType
  634. );
  635. /*++
  636. Routine Description:
  637. This routine destroys any data structures used for common debugger
  638. functionality.
  639. Arguments:
  640. Context - Supplies a pointer to the application context.
  641. ConnectionType - Supplies the type of debug connection the debugger was set
  642. up in.
  643. Return Value:
  644. None.
  645. --*/
  646. INT
  647. DbgrConnect (
  648. PDEBUGGER_CONTEXT Context
  649. );
  650. /*++
  651. Routine Description:
  652. This routine establishes a link with the target debuggee. It is assumed that
  653. the underlying communication layer has already been established (COM ports
  654. have been opened and initialized, etc).
  655. Arguments:
  656. Context - Supplies a pointer to the application context.
  657. Return Value:
  658. 0 on success.
  659. Returns an error code on failure.
  660. --*/
  661. INT
  662. DbgrQuit (
  663. PDEBUGGER_CONTEXT Context,
  664. PSTR *Arguments,
  665. ULONG ArgumentCount
  666. );
  667. /*++
  668. Routine Description:
  669. This routine exits the local debugger.
  670. Arguments:
  671. Context - Supplies a pointer to the application context.
  672. Arguments - Supplies an array of strings containing the arguments. The
  673. first argument is the command itself.
  674. ArgumentCount - Supplies the count of arguments. This is always at least
  675. one.
  676. Return Value:
  677. 0 on success.
  678. Returns an error code on failure.
  679. --*/
  680. INT
  681. DbgrGo (
  682. PDEBUGGER_CONTEXT Context,
  683. PSTR *Arguments,
  684. ULONG ArgumentCount
  685. );
  686. /*++
  687. Routine Description:
  688. This routine interprets the "go" command from the user.
  689. Arguments:
  690. Context - Supplies a pointer to the application context.
  691. Arguments - Supplies an array of strings containing the arguments. The
  692. first argument is the command itself.
  693. ArgumentCount - Supplies the count of arguments. This is always at least
  694. one.
  695. Return Value:
  696. 0 on success.
  697. Returns an error code on failure.
  698. --*/
  699. INT
  700. DbgrSingleStep (
  701. PDEBUGGER_CONTEXT Context
  702. );
  703. /*++
  704. Routine Description:
  705. This routine steps the target by a single instruction.
  706. Arguments:
  707. Context - Supplies a pointer to the application context.
  708. Return Value:
  709. 0 on success.
  710. Returns an error code on failure.
  711. --*/
  712. INT
  713. DbgrGetSetRegisters (
  714. PDEBUGGER_CONTEXT Context,
  715. PSTR *Arguments,
  716. ULONG ArgumentCount
  717. );
  718. /*++
  719. Routine Description:
  720. This routine prints or modifies the target machine's registers.
  721. Arguments:
  722. Context - Supplies a pointer to the application context.
  723. Arguments - Supplies an array of strings containing the arguments. The
  724. first argument is the command itself.
  725. ArgumentCount - Supplies the count of arguments. This is always at least
  726. one.
  727. Return Value:
  728. 0 on success.
  729. Returns an error code on failure.
  730. --*/
  731. INT
  732. DbgrGetSetSpecialRegisters (
  733. PDEBUGGER_CONTEXT Context,
  734. PSTR *Arguments,
  735. ULONG ArgumentCount
  736. );
  737. /*++
  738. Routine Description:
  739. This routine prints or modifies the target machine's special registers.
  740. Arguments:
  741. Context - Supplies a pointer to the application context.
  742. Arguments - Supplies an array of strings containing the arguments. The
  743. first argument is the command itself.
  744. ArgumentCount - Supplies the count of arguments. This is always at least
  745. one.
  746. Return Value:
  747. 0 on success.
  748. Returns an error code on failure.
  749. --*/
  750. INT
  751. DbgrPrintCallStack (
  752. PDEBUGGER_CONTEXT Context,
  753. PSTR *Arguments,
  754. ULONG ArgumentCount
  755. );
  756. /*++
  757. Routine Description:
  758. This routine prints the current call stack.
  759. Arguments:
  760. Context - Supplies a pointer to the application context.
  761. Arguments - Supplies an array of strings containing the arguments. The
  762. first argument is the command itself.
  763. ArgumentCount - Supplies the count of arguments. This is always at least
  764. one.
  765. Return Value:
  766. 0 on success.
  767. Returns an error code on failure.
  768. --*/
  769. INT
  770. DbgrSetFrame (
  771. PDEBUGGER_CONTEXT Context,
  772. PSTR *Arguments,
  773. ULONG ArgumentCount
  774. );
  775. /*++
  776. Routine Description:
  777. This routine changes the current stack frame, so that local variables may
  778. come from a different function in the call stack.
  779. Arguments:
  780. Context - Supplies a pointer to the application context.
  781. Arguments - Supplies an array of strings containing the arguments. The
  782. first argument is the command itself.
  783. ArgumentCount - Supplies the count of arguments. This is always at least
  784. one.
  785. Return Value:
  786. 0 on success.
  787. Returns an error code on failure.
  788. --*/
  789. INT
  790. DbgrDisassemble (
  791. PDEBUGGER_CONTEXT Context,
  792. PSTR *Arguments,
  793. ULONG ArgumentCount
  794. );
  795. /*++
  796. Routine Description:
  797. This routine disassembles instructions from the target.
  798. Arguments:
  799. Context - Supplies a pointer to the application context.
  800. Arguments - Supplies an array of strings containing the arguments. The
  801. first argument is the command itself.
  802. ArgumentCount - Supplies the count of arguments. This is always at least
  803. one.
  804. Return Value:
  805. 0 on success.
  806. Returns an error code on failure.
  807. --*/
  808. INT
  809. DbgrWaitForEvent (
  810. PDEBUGGER_CONTEXT Context
  811. );
  812. /*++
  813. Routine Description:
  814. This routine gets an event from the target, such as a break event or other
  815. exception.
  816. Arguments:
  817. Context - Supplies a pointer to the debugger context.
  818. Return Value:
  819. 0 on success,
  820. Returns an error code on failure.
  821. --*/
  822. INT
  823. DbgrSearchSymbols (
  824. PDEBUGGER_CONTEXT Context,
  825. PSTR *Arguments,
  826. ULONG ArgumentCount
  827. );
  828. /*++
  829. Routine Description:
  830. This routine searches for symbols. Wildcards are accepted. If the search
  831. string is preceded by "modulename!" then only that module will be searched.
  832. Arguments:
  833. Context - Supplies a pointer to the application context.
  834. Arguments - Supplies an array of strings containing the arguments. The
  835. first argument is the command itself.
  836. ArgumentCount - Supplies the count of arguments. This is always at least
  837. one.
  838. Return Value:
  839. 0 on success.
  840. Returns an error code on failure.
  841. --*/
  842. INT
  843. DbgrDumpTypeCommand (
  844. PDEBUGGER_CONTEXT Context,
  845. PSTR *Arguments,
  846. ULONG ArgumentCount
  847. );
  848. /*++
  849. Routine Description:
  850. This routine prints information about a type description or value. If only
  851. a type is specified, the type format will be printed. If an address is
  852. passed as a second parameter, then the values will be dumped. If a global
  853. or local variable is passed as the first parameter, the values will also be
  854. dumped.
  855. Arguments:
  856. Context - Supplies a pointer to the application context.
  857. Arguments - Supplies an array of strings containing the arguments. The
  858. first argument is the command itself.
  859. ArgumentCount - Supplies the count of arguments. This is always at least
  860. one.
  861. Return Value:
  862. 0 on success.
  863. Returns an error code on failure.
  864. --*/
  865. INT
  866. DbgrDumpMemory (
  867. PDEBUGGER_CONTEXT Context,
  868. PSTR *Arguments,
  869. ULONG ArgumentCount
  870. );
  871. /*++
  872. Routine Description:
  873. This routine prints the contents of debuggee memory to the screen.
  874. Arguments:
  875. Context - Supplies a pointer to the application context.
  876. Arguments - Supplies an array of strings containing the arguments. The
  877. first argument is the command itself.
  878. ArgumentCount - Supplies the count of arguments. This is always at least
  879. one.
  880. Return Value:
  881. 0 on success.
  882. Returns an error code on failure.
  883. --*/
  884. INT
  885. DbgrDumpList (
  886. PDEBUGGER_CONTEXT Context,
  887. PSTR *Arguments,
  888. ULONG ArgumentCount
  889. );
  890. /*++
  891. Routine Description:
  892. This routine interates over a linked list and prints out the structure
  893. information for each entry. It also performs basic validation on the list,
  894. checking for bad previous pointers.
  895. Arguments:
  896. Context - Supplies a pointer to the application context.
  897. Arguments - Supplies an array of strings containing the arguments. The
  898. first argument is the command itself.
  899. ArgumentCount - Supplies the count of arguments. This is always at least
  900. one.
  901. Return Value:
  902. 0 on success.
  903. Returns an error code on failure.
  904. --*/
  905. INT
  906. DbgrEditMemory (
  907. PDEBUGGER_CONTEXT Context,
  908. PSTR *Arguments,
  909. ULONG ArgumentCount
  910. );
  911. /*++
  912. Routine Description:
  913. This routine writes to the target memory space.
  914. Arguments:
  915. Context - Supplies a pointer to the application context.
  916. Arguments - Supplies an array of strings containing the arguments. The
  917. first argument is the command itself.
  918. ArgumentCount - Supplies the count of arguments. This is always at least
  919. one.
  920. Return Value:
  921. 0 on success.
  922. Returns an error code on failure.
  923. --*/
  924. INT
  925. DbgrEvaluate (
  926. PDEBUGGER_CONTEXT Context,
  927. PSTR *Arguments,
  928. ULONG ArgumentCount
  929. );
  930. /*++
  931. Routine Description:
  932. This routine evaluates a numerical expression and prints it out in both
  933. decimal and hexadecimal.
  934. Arguments:
  935. Context - Supplies a pointer to the application context.
  936. Arguments - Supplies an array of strings containing the arguments. The
  937. first argument is the command itself.
  938. ArgumentCount - Supplies the count of arguments. This is always at least
  939. one.
  940. Return Value:
  941. 0 on success.
  942. Returns an error code on failure.
  943. --*/
  944. INT
  945. DbgrShowSourceAtAddressCommand (
  946. PDEBUGGER_CONTEXT Context,
  947. PSTR *Arguments,
  948. ULONG ArgumentCount
  949. );
  950. /*++
  951. Routine Description:
  952. This routine shows the source file for the provided address and highlights
  953. the specific line associated with the address.
  954. Arguments:
  955. Context - Supplies a pointer to the application context.
  956. Arguments - Supplies an array of strings containing the arguments. The
  957. first argument is the command itself.
  958. ArgumentCount - Supplies the count of arguments. This is always at least
  959. one.
  960. Return Value:
  961. 0 on success.
  962. Returns an error code on failure.
  963. --*/
  964. INT
  965. DbgrPrintLocals (
  966. PDEBUGGER_CONTEXT Context,
  967. PSTR *Arguments,
  968. ULONG ArgumentCount
  969. );
  970. /*++
  971. Routine Description:
  972. This routine prints the values of the local variables inside the currently
  973. selected stack frame.
  974. Arguments:
  975. Context - Supplies a pointer to the application context.
  976. Arguments - Supplies an array of strings containing the arguments. The
  977. first argument is the command itself.
  978. ArgumentCount - Supplies the count of arguments. This is always at least
  979. one.
  980. Return Value:
  981. 0 on success.
  982. Returns an error code on failure.
  983. --*/
  984. VOID
  985. DbgrUnhighlightCurrentLine (
  986. PDEBUGGER_CONTEXT Context
  987. );
  988. /*++
  989. Routine Description:
  990. This routine restores the currently executing line to the normal background
  991. color in the source window.
  992. Arguments:
  993. Context - Supplies a pointer to the application context.
  994. Return Value:
  995. None.
  996. --*/
  997. INT
  998. DbgrListBreakPoints (
  999. PDEBUGGER_CONTEXT Context,
  1000. PSTR *Arguments,
  1001. ULONG ArgumentCount
  1002. );
  1003. /*++
  1004. Routine Description:
  1005. This routine lists all valid breakpoints in the target.
  1006. Arguments:
  1007. Context - Supplies a pointer to the application context.
  1008. Arguments - Supplies an array of strings containing the arguments. The
  1009. first argument is the command itself.
  1010. ArgumentCount - Supplies the count of arguments. This is always at least
  1011. one.
  1012. Return Value:
  1013. 0 on success.
  1014. Returns an error code on failure.
  1015. --*/
  1016. INT
  1017. DbgrEnableBreakPoint (
  1018. PDEBUGGER_CONTEXT Context,
  1019. PSTR *Arguments,
  1020. ULONG ArgumentCount
  1021. );
  1022. /*++
  1023. Routine Description:
  1024. This routine lists all valid breakpoints in the target.
  1025. Arguments:
  1026. Context - Supplies a pointer to the application context.
  1027. Arguments - Supplies an array of strings containing the arguments. The
  1028. first argument is the command itself.
  1029. ArgumentCount - Supplies the count of arguments. This is always at least
  1030. one.
  1031. Return Value:
  1032. 0 on success.
  1033. Returns an error code on failure.
  1034. --*/
  1035. INT
  1036. DbgrDeleteBreakPoint (
  1037. PDEBUGGER_CONTEXT Context,
  1038. PSTR *Arguments,
  1039. ULONG ArgumentCount
  1040. );
  1041. /*++
  1042. Routine Description:
  1043. This routine deletes a breakpoint from the target.
  1044. Arguments:
  1045. Context - Supplies a pointer to the application context.
  1046. Arguments - Supplies an array of strings containing the arguments. The
  1047. first argument is the command itself.
  1048. ArgumentCount - Supplies the count of arguments. This is always at least
  1049. one.
  1050. Return Value:
  1051. 0 on success.
  1052. Returns an error code on failure.
  1053. --*/
  1054. INT
  1055. DbgrCreateBreakPoint (
  1056. PDEBUGGER_CONTEXT Context,
  1057. PSTR *Arguments,
  1058. ULONG ArgumentCount
  1059. );
  1060. /*++
  1061. Routine Description:
  1062. This routine creates a new breakpoint in the debuggee.
  1063. Arguments:
  1064. Context - Supplies a pointer to the application context.
  1065. Arguments - Supplies an array of strings containing the arguments. The
  1066. first argument is the command itself.
  1067. ArgumentCount - Supplies the count of arguments. This is always at least
  1068. one.
  1069. Return Value:
  1070. 0 on success.
  1071. Returns an error code on failure.
  1072. --*/
  1073. INT
  1074. DbgrStep (
  1075. PDEBUGGER_CONTEXT Context,
  1076. PSTR *Arguments,
  1077. ULONG ArgumentCount
  1078. );
  1079. /*++
  1080. Routine Description:
  1081. This routine performs a source or assembly line step in the debugger.
  1082. Arguments:
  1083. Context - Supplies a pointer to the application context.
  1084. Arguments - Supplies an array of strings containing the arguments. The
  1085. first argument is the command itself.
  1086. ArgumentCount - Supplies the count of arguments. This is always at least
  1087. one.
  1088. Return Value:
  1089. 0 on success.
  1090. Returns an error code on failure.
  1091. --*/
  1092. INT
  1093. DbgrSetSourceStepping (
  1094. PDEBUGGER_CONTEXT Context,
  1095. PSTR *Arguments,
  1096. ULONG ArgumentCount
  1097. );
  1098. /*++
  1099. Routine Description:
  1100. This routine turns source line stepping on or off.
  1101. Arguments:
  1102. Context - Supplies a pointer to the application context.
  1103. Arguments - Supplies an array of strings containing the arguments. The
  1104. first argument is the command itself.
  1105. ArgumentCount - Supplies the count of arguments. This is always at least
  1106. one.
  1107. Return Value:
  1108. 0 on success.
  1109. Returns an error code on failure.
  1110. --*/
  1111. INT
  1112. DbgrSetSourceLinePrinting (
  1113. PDEBUGGER_CONTEXT Context,
  1114. PSTR *Arguments,
  1115. ULONG ArgumentCount
  1116. );
  1117. /*++
  1118. Routine Description:
  1119. This routine turns on or off the option to print the source file and line
  1120. next to every text address.
  1121. Arguments:
  1122. Context - Supplies a pointer to the application context.
  1123. Arguments - Supplies an array of strings containing the arguments. The
  1124. first argument is the command itself.
  1125. ArgumentCount - Supplies the count of arguments. This is always at least
  1126. one.
  1127. Return Value:
  1128. 0 on success.
  1129. Returns an error code on failure.
  1130. --*/
  1131. INT
  1132. DbgrReturnToCaller (
  1133. PDEBUGGER_CONTEXT Context,
  1134. PSTR *Arguments,
  1135. ULONG ArgumentCount
  1136. );
  1137. /*++
  1138. Routine Description:
  1139. This routine interprets the "go" command from the user.
  1140. Arguments:
  1141. Context - Supplies a pointer to the application context.
  1142. Arguments - Supplies an array of strings containing the arguments. The
  1143. first argument is the command itself.
  1144. ArgumentCount - Supplies the count of arguments. This is always at least
  1145. one.
  1146. Return Value:
  1147. 0 on success.
  1148. Returns an error code on failure.
  1149. --*/
  1150. INT
  1151. DbgrSetSymbolPathCommand (
  1152. PDEBUGGER_CONTEXT Context,
  1153. PSTR *Arguments,
  1154. ULONG ArgumentCount
  1155. );
  1156. /*++
  1157. Routine Description:
  1158. This routine sets or updates the symbol search path.
  1159. Arguments:
  1160. Context - Supplies a pointer to the application context.
  1161. Arguments - Supplies an array of strings containing the arguments. The
  1162. first argument is the command itself.
  1163. ArgumentCount - Supplies the count of arguments. This is always at least
  1164. one.
  1165. Return Value:
  1166. 0 on success.
  1167. Returns an error code on failure.
  1168. --*/
  1169. INT
  1170. DbgrSetSourcePathCommand (
  1171. PDEBUGGER_CONTEXT Context,
  1172. PSTR *Arguments,
  1173. ULONG ArgumentCount
  1174. );
  1175. /*++
  1176. Routine Description:
  1177. This routine sets or updates the source search path.
  1178. Arguments:
  1179. Context - Supplies a pointer to the application context.
  1180. Arguments - Supplies an array of strings containing the arguments. The
  1181. first argument is the command itself.
  1182. ArgumentCount - Supplies the count of arguments. This is always at least
  1183. one.
  1184. Return Value:
  1185. 0 on success.
  1186. Returns an error code on failure.
  1187. --*/
  1188. INT
  1189. DbgrReloadSymbols (
  1190. PDEBUGGER_CONTEXT Context,
  1191. PSTR *Arguments,
  1192. ULONG ArgumentCount
  1193. );
  1194. /*++
  1195. Routine Description:
  1196. This routine unloads and reloads all symbols from the search path.
  1197. Arguments:
  1198. Context - Supplies a pointer to the application context.
  1199. Arguments - Supplies an array of strings containing the arguments. The
  1200. first argument is the command itself.
  1201. ArgumentCount - Supplies the count of arguments. This is always at least
  1202. one.
  1203. Return Value:
  1204. 0 on success.
  1205. Returns an error code on failure.
  1206. --*/
  1207. INT
  1208. DbgrSetSymbolPath (
  1209. PDEBUGGER_CONTEXT Context,
  1210. PSTR Path,
  1211. BOOL Append
  1212. );
  1213. /*++
  1214. Routine Description:
  1215. This routine sets or updates the symbol search path.
  1216. Arguments:
  1217. Context - Supplies a pointer to the application context.
  1218. Path - Supplies a pointer to the new symbol path. This could contain
  1219. multiple symbol paths if separated by semicolons.
  1220. Append - Supplies a boolean indicating whether the new path should replace
  1221. or append the existing path.
  1222. Return Value:
  1223. 0 on success.
  1224. Returns an error code on failure.
  1225. --*/
  1226. INT
  1227. DbgrLoadExtension (
  1228. PDEBUGGER_CONTEXT Context,
  1229. PSTR *Arguments,
  1230. ULONG ArgumentCount
  1231. );
  1232. /*++
  1233. Routine Description:
  1234. This routine loads or unloads a debugger extension.
  1235. Arguments:
  1236. Context - Supplies a pointer to the application context.
  1237. Arguments - Supplies an array of strings containing the arguments. The
  1238. first argument is the command itself.
  1239. ArgumentCount - Supplies the count of arguments. This is always at least
  1240. one.
  1241. Return Value:
  1242. 0 on success.
  1243. Returns an error code on failure.
  1244. --*/
  1245. INT
  1246. DbgrSwitchProcessor (
  1247. PDEBUGGER_CONTEXT Context,
  1248. PSTR *Arguments,
  1249. ULONG ArgumentCount
  1250. );
  1251. /*++
  1252. Routine Description:
  1253. This routine switches the debugger to another processor in kernel mode or
  1254. thread in user mode.
  1255. Arguments:
  1256. Context - Supplies a pointer to the application context.
  1257. Arguments - Supplies an array of strings containing the arguments. The
  1258. first argument is the command itself.
  1259. ArgumentCount - Supplies the count of arguments. This is always at least
  1260. one.
  1261. Return Value:
  1262. 0 on success.
  1263. Returns an error code on failure.
  1264. --*/
  1265. INT
  1266. DbgrPrintProcessorBlock (
  1267. PDEBUGGER_CONTEXT Context,
  1268. PSTR *Arguments,
  1269. ULONG ArgumentCount
  1270. );
  1271. /*++
  1272. Routine Description:
  1273. This routine prints the contents of the current processor block.
  1274. Arguments:
  1275. Context - Supplies a pointer to the application context.
  1276. Arguments - Supplies an array of strings containing the arguments. The
  1277. first argument is the command itself.
  1278. ArgumentCount - Supplies the count of arguments. This is always at least
  1279. one.
  1280. Return Value:
  1281. 0 on success.
  1282. Returns an error code on failure.
  1283. --*/
  1284. INT
  1285. DbgrDumpPointerSymbols (
  1286. PDEBUGGER_CONTEXT Context,
  1287. PSTR *Arguments,
  1288. ULONG ArgumentCount
  1289. );
  1290. /*++
  1291. Routine Description:
  1292. This routine dumps memory at the provided address and attempts to match
  1293. symbols at the dumped memory addresses.
  1294. Arguments:
  1295. Context - Supplies a pointer to the application context.
  1296. Arguments - Supplies an array of strings containing the arguments. The
  1297. first argument is the command itself.
  1298. ArgumentCount - Supplies the count of arguments. This is always at least
  1299. one.
  1300. Return Value:
  1301. 0 on success.
  1302. Returns an error code on failure.
  1303. --*/
  1304. INT
  1305. DbgrProfileCommand (
  1306. PDEBUGGER_CONTEXT Context,
  1307. PSTR *Arguments,
  1308. ULONG ArgumentCount
  1309. );
  1310. /*++
  1311. Routine Description:
  1312. This routine handles the profile command. It essentially just forwards on
  1313. to the profile handler.
  1314. Arguments:
  1315. Context - Supplies a pointer to the application context.
  1316. Arguments - Supplies an array of strings containing the arguments. The
  1317. first argument is the command itself.
  1318. ArgumentCount - Supplies the count of arguments. This is always at least
  1319. one.
  1320. Return Value:
  1321. 0 on success.
  1322. Returns an error code on failure.
  1323. --*/
  1324. INT
  1325. DbgrRebootCommand (
  1326. PDEBUGGER_CONTEXT Context,
  1327. PSTR *Arguments,
  1328. ULONG ArgumentCount
  1329. );
  1330. /*++
  1331. Routine Description:
  1332. This routine handles the profile command. It essentially just forwards on
  1333. to the profile handler.
  1334. Arguments:
  1335. Context - Supplies a pointer to the application context.
  1336. Arguments - Supplies an array of strings containing the arguments. The
  1337. first argument is the command itself.
  1338. ArgumentCount - Supplies the count of arguments. This is always at least
  1339. one.
  1340. Return Value:
  1341. 0 on success.
  1342. Returns an error code on failure.
  1343. --*/
  1344. INT
  1345. DbgrServerCommand (
  1346. PDEBUGGER_CONTEXT Context,
  1347. PSTR *Arguments,
  1348. ULONG ArgumentCount
  1349. );
  1350. /*++
  1351. Routine Description:
  1352. This routine starts or stops a remote server interface.
  1353. Arguments:
  1354. Context - Supplies a pointer to the application context.
  1355. Arguments - Supplies an array of strings containing the arguments. The
  1356. first argument is the command itself.
  1357. ArgumentCount - Supplies the count of arguments. This is always at least
  1358. one.
  1359. Return Value:
  1360. 0 on success.
  1361. Returns an error code on failure.
  1362. --*/
  1363. INT
  1364. DbgrContinue (
  1365. PDEBUGGER_CONTEXT Context,
  1366. BOOL SetOneTimeBreak,
  1367. ULONGLONG Address
  1368. );
  1369. /*++
  1370. Routine Description:
  1371. This routine sends the "go" command to the target, signaling to continue
  1372. execution.
  1373. Arguments:
  1374. Context - Supplies a pointer to the application context.
  1375. SetOneTimeBreak - Supplies a flag indicating whether to go unconditionally
  1376. (FALSE) or with a one-time breakpoint (TRUE).
  1377. Address - Supplies the address of the one-time breakpoint if one was
  1378. specified.
  1379. Return Value:
  1380. 0 on success.
  1381. Returns an error code on failure.
  1382. --*/
  1383. VOID
  1384. DbgrShowSourceAtAddress (
  1385. PDEBUGGER_CONTEXT Context,
  1386. ULONGLONG Address
  1387. );
  1388. /*++
  1389. Routine Description:
  1390. This routine loads the source file and highlights the source line
  1391. corresponding to the given target address.
  1392. Arguments:
  1393. Context - Supplies a pointer to the application context.
  1394. Address - Supplies the target's executing virtual address.
  1395. Return Value:
  1396. None.
  1397. --*/
  1398. INT
  1399. DbgrDumpType (
  1400. PDEBUGGER_CONTEXT Context,
  1401. PSTR *Arguments,
  1402. ULONG ArgumentCount,
  1403. PVOID RawDataStream,
  1404. ULONG RawDataStreamSizeInBytes
  1405. );
  1406. /*++
  1407. Routine Description:
  1408. This routine prints information about a type description or value. If only
  1409. a type is specified, the type format will be printed. If an address is
  1410. passed as a second parameter, then the values will be dumped. If a global
  1411. or local variable is passed as the first parameter, the values will also be
  1412. dumped.
  1413. Arguments:
  1414. Context - Supplies a pointer to the application context.
  1415. Arguments - Supplies a pointer to an array of argument strings.
  1416. ArgumentCount - Supplies the number of arguments in the argument array.
  1417. RawDataStream - Supplies the actual memory to dump in the given type form.
  1418. If this parameter is non-NULL, then the AddressString parameter is
  1419. ignored. The size of this buffer must be non-zero.
  1420. RawDataStreamSizeInBytes - Supplies the size of the raw data stream buffer,
  1421. in bytes.
  1422. Return Value:
  1423. 0 if the information was printed successfully.
  1424. Returns an error code on failure.
  1425. --*/
  1426. INT
  1427. DbgrpHighlightExecutingLine (
  1428. PDEBUGGER_CONTEXT Context,
  1429. ULONGLONG LineNumber
  1430. );
  1431. /*++
  1432. Routine Description:
  1433. This routine highlights the currently executing source line and scrolls to
  1434. it, or removes the highlight.
  1435. Arguments:
  1436. Context - Supplies the application context.
  1437. LineNumber - Supplies the one-based line number to highlight, or 0 to
  1438. disable highlighting.
  1439. Return Value:
  1440. 0 on success.
  1441. Non-zero on failure.
  1442. --*/
  1443. INT
  1444. DbgrpLoadSourceFile (
  1445. PDEBUGGER_CONTEXT Context,
  1446. PSTR Path,
  1447. PSTR *FoundPath,
  1448. PVOID *Contents,
  1449. PULONGLONG Size
  1450. );
  1451. /*++
  1452. Routine Description:
  1453. This routine loads a source file into memory.
  1454. Arguments:
  1455. Context - Supplies a pointer to the application context.
  1456. Path - Supplies a pointer to the path to load.
  1457. FoundPath - Supplies a pointer where a pointer to the path of the actual
  1458. file loaded will be returned. The path may be modified by the source
  1459. path list, so this represents the final found path.
  1460. Contents - Supplies a pointer where a pointer to the loaded file will be
  1461. returned on success. The caller is responsible for freeing this memory.
  1462. Size - Supplies a pointer where the size of the file will be returned on
  1463. success.
  1464. Return Value:
  1465. 0 on success.
  1466. Returns an error code on failure.
  1467. --*/
  1468. INT
  1469. DbgrpAddSourcePath (
  1470. PDEBUGGER_CONTEXT Context,
  1471. PSTR PathString
  1472. );
  1473. /*++
  1474. Routine Description:
  1475. This routine adds a source path entry to the given application context.
  1476. Arguments:
  1477. Context - Supplies a pointer to the application context.
  1478. PathString - Supplies a pointer to the path string, which takes the form
  1479. prefix=path. If there is no equals sign, then the prefix is assumed to
  1480. be empty.
  1481. Return Value:
  1482. 0 on success.
  1483. Returns an error code on failure.
  1484. --*/
  1485. VOID
  1486. DbgrpDestroyAllSourcePaths (
  1487. PDEBUGGER_CONTEXT Context
  1488. );
  1489. /*++
  1490. Routine Description:
  1491. This routine destroys all source path entries in the given application
  1492. context.
  1493. Arguments:
  1494. Context - Supplies a pointer to the application context.
  1495. Return Value:
  1496. 0 on success.
  1497. Returns an error code on failure.
  1498. --*/
  1499. PSTR
  1500. DbgGetAddressSymbol (
  1501. PDEBUGGER_CONTEXT Context,
  1502. ULONGLONG Address,
  1503. PFUNCTION_SYMBOL *Function
  1504. );
  1505. /*++
  1506. Routine Description:
  1507. This routine gets a descriptive string version of the given address,
  1508. including the module and function name if possible. It is the caller's
  1509. responsibility to free the returned string.
  1510. Arguments:
  1511. Context - Supplies a pointer to the application context.
  1512. Address - Supplies the virtual address of the target to get information
  1513. about.
  1514. Function - Supplies an optional pointer where the function symbol will be
  1515. returned if this turned out to be a function.
  1516. Return Value:
  1517. Returns a null-terminated string if successfull, or NULL on failure.
  1518. --*/
  1519. BOOL
  1520. DbgGetDataSymbolTypeInformation (
  1521. PDATA_SYMBOL DataSymbol,
  1522. PTYPE_SYMBOL *TypeSymbol,
  1523. PUINTN TypeSize
  1524. );
  1525. /*++
  1526. Routine Description:
  1527. This routine computes the type and type size of the given data symbol.
  1528. Arguments:
  1529. DataSymbol - Supplies a pointer to the data symbol whose type and type size
  1530. are to be calculated.
  1531. TypeSymbol - Supplies a pointer that receives a pointer to the type symbol
  1532. that corresponds to the given data symbol.
  1533. TypeSize - Supplies a pointer that receives the type size of the given
  1534. data symbol.
  1535. Return Value:
  1536. Returns TRUE on success, or FALSE on failure.
  1537. --*/
  1538. INT
  1539. DbgGetDataSymbolAddress (
  1540. PDEBUGGER_CONTEXT Context,
  1541. PDEBUG_SYMBOLS Symbols,
  1542. PDATA_SYMBOL DataSymbol,
  1543. ULONGLONG DebasedPc,
  1544. PULONGLONG Address
  1545. );
  1546. /*++
  1547. Routine Description:
  1548. This routine returns the memory address of the given data symbol.
  1549. Arguments:
  1550. Context - Supplies a pointer to the application context.
  1551. Symbols - Supplies a pointer to the module symbols.
  1552. DataSymbol - Supplies a pointer to the data symbol whose address is to be
  1553. returned.
  1554. DebasedPc - Supplies the program counter value, assuming the image were
  1555. loaded at its preferred base address (that is, actual PC minus the
  1556. loaded base difference of the module).
  1557. Address - Supplies a pointer where the debased memory address of the symbol
  1558. will be returned. That is, the caller needs to add any loaded base
  1559. difference of the module to this value.
  1560. Return Value:
  1561. 0 on success.
  1562. ENOENT if the data symbol is not currently valid.
  1563. ERANGE if the data symbol is not stored in memory.
  1564. Other error codes on other failures.
  1565. --*/
  1566. INT
  1567. DbgGetDataSymbolData (
  1568. PDEBUGGER_CONTEXT Context,
  1569. PDEBUG_SYMBOLS Symbols,
  1570. PDATA_SYMBOL DataSymbol,
  1571. ULONGLONG DebasedPc,
  1572. PVOID DataStream,
  1573. ULONG DataStreamSize,
  1574. PSTR Location,
  1575. ULONG LocationSize
  1576. );
  1577. /*++
  1578. Routine Description:
  1579. This routine returns the data contained by the given data symbol.
  1580. Arguments:
  1581. Context - Supplies a pointer to the application context.
  1582. Symbols - Supplies a pointer to the module symbols.
  1583. DataSymbol - Supplies a pointer to the data symbol whose data is to be
  1584. retrieved.
  1585. DebasedPc - Supplies the program counter value, assuming the image were
  1586. loaded at its preferred base address (that is, actual PC minus the
  1587. loaded base difference of the module).
  1588. DataStream - Supplies a pointer that receives the data from the data symbol.
  1589. DataStreamSize - Supplies the size of the data stream buffer.
  1590. Location - Supplies an optional pointer where a string describing the
  1591. location of the data symbol will be returned on success.
  1592. LocationSize - Supplies the size of the location in bytes.
  1593. Return Value:
  1594. 0 on success.
  1595. ENOENT if the data symbol is not currently active given the current state
  1596. of the machine.
  1597. Returns an error code on failure.
  1598. --*/
  1599. INT
  1600. DbgPrintDataSymbol (
  1601. PDEBUGGER_CONTEXT Context,
  1602. PDEBUG_SYMBOLS Symbols,
  1603. PDATA_SYMBOL DataSymbol,
  1604. ULONGLONG DebasedPc,
  1605. ULONG SpaceLevel,
  1606. ULONG RecursionDepth
  1607. );
  1608. /*++
  1609. Routine Description:
  1610. This routine prints the location and value of a data symbol.
  1611. Arguments:
  1612. Context - Supplies a pointer to the application context.
  1613. Symbols - Supplies a pointer to the module symbols.
  1614. DataSymbol - Supplies a pointer to the data symbol to print.
  1615. DebasedPc - Supplies the program counter value, assuming the image were
  1616. loaded at its preferred base address (that is, actual PC minus the
  1617. loaded base difference of the module).
  1618. SpaceLevel - Supplies the number of spaces to print after every newline.
  1619. Used for nesting types.
  1620. RecursionDepth - Supplies how many times this should recurse on structure
  1621. members. If 0, only the name of the type is printed.
  1622. Return Value:
  1623. 0 on success.
  1624. ENOENT if the data symbol is not currently active given the current state
  1625. of the machine.
  1626. Returns an error code on failure.
  1627. --*/
  1628. INT
  1629. DbgGetRegister (
  1630. PDEBUGGER_CONTEXT Context,
  1631. PREGISTERS_UNION Registers,
  1632. ULONG RegisterNumber,
  1633. PULONGLONG RegisterValue
  1634. );
  1635. /*++
  1636. Routine Description:
  1637. This routine returns the contents of a register given a debug symbol
  1638. register index.
  1639. Arguments:
  1640. Context - Supplies a pointer to the application context.
  1641. Registers - Supplies a pointer to the current machine context.
  1642. RegisterNumber - Supplies the register index to get.
  1643. RegisterValue - Supplies a pointer where the register value will be
  1644. returned on success.
  1645. Return Value:
  1646. 0 on success.
  1647. EINVAL if the register number is invalid.
  1648. Other error codes on other failures.
  1649. --*/
  1650. INT
  1651. DbgSetRegister (
  1652. PDEBUGGER_CONTEXT Context,
  1653. PREGISTERS_UNION Registers,
  1654. ULONG RegisterNumber,
  1655. ULONGLONG Value
  1656. );
  1657. /*++
  1658. Routine Description:
  1659. This routine sets the contents of a register given its register number.
  1660. Arguments:
  1661. Context - Supplies a pointer to the application context.
  1662. Registers - Supplies a pointer to the current machine context. The register
  1663. value will be set in this context.
  1664. RegisterNumber - Supplies the register index to set.
  1665. Value - Supplies the new value to set.
  1666. Return Value:
  1667. 0 on success.
  1668. EINVAL if the register number is invalid.
  1669. Other error codes on other failures.
  1670. --*/
  1671. INT
  1672. DbgPrintTypeByName (
  1673. PDEBUGGER_CONTEXT Context,
  1674. ULONGLONG Address,
  1675. PSTR TypeName,
  1676. ULONG SpaceLevel,
  1677. ULONG RecursionCount
  1678. );
  1679. /*++
  1680. Routine Description:
  1681. This routine prints a structure or value at a specified address, whose type
  1682. is specified by a string.
  1683. Arguments:
  1684. Context - Supplies a pointer to the application context.
  1685. Address - Supplies a target address pointer where the data resides.
  1686. TypeName - Supplies a pointer to a string containing the type name to get.
  1687. This should start with a type name, and can use dot '.' notation to
  1688. specify field members, and array[] notation to specify dereferences.
  1689. SpaceLevel - Supplies the number of spaces worth of indentation to print
  1690. for subsequent lines.
  1691. RecursionCount - Supplies the number of substructures to recurse into.
  1692. Return Value:
  1693. 0 on success.
  1694. Returns an error number on failure.
  1695. --*/
  1696. INT
  1697. DbgPrintType (
  1698. PDEBUGGER_CONTEXT Context,
  1699. PTYPE_SYMBOL Type,
  1700. PVOID Data,
  1701. UINTN DataSize,
  1702. ULONG SpaceLevel,
  1703. ULONG RecursionCount
  1704. );
  1705. /*++
  1706. Routine Description:
  1707. This routine prints the given type to the debugger console.
  1708. Arguments:
  1709. Context - Supplies a pointer to the application context.
  1710. Type - Supplies a pointer to the data type to print.
  1711. Data - Supplies a pointer to the data contents.
  1712. DataSize - Supplies the size of the data buffer in bytes.
  1713. SpaceLevel - Supplies the number of spaces worth of indentation to print
  1714. for subsequent lines.
  1715. RecursionCount - Supplies the number of substructures to recurse into.
  1716. Return Value:
  1717. 0 on success.
  1718. Returns an error number on failure.
  1719. --*/
  1720. VOID
  1721. DbgPrintStringData (
  1722. PSTR String,
  1723. UINTN Size,
  1724. ULONG SpaceDepth
  1725. );
  1726. /*++
  1727. Routine Description:
  1728. This routine prints string data to the debugger console.
  1729. Arguments:
  1730. String - Supplies a pointer to the string data.
  1731. Size - Supplies the number of bytes to print out.
  1732. SpaceDepth - Supplies the indentation to use when breaking up a string into
  1733. multiple lines.
  1734. Return Value:
  1735. None.
  1736. --*/
  1737. BOOL
  1738. EvalGetRegister (
  1739. PDEBUGGER_CONTEXT Context,
  1740. PCSTR Register,
  1741. PULONGLONG Value
  1742. );
  1743. /*++
  1744. Routine Description:
  1745. This routine gets the value of a register by name.
  1746. Arguments:
  1747. Context - Supplies a pointer to the application context.
  1748. Register - Supplies the name of the register to get.
  1749. Value - Supplies a pointer where the value of the register will be returned.
  1750. Return Value:
  1751. TRUE on success.
  1752. FALSE on failure.
  1753. --*/
  1754. BOOL
  1755. EvalSetRegister (
  1756. PDEBUGGER_CONTEXT Context,
  1757. PCSTR Register,
  1758. ULONGLONG Value
  1759. );
  1760. /*++
  1761. Routine Description:
  1762. This routine sets the value of a register by name.
  1763. Arguments:
  1764. Context - Supplies a pointer to the application context.
  1765. Register - Supplies the name of the register to get.
  1766. Value - Supplies the value to set in the register.
  1767. Return Value:
  1768. TRUE on success.
  1769. FALSE on failure.
  1770. --*/