Patch for empty buffer while debbuging

Dimitris Dinodimos <[email protected]> Sat, 8 Sep 2007 00:00:46 +0300
Newsgroups gmane.comp.lang.erlang.distel.devel
Message-ID <[email protected]>
Distel is displaying an empty buffer. Everything else is fine. I can  
see the variables or I can press "c" to continue blindly.
The attached  patch solved the problem for me.

If the patch does not work for you, try to revert the sources to  
revision 34. (svn update -r 34 && make base)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

_______________________________________________
Distel-hackers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/distel-hackers
distel.patch (application/octet-stream, 956 B)
Index: src/distel.erl
===================================================================
--- src/distel.erl	(revision 37)
+++ src/distel.erl	(working copy)
@@ -154,7 +154,8 @@
   Erl = to_list(Mod) ++ ".erl",
   Dir = dirname(BeamFName),
   DotDot = dirname(Dir),
-  try_srcs([src_from_beam(Mod),
+  try_srcs([src_from_beam_file(Mod,BeamFName),
+	    src_from_beam(Mod),
             join([Dir, Erl]),
             join([DotDot, src, Erl]),
             join([DotDot, src, "*", Erl]),
@@ -180,6 +181,18 @@
   catch _:_ -> []
   end.
 
+src_from_beam_file(Mod,BeamFName) ->
+    try beam_lib:chunks(BeamFName,[compile_info]) of
+	{ok,{Mod,[{compile_info,CompileInfo}]}} -> 
+	    try lists:keysearch(source,1,CompileInfo) of
+		false -> [];
+		{_,{_,Src}} -> Src
+	    catch _:_ -> []
+	    end
+    catch _:_ ->
+	    []
+    end.
+
 %% ----------------------------------------------------------------------
 %% Summarise all processes in the system.
 %%