# btraceback.dbx

dbxenv language_mode c++

echo "exename ==> \c"; print -l (char *)exename
echo "exepath ==> \c"; print -l (char *)exepath
echo "catalog_db ==> \c"; print -l (char *)catalog_db
echo "version ==> \c"; print -l (char *)version
echo "host_os ==> \c"; print -l (char *)host_os
echo "distname ==> \c"; print -l (char *)distname
echo "distver ==> \c"; print -l (char *)distver
echo "dist_name ==> \c"; print -l (char *)dist_name
echo "beef ==> \c"; print -l (int)beef

echo "******** RUNNING THREADS/LWPS:"
echo
lwps

echo
echo
echo "******** STACK TRACE OF CURRENT THREAD/LWP:"
echo
where

echo
echo
echo "******** VARIABLES DUMP OF CURRENT THREAD/LWP:"
echo
dump

for LWP in $(lwps | sh sed -e 's/.*@//' -e 's/ .*//'); do
(
   if lwp l@$LWP; then
      echo "******************************************"
      echo
      echo "******** STACK TRACE OF THREAD/LWP ${LWP}:"
      echo
      where

      echo
      echo "******** VARIABLES DUMP OF THREAD/LWP ${LWP}:"
      echo
      dump
      echo "******************************************"
   fi
)
done
quit
