Mail Archives: djgpp-workers/2004/04/15/11:22:02
--Boundary-00=_7iqfAlO3AwhmPz+
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
GDB-6.1 seems to build and work Ok for DJGPP as far as I tested (really not
very much). I used GCC snapshot from CVS (GCC-3.4.0 20040401),
djdev204 beta 1, etc. Tests done under Windows XP.
Some changes were needed for bfdsymify.c (against source from gdb53s.zip).
Diffs and my script for building GDB are attached
Andris
--Boundary-00=_7iqfAlO3AwhmPz+
Content-Type: text/x-diff;
charset="us-ascii";
name="bfdsymify.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="bfdsymify.c.diff"
--- bfdsymify.c~1 2002-08-15 11:21:00.000000000 +0000
+++ bfdsymify.c 2004-04-11 09:17:08.000000000 +0000
@@ -4,10 +4,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdbool.h>
#include <unistd.h>
#include <pc.h>
#include "bfd.h"
+#include "bfdver.h"
#include "getopt.h"
#include "libiberty.h"
#include "demangle.h"
@@ -111,7 +113,7 @@
const asymbol *b = *(const asymbol **)bp;
const char *an, *bn;
size_t anl, bnl;
- boolean af, bf;
+ bool af, bf;
flagword aflags, bflags;
if (bfd_asymbol_value (a) > bfd_asymbol_value (b))
@@ -524,7 +526,8 @@
if (argc < 2)
{
fprintf(stderr,
- "BFDSymify Version 1.2, 2002-02-24 (BFD version 2.11.90)\n");
+ "BFDSymify Version 1.2, 2002-02-24 (BFD version %s)\n",
+ BFD_VERSION_STRING);
fprintf(stderr,
"Add source file information to a DJGPP program's call-frame traceback\n\n");
fprintf(stderr, "Usage: bfdsymify [-o <outfile>] [-i <corefile>] <program>\n");
--Boundary-00=_7iqfAlO3AwhmPz+
Content-Type: application/x-shellscript;
name="build.gdb"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="build.gdb"
#! /bin/sh
# Building GDB-6.1 for DJGPP
#
VERSION=6.1
EXTRA_VER_INFO=
CURR=`pwd`
DVER=`echo $VERSION | sed 's:\.::2g'`
DVER0=`echo $VERSION | sed 's:\.::g'`
src=$CURR/gnu/gdb-$DVER
inst=$CURR/install.gdb
unpack_sources () {
archive=
for arc_ext in tgz tar.gz tar.bz2 ; do
if [ -f gdb-$VERSION.$arc_ext ] ; then
archive=gdb-$VERSION.$arc_ext
fi
done
if [ -z $archive ] ; then
echo "Source archive of gdb-$VERSION is not found"
exit 1
fi
djtar -x -p -o gdb-$VERSION/gdb/config/djgpp/fnchange.lst $archive >fnchange.tmp
sed -e "s,@V@,gdb-$VERSION,g" < fnchange.tmp > fnchange.lst
grep -q gdb fnchange.lst || exit 1
djtar -x -n fnchange.lst $archive || exit
cp -rv bfdsymify gdb-$VERSION
rm fnchange.tmp fnchange.lst
}
create_source_archive ()
{
test -d gnu/gdb-$DVER && rm -rf gnu/gdb-$DVER
test -d gnu || mkdir gnu
mv -v gdb-$VERSION gnu/gdb-$DVER || exit 1
cd gnu/gdb-$DVER || exit 1
gdb/config/djgpp/djconfig.sh || exit 1
cd $CURR || exit 1
rm -rf manifest/gdb${DVER0}s.*
mkdir manifest
echo "gdb$DVER0.zip - gdb-$VERSION $EXTRA_VER_INFO (source archive for DJGPP)" >manifest/gdb${DVER0}s.ver
echo "" >manifest/gdb${DVER0}s.mft
( find gnu/gdb-$DVER -type f ; find manifest -name gdb${DVER0}s'.*' ) |\
sort >manifest/gdb${DVER0}s.mft
cat manifest/gdb${DVER0}s.mft | zip -9@ gdb${DVER0}s.zip
}
setup_env () {
export TEST_FINDS_EXE=Y
# PATH_SEPARATOR=: causes problems.
#export PATH_SEPARATOR=:
top=`( cd $src && pwd ) | sed -e 's/^[a-zA-Z]:\//\//g' -e 's/^\/dev\/[a-zA-Z]\//\//g'`
target=i586-pc-msdosdjgpp
export AS=as
export CC=gcc
export ac_cv_func_mmap_dev_zero=no
export lt_cv_sys_max_cmd_len=12000
export ac_cv_prog_LN='cp -p'
export ac_cv_prog_LN_S="cp -p"
export ac_setrlimit=no
CONFIG_SHELL=`/bin/sh -c 'echo $0'`
case $CONFIG_SHELL in *.exe) ;; *) CONFIG_SHELL=$CONFIG_SHELL.exe ;; esac
export CONFIG_SHELL
}
build_gdb () {
result=false
cd $src || exit 1
make SHELL=$CONFIG_SHELL LN_S='cp -p' && result=true
make -C bfdsymify || exit 1
cd $CURR
$result
}
install_temp () {
cd $CURR
rm -rf install.gdb
cd $src || exit 1
make SHELL=$CONFIG_SHELL LN_S='cp -p' prefix=$inst install || exit 1
cd $inst || exit 1
for d in bfd gdb libiberty mmalloc opcodes readline bfdsymify .; do
for f in README COPYING TODO NEWS PROBLEMS CONTRIBUTE MAINTAINERS; do
if [ -f $src/$d/$f ] ; then
if ! [ -d gnu/gdb-$DVER/$d ] ; then
mkdir -p gnu/gdb-$DVER/$d
fi
cp -v $src/$d/$f gnu/gdb-$DVER/$d/
fi
done
done
cp -v $src/gdb/config/djgpp/readme gnu/gdb-$DVER/README.DJGPP
mkdir gnu/gdb-$DVER/bfdsymify
cp -v $src/bfdsymify/bfdsymify.exe bin/
cp -v $src/bfdsymify/readme gnu/gdb-$DVER/bfdsymify/
rm info/dir
for file in info/*.info; do
echo $file
cat $file | \
awk 'substr($0,1,9)=="Indirect:" { active=1; } \
substr($0,1,10)=="Tag Table:" { active=0; } \
{ if (active) gsub("info-","i"); \
print $0 }' > $file.new
mv -fv $file.new $file
f0=`basename $file`
for x in `find info -name $f0-'*'`; do
mv -v $x `echo $x | sed 's:\.info-:.i:'`
done
done
echo "Converting man pages ..."
for x in `find man -type f -and -name '*.[1-9]*'`; do
case $x in
man/man*)
echo `basename $x`
x1=`echo $x | sed -e 's,^man/,,g'`
c1=`echo $x1 | sed -e 's,man\([1-9]\)/,cat\1/,g'`
ginstall -d man/`dirname $c1`
( cd man && groff -man -Tascii $x1 >$c1 )
;;
esac
done
for file in bin/*.exe; do
strip $file
done
for file in lib/*.a; do
strip -g $file
done
mkdir manifest
echo "gdb${DVER0}a.zip - gdb-$VERSION $EXTRA_VER_INFO (extra binary archive for DJGPP)" >manifest/gdb${DVER0}a.ver
echo "gdb${DVER0}b.zip - gdb-$VERSION $EXTRA_VER_INFO (binary archive for DJGPP)" >manifest/gdb${DVER0}b.ver
echo "" >manifest/gdb${DVER0}a.mft
echo "" >manifest/gdb${DVER0}b.mft
dgba=
gdbb=
skipped=
files=`find . -type f | sed 's:^\./::' | sort`
for x in $files; do
case $x in
man/man*/*) skipped="$skipped $x" ;;
*/bfd/* | */opcodes/* | */libiberty/* ) gdba="$gdba $x" ;;
*/readline/* | */mmalloc/*) gdba="$gdba $x" ;;
*/gdb.* | bin/bfdsymify.exe | */gdb/* | manifest/gdb*b.* ) gdbb="$gdbb $x" ;;
info/annotate.* | info/gdbint.* | info/stabs.* ) gdbb="$gdbb $x" ;;
info/configure.* | info/mmalloc.* | info/standards.* ) gdba="$gdba $x" ;;
gnu/gdb*/*) gdbb="$gdbb $x" ;;
*.h | *.a | *.la | */bfd* | manifest/gdb*a.* ) gdba="$gdba $x" ;;
*) skipped="$skipped $x" ;;
esac
done
rm manifest/gdb${DVER0}a.mft
rm manifest/gdb${DVER0}b.mft
rm -f $CURR/skipped
for x in $gdbb ; do
echo $x >>manifest/gdb${DVER0}b.mft
done
for x in $gdba ; do
echo $x >>manifest/gdb${DVER0}a.mft
done
for x in $skipped ; do
echo $x >>$CURR/skipped
done
for x in a b ; do
rm -f $CURR/gdb$DVER0$x.zip
cat manifest/gdb$DVER0$x.mft | zip -9@ $CURR/gdb$DVER0$x.zip
done
}
unpack_sources
create_source_archive
setup_env
build_gdb || exit 1
install_temp || exit 1
--Boundary-00=_7iqfAlO3AwhmPz+--
- Raw text -