When submitting sim/cris: other sim improvements before or after?

Hans-Peter Nilsson hans-peter.nilsson@axis.com
Mon Nov 8 20:54:00 GMT 2004


Hi.

I'm in the progress of updating a local CGEN-based sim port for
CRIS and CRISv32 (a mostly-incompatible improved pipelined
variant) for submission to gdb.  The sim port aims to be useful
for GCC regression testing as well as debugging of GNU/Linux
statically linked binaries (lots of syscalls supported), but may
lack in integration with gdb.  (That is, I'm totally clueless as
to what is needed in that area.)

I'd also like to submit two additional features:

- New option --file-path-prefix=/where/ever.  Prefix all
syscalls with the supplied path and chdir to there upon program
start.  Chroot your simulated programs!  (Half-baked that is;
there's still a "..".)  Changes are mostly in
sim/common/callback.c, to all syscalls taking filename
arguments.

- Pipe support.  Well, not full support, just enough that it has
been successfully used to emulate the glibc non-nptl
linuxthreads (well-behaved pipe usage) and do some performance
analysis on a reasonably large application using pthreads.  To
make any use of pipes, CPU-specific support to keep track of
different CPU contexts is needed (but only one memory space of
course).  Changes are in sim/common/callback.c for all syscalls
that have anything to do with file descriptors and a few extra
fields in include/gdb/callback.h.

Some other changes worth noting:

- Syscall for lstat.

- Missing CB_SYS_rename case in common/syscall.c (though the
common/callback.c case is already in place).

- Ten more struct stat st_* fields supported in
cb_host_to_target_stat (just using the existing strncmp/store
machinery with no further host<->target mapping).

I'd like to submit these features before the actual CRIS port,
because that'd simplify my work.  There's also a ~500k
port-specific testsuite, both C tests (mostly to exercise
syscalls in a sane fashion) and assembler tests for the actual
CPU parts.  I'll accept responsibility as maintainer for this
sim port.  Copyright assignment papers for GDB are in place,
company-wide for Axis Communications.


Does the file-path-prefix and the pipe support sound acceptable?

Would you (as I) prefer to deal with the new features and
bug-fixes etc. before the actual port?

brgds, H-P



More information about the Gdb mailing list