How to debug a C Port driver?

Scott Lystig Fritchie <>
Tue Feb 8 06:58:23 CET 2005


>>>>> " " == Casper  <> writes:

> How can I debug a C port driver? Can use "gdb" for that?

It's been quite a while since I've done it, but this is what memory
tells me.

1. Run "erl" plus any extra flags.

2. Trigger loading of your shared library, using whatever function
that eventually calls erl_ddll:load_driver().

3. Use "ps" to find process ID # of the "beam" process.

4. Use gdb's "attach" command to attach to the beam PID.

5. Set breakpoints and/or watchpoints.

6. At the Erlang shell command line, call an Erlang function that will
trigger your break/watch points.

-Scott



More information about the erlang-questions mailing list