How to debug a C Port driver?
Raimo Niskanen
raimo@REDACTED
Tue Feb 8 08:30:15 CET 2005
Just at tiny hint:
os:getpid() from the erlang shell gives you the ID # of
the emulator process.
fritchie@REDACTED (Scott Lystig Fritchie) writes:
> >>>>> " " == 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
--
/ Raimo Niskanen, Erlang/OTP, Ericsson AB
More information about the erlang-questions
mailing list