7.4 EuDis - Disassembling Euphoria code

7.4.1 Introduction

In the Euphoria source directory is a program named dis.ex, which can be used for parsing Euphoria code and outputting detailed disassembly of the intermediate language (i.e., byte code) used by Euphoria, as well as the symbol table. The purpose of this tool is for low level debugging, especially for developing Euphoria itself, or for understanding why certain code performs the way it does.

It uses the actual Euphoria front end to parse your code. When Euphoria is installed, there should be a shell script or batch file (depending on your operating system) called eudis or eudis.bat, respectively, that can be used to analyze your code:

$ eudis myapp.ex
saved to [/path/to/myapp.ex.dis]

When run, eudis will say where its output was saved. The file name, including extension, is used as the base for its output. By default, it outputs four files:

  • .dis The main disassembly file. This shows the IL code representation both raw and symbolically.
  • .sym The symbol table. This shows details for the entire symbol table for your code.
  • .hash Details about symbol hashing.
  • .line Line table information. Unless tracing is enabled, this will be blank.

7.4.2 HTML Output

eudis can output html documentation of your program somewhat similar to the output from Doxygen. This documentation is different than eudoc. It is meant to document the structure of your program, and to help developers understand code dependencies. It can generate graphs showing how files include each other, as well as which routines call which others. Note that generating graphs requires that you have Graphviz installed. Note that generating call graphs can be quite time consuming for a large program.

By default, eudis will create a subdirectory in the current directory called eudox. This may be changed using the --dir option.

7.4.2.1 Command Line Switches

You can use the standard -i and -c switches with eudis. There are additional options:

  • -b parse the code as though it were being bound
  • --dir <dir> Specify the output directory for the html files
  • -f include a particular file in the html output
  • output the list of files included in the .dis file at the top of the listing
  • -g suppress call graphs in html output
  • --html generate html documentation of your program
  • Suppress dependencies. Will not generate file and routine dependency graphs.
  • --std show standard library information, by default this is not shown
  • -t parse the code as though it were being translated