From a251ad7488c6a1268c4aca0f1937cc397f663325 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 10 Mar 2010 12:57:00 +0000 Subject: cerl: Work around missing source frame in when running gdb in emacs This problems occurs in some recent versions of Emacs. --- erts/etc/unix/cerl.src | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src index f81ef6b0fe..9dab9fcfcc 100644 --- a/erts/etc/unix/cerl.src +++ b/erts/etc/unix/cerl.src @@ -1,20 +1,20 @@ #!/bin/sh # # %CopyrightBegin% -# -# Copyright Ericsson AB 2003-2009. All Rights Reserved. -# +# +# Copyright Ericsson AB 2003-2010. All Rights Reserved. +# # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved online at http://www.erlang.org/. -# +# # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. -# +# # %CopyrightEnd% # # @@ -277,6 +277,16 @@ else ;; esac + # 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)" + fi gdbcmd="$gdbcmd $GDBBP \ (insert-string \"source $ROOTDIR/erts/etc/unix/etp-commands\") \ (comint-send-input)" -- cgit v1.2.3