How to debug a C Port driver?

Casper casper2000a@REDACTED
Tue Feb 8 07:14:57 CET 2005


Hi Scott,

Thanks for your advice. It helped me to identify the problem.

- Eranga





-----Original Message-----
From: Scott Lystig Fritchie [mailto:fritchie@REDACTED] 
Sent: Tuesday, February 08, 2005 11:58 AM
To: Casper
Cc: erlang-questions@REDACTED
Subject: Re: How to debug a C Port driver? 

>>>>> " " == Casper  <casper2000a@REDACTED> 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