Debugging

Debugging Euphoria with gdb

This page is a work in progress. Any helpful additions are appreciated, and the page can be cleaned up for formatting later.


  • Make sure you have compiled with debugging symbols: ./configure --debug before make. It also helps to set --prefix to some testing location that you can install to.
  • Make sure you have a short test file to interpret, bind, or translate to help narrow down your bug. Smaller is better.
  • Try debugging your code in Euphoria first. Trace your code with the built-in Euphoria debugger. Check the output of the Euphoria disassembler and make sure the IL code is correct.
  • In gdb, use the following command to print the value of Euphoria objects:

(gdb) print StdPrint( 1, _some_eu_object_12345, 1 ) 
3735928549 
$1 = void 
(gdb) print/x 3735928549 
$2 = 0xdeadbee5 

  • To do: Add a function in be_runtime.c that allows a gdb user to display information about a Euphoria object and use it in an expression as a value.

Some helpful gdb links:

Peter's gdb tutorial
Debugging with gdb On Apple's site, but not OS X-centric.

gdb cheat sheets:

http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf
http://www.cs.berkeley.edu/mavam/teaching/cs161-sp11/gdb-refcard.pdf
http://cs.brown.edu/courses/cs033/docs/gdb.pdf

Search



Quick Links

User menu

Not signed in.

Misc Menu