MLD Command Line Interface with Deos

From DDCIDeos
Jump to navigationJump to search

Overview

This document describes how to launch and interact with the MLD from the command-line in order to debug a Deos application.

Tips & Tricks for Connecting

This section assumes you are a savvy Deos debugger user (i.e., you know about debugServicesHonroed, the GDB Server process, InetD, etc.) and have everything ready on the target for debugging your Deos application.

First you must created a file that contains the "Deos Load List" in -kernelFile style; for example:

  :
 -kernelFile=libansi.so,C:\DDC-I\desk\x86\appbin\libansi.so
 -kernelFile=hello-world.exe,C:\OpenArbor\Workspace\hello-world\output\i686\production\hello-world.exe
  :

The easiest way to create this file is by Launching the Debugger wo/ GUI Connection. Refer to the OpenArbor in Test Mode Tips/Tricks section for more details.

Next you must establish a socket connection to the GDB Server running on the Deos target. This is accomplished with the following commands:

x86 Targets

First command:

 C:\DDC-I\Python24/python.exe C:\DDC-I\desk/desk-environment.py --redirectStdError "--execute=C:\DDC-I\desk/bin/tardebug.py -target=x86 -debugger=mld_80x86.exe -targetIPPort=1028 -quiet -startDbgProcessOnly -targetIPAddr=192.168.18.100 -processHandle=0x170001" 

Warning: It is highly likely that you will need to change the -targetIPAddr as well as the -processHandle in the above. and you may need to change some paths.

The above will establish a socket connection with the GDB Server on the Deos target, thereby suspending (if necessary) your process for debugging. It will also return the socket identifier to standard out (i.e., the only command-line output of the above).

Second Command:

 C:\DDC-I\TRAC\80x86\bin\mld_80x86.exe -deos -deos_load_list C:\tmp\myLoadList.tmp -object_file C:\OpenArbor\Workspace\hello-world\output\i686\production\hello-world.exe -ethernet_addr 192.168.18.100 -port <socket ID>

Warning: It is highly likely that you will need to change the -object_file and -ethernet_addr in/from the above and you may need to change some paths. Furthermore, you will need to use the socket ID returned from the first command for -port. Finally, you will need to use the -deos_load_list file created earlier.

After the above you should find yourself at the MLD command prompt, attached to the Deos application/process of interest.

PPC Targets

TBD

OpenArbor in Test Mode Tips/Tricks

Placing OpenArbor in "test mode" is optional, but is very useful for diagnostic purposes (e.g., if you wish to debug a debugger problem).

  • Create a copy of your OA short-cut
  • Rename the created copy to something like: openArbor_v3.4.0_Test
  • Edit the copy to include the -testddci switch, for example:
C:\DDC-I\OpenArbor\openArbor_v3.4.0\OpenArbor.exe -testddci
  • Use the Test version of the short-cut whenever you wish to use "test mode"

Debug Log File

OpenArbor keeps a log in the workspace's .metadata folder that tracks all communication between the OpenArbor components and the MLD. This file is named: scoremessages_<name of project to debug>.log. This file is appended to, so it can contain multiple debug sessions from (potentially) multiple OA invocations (i.e., delete it if you want to capture something specific).

The log file is written from OpenArbor's perspective so, when you see the phrase: "Sending Message to target" or the phrase "Received message from target" the "target" refers to the MLD. In other words, it would be more accurate to say: sending/receiving to/from the MLD as the communication between the MLD and the actual target hardware is not captured in this log file.

The "MLD Parser" is some code (a plug-in?) that is involved in processing the data sent/received between OA and the MLD (obviously, I know little that can be infered by its name). When looking at the exchange of information, one will see the "MLD parser" involved (i.e., it could be a source of error).

Launching the Debugger wo/ GUI Connection

When in test mode, you can launch the debugger on a Deos process as usual. However, in this mode the GUI will:

  • Create the -deos_load_list
  • Establish the socket connection to the GDB Server (i.e., the first command)
  • and Provide a yes/no dialog that displays the command it is about to use

Unfortunately, the displayed command, which will connect up the GUI and MLD to GDB, can not be selected for cut-n-paste editing. Further note that the displayed command contains too many switches if you wish to use the command-line. Everything after and including the -guipc switch should be removed.

The above steps will create the file you need for the -deos_load_list and will establish the socket connection (refer to the -port switch in the displayed dialog). So, it is useful for those purposes. It is recommended that you move the -deos_load_list file to an easier path/name as it will not change for a given configuration.

At this point you will want to "just say no" to the dialog and launch the MLD from a Desk command prompt, passing in the socket ID (i.e., the second command).