summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--erts/emulator/beam/erl_bif_info.c11
-rw-r--r--erts/etc/unix/cerl.src21
2 files changed, 18 insertions, 14 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index 0a7d151d96..636b7c07d1 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -1439,10 +1439,15 @@ process_info_aux(Process *c_p,
break;
case ERTS_PI_IX_STATUS: {
- erts_aint32_t state = erts_atomic32_read_nob(&rp->state);
+ erts_aint32_t state;
+ if (!rp_locks)
+ state = erts_atomic32_read_mb(&rp->state);
+ else
+ state = erts_atomic32_read_nob(&rp->state);
res = erts_process_state2status(state);
- if (res == am_running && (state & ERTS_PSFLG_RUNNING_SYS)) {
- ASSERT(c_p == rp);
+ if (res == am_running
+ && c_p == rp
+ && (state & ERTS_PSFLG_RUNNING_SYS)) {
ASSERT(flags & ERTS_PI_FLAG_REQUEST_FOR_OTHER);
if (!(state & (ERTS_PSFLG_ACTIVE
| ERTS_PSFLG_SIG_Q
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index faf54e2bdc..a48efc01e6 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -453,18 +453,15 @@ elif [ "x$GDB" = "xegdb" ]; then
case "x$core" in
x)
# Get emu args to use from erlexec...
- beam_args=`$EXEC -emu_args_exit ${1+"$@"} | tr '\n' ' '`
- gdbcmd="(insert-string \"set args $beam_args\") \
- (comint-send-input)"
+ beam_args=`$EXEC -emu_args_exit $xargs ${1+"$@"} | sed 's/"/\\\\"/g' | tr '\n' ' '`
+ gdbcmd="set args $beam_args"
;;
x/*)
- gdbcmd="(insert-string \"core ${core}\") (comint-send-input)"
+ gdbcmd="core $core"
GDBBP=
;;
*)
- dir=`pwd`
- gdbcmd="(insert-string \"core ${dir}/${core}\") \
- (comint-send-input)"
+ gdbcmd="core `pwd`/$core"
GDBBP=
;;
esac
@@ -483,11 +480,13 @@ elif [ "x$GDB" = "xegdb" ]; then
GDBARGS="--annotate=1 "
fi
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 $GDBARGS$EMU_NAME\") $gdbcmd)"
+ cmdfile="/tmp/.cerlgdb.$$"
+ echo "file $BINDIR/$EMU_NAME" > $cmdfile
+ echo "$gdbcmd" >> $cmdfile
+ echo "source $ROOTDIR/erts/etc/unix/etp-commands" >> $cmdfile
+ EVAL="(progn (gdb \"gdb $GDBARGS -x $cmdfile\"))"
+ exec $EMACS --eval "$EVAL"
elif [ "x$GDB" = "xdump" ]; then
cmdfile="/tmp/.cerlgdb.$$"
## Examine the result of "file $core" in case it is not the emulator