2 # Generate illumos data files describing system calls and structures
4 CW
=/opt
/onbld
/bin
/i386
/cw
5 GENOFFSETS
=/opt
/onbld
/bin
/genoffsets
6 TMPDIR
=${COMPONENT_DIR}/tmp
7 CTFSTABS
=/opt
/onbld
/bin
/i386
/ctfstabs
8 CTFCONVERT
=/opt
/onbld
/bin
/i386
/ctfconvert
9 GENOFFSETS_CFLAGS
="-gdwarf-2 -_gcc=-fno-eliminate-unused-debug-symbols -_gcc=-fno-eliminate-unused-debug-types"
10 EGREP
=/usr
/gnu
/bin
/egrep
11 GCC
=/usr
/gcc
/${GCC_VERSION}/bin
/gcc
22 <!DOCTYPE feature SYSTEM "gdb-syscalls.dtd">
25 $EGREP $
'^#define\tSYS_.*[0-9]$' /usr
/include
/sys
/syscall.h \
26 |
while read _ call num
; do
27 printf ' <syscall name="%s" number="%d"/>\n' \
31 echo "</syscalls_info>"
32 } > $TMPDIR/syscalls.xml
33 echo $TMPDIR/syscalls.xml
34 for arch
in i386 amd64
; do
35 cp ${TMPDIR}/syscalls.xml \
36 ${SOURCE_DIR}/gdb
/syscalls
/$arch-illumos.xml \
37 ||
echo "Could not install $arch system call table"
42 $GENOFFSETS -s $CTFSTABS -r $CTFCONVERT \
43 $CW --primary gcc
,${GCC},gnu
--noecho -- \
44 $GENOFFSETS_CFLAGS ${!flags} \
45 < ${COMPONENT_DIR}/Solaris
/offsets.
in > $TMPDIR/offsets
$bits.h
48 sed < $TMPDIR/offsets32.h
's/\t0x/_32&/'
49 sed < $TMPDIR/offsets64.h
's/\t0x/_64&/'
50 $EGREP $
'define\tPR(FN|ARG)SZ' /usr
/include
/sys
/old_procfs.h
51 } |
tee illumos-offsets.h
> ${SOURCE_DIR}/bfd
/illumos-offsets.h
55 [ ! -d ${TMPDIR} ] && mkdir
${TMPDIR}