From ba7c2beca25735327366ad7eac31bbd3a4898395 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Thu, 7 Oct 2010 11:48:46 +0200 Subject: Incorporate Michael Santos patch for cerl and gdb via emacs Michael Santos supplied a very nice patch that did set the annotation level correctly for gdb when run from cerl in emacs. The patch adds --annotate=3 to the gdb command line, which makes emacs parse the gdb output correctly, making the right source code be loaded in the emacs buffer. While integrating it, I removed my faulty code trying to do the same with hacky elisp commands. Michaels way is the right way to do it. Thanks! --- erts/etc/unix/cerl.src | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src index 9dab9fcfcc..73b1bafbe0 100644 --- a/erts/etc/unix/cerl.src +++ b/erts/etc/unix/cerl.src @@ -66,6 +66,7 @@ core= GDB= GDBBP= +GDBARGS= TYPE= EMU_TYPE= debug= @@ -280,16 +281,11 @@ else # Set annotation level for gdb in emacs 22 and higher. emacs_major=`$EMACS --version | head -1 | sed 's,^[^0-9]*\([0-9]*\).*,\1,g'` if [ '!' -z "$emacs_major" -a $emacs_major -gt 21 ]; then - # Hack - wait for etp-commands to be loaded and then set - # annotation level, could be done more beautifully than with sit-for... - gdbcmd="$gdbcmd \ - (sit-for 1) \ - (insert-string \"set annotate 3\") \ - (comint-send-input)" + GDBARGS="--annotate=3 " fi gdbcmd="$gdbcmd $GDBBP \ (insert-string \"source $ROOTDIR/erts/etc/unix/etp-commands\") \ (comint-send-input)" # Fire up gdb in emacs... - exec $EMACS --eval "(progn (gdb \"gdb $EMU\") $gdbcmd)" + exec $EMACS --eval "(progn (gdb \"gdb $GDBARGS$EMU\") $gdbcmd)" fi -- cgit v1.2.3