User Tools

Site Tools


mbbsemu:development:module_debugging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mbbsemu:development:module_debugging [2020/11/14 21:02] tudaymbbsemu:development:module_debugging [2023/10/06 23:41] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Module Debugging Walkthrough ======
 <markdown> <markdown>
 On this Wiki Article we'll dive into the topic of debugging a MajorBBS/Worldgroup module, showing how MBBSEmu is setup to assist with debugging not just at an API level but within the emulated x86 Core. On this Wiki Article we'll dive into the topic of debugging a MajorBBS/Worldgroup module, showing how MBBSEmu is setup to assist with debugging not just at an API level but within the emulated x86 Core.
Line 4: Line 5:
 This tutorial assumes you should have a basic understanding of x86 Assembly and C# This tutorial assumes you should have a basic understanding of x86 Assembly and C#
  
-# Tools+## Tools
  
 While the tutorial on this page is fairly basic and will only use a couple of the tools listed, to be able to fully debug and work with modules in MBBSEmu, an exhaustive list of tools is provided below: While the tutorial on this page is fairly basic and will only use a couple of the tools listed, to be able to fully debug and work with modules in MBBSEmu, an exhaustive list of tools is provided below:
Line 19: Line 20:
     * `Wireshark` ([Link](https://www.wireshark.org/)) - Helpful for intercepting and analyzing data sent between MBBSEmu and a Telnet/Rlogin client     * `Wireshark` ([Link](https://www.wireshark.org/)) - Helpful for intercepting and analyzing data sent between MBBSEmu and a Telnet/Rlogin client
  
-# Exercise+## Exercise
  
 For tutorial we're going to be taking a look at the Character Interceptor Routine registered by `GSBL->btuchi()` by Tournament LORD for MajorBBS (`RTSLORD`). We'll demonstrate how to set breakpoints within MBBSEmu to capture where different events are being fired as well as how to analyze the x86 Assembly as it goes through the MBBSEmu x86 Emulator. For tutorial we're going to be taking a look at the Character Interceptor Routine registered by `GSBL->btuchi()` by Tournament LORD for MajorBBS (`RTSLORD`). We'll demonstrate how to set breakpoints within MBBSEmu to capture where different events are being fired as well as how to analyze the x86 Assembly as it goes through the MBBSEmu x86 Emulator.
  
-# Starting+## Starting
  
 The majority of Debug messaging within MBBSEmu is wrapped in a `#if DEBUG` preprocessor directive. This is done to maximize the performance of MBBSEmu when compiled in `Release` configuration. In order to be able to debug MBBSEmu, you must run it in `Debug` configuration to see all available debug messages. The majority of Debug messaging within MBBSEmu is wrapped in a `#if DEBUG` preprocessor directive. This is done to maximize the performance of MBBSEmu when compiled in `Release` configuration. In order to be able to debug MBBSEmu, you must run it in `Debug` configuration to see all available debug messages.
Line 49: Line 50:
 The routine being registered to `GSBL.btuchi()` is `0002:1409`, so let's start taking a look at how that works. The routine being registered to `GSBL.btuchi()` is `0002:1409`, so let's start taking a look at how that works.
  
-# Capturing Debug+## Capturing Debug
  
 We'll want to setup debugging within the x86 Emulator to output not only the decoded x86 Assembly but also the Register values.  We'll want to setup debugging within the x86 Emulator to output not only the decoded x86 Assembly but also the Register values. 
Line 67: Line 68:
 {{:mbbsemu:development:module_debugging:md.cd3.png?nolink|}} {{:mbbsemu:development:module_debugging:md.cd3.png?nolink|}}
 <markdown> <markdown>
-# Analyzing Debug+## Analyzing Debug
  
 After starting the module and entering it, after the first screen where the `btuchi()` function is registered, we'll hit `ENTER` and our breakpoint in `CpuCore.Tick()` will be hit. After starting the module and entering it, after the first screen where the `btuchi()` function is registered, we'll hit `ENTER` and our breakpoint in `CpuCore.Tick()` will be hit.
Line 240: Line 241:
 ``` ```
  
-# Result+## Result
  
 The result from the registered `btuchi()` function in LORD is: The result from the registered `btuchi()` function in LORD is:
mbbsemu/development/module_debugging.1605387768.txt · Last modified: 2023/10/06 23:40 (external edit)