The current syscalls.c implements getpid/fstat/stat/link/unlink as mere
stubs. So replace them with useful calls to do_syscall now that our sim
can support them.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The sim lseek() syscall in the Blackfin libgloss code did not pass down
the "whence" argument making lseek() in general kind of useless.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
include/ChangeLog:
* filenames.h (HAVE_CASE_INSENSITIVE_FILE_SYSTEM): Define
on Darwin, as well as on the systems that use a DOS-like
filesystem.
libiberty/ChangeLog:
* filename_cmp.c (filename_cmp, filename_ncmp): Add handling of
HAVE_CASE_INSENSITIVE_FILE_SYSTEM.
(fh_calloc): Remove.
(cnew): Redefine to handle NULL returns from cmalloc.
(build_fh_name): Accommodate new definition of cnew. Remove unneeded
test for fh_oom.
(fh_alloc): Ditto.
(fh_calloc): New static function. Add a comment to explain why this
is needed.
(cnew): Call fh_calloc as placement argument.
(build_fh_name): Check return code from cnew against address of
fh_oom to test for out of memory condition.
(fh_alloc): Ditto.
(build_fh_pc): Avoid a crash due to useing a NULL fhandler.
* pipe.cc (fhandler_pipe::create): Check if build_fh_dev returned a
valid pointer before using it.
* dwarf.c (decode_location_expression): For DW_OP_GNU_convert and
DW_OP_GNU_reinterpret, if uvalue is 0, don't add cu_offset.
Handle DW_OP_GNU_parameter_ref.
The sim passes back results via two values, and the error code via a 3rd.
make sure libgloss extracts all three so that things like errno work as
expected. This fixes many gdb tests which look for this sort of thing.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
After testing the hardware with all the different dsp flags, the MM flag
triggers sign extension in all modes. So drop the limited use of it, and
the local custom helper that was also extending unsigned values. We also
can see that the flag checks in the mult/mac insns have the same behavior
with sign extending, so add a helper func to keep the logic the same in
both places.
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Use options member instead.
* fhandler.h (class fhandler_base): Change type of access member to
ACCESS_MASK. Change get_access and set_access methods accordingly.
Add options member. Add get_options and set_options methods.
(class fhandler_disk_file): Add prw_handle.
(fhandler_disk_file::prw_open): Declare.
(fhandler_disk_file::close): Declare.
(fhandler_disk_file::dup): Declare.
(fhandler_disk_file::fixup_after_fork): Declare.
* fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file):
Initialize prw_handle to NULL.
(fhandler_disk_file::close): Close prw_handle.
(fhandler_disk_file::dup): New method.
(fhandler_disk_file::fixup_after_fork): Set prw_handle to NULL since
prw_handle is not inherited.
(fhandler_disk_file::prw_open): New method. Add long comment to
explain current behaviour.
(fhandler_disk_file::pread): Revert previous change. Change to use
prw_handle if possible.
(fhandler_disk_file::pwrite): Change to use prw_handle if possible.
* strace.cc (strace::hello): Drop printing DLL information here since
application info is not always available at this point.
(strace::dll_info): New method to print DLL info.
* include/sys/strace.h (strace::dll_info): Declare.
* devices.h (FH_ERROR): New value.
(iscons_dev): Extend to detect all the console device types.
* devices.in: Set aside storage for FH_ERROR.
* dtable.cc (dtable::init_std_file_from_handle): Use iscons_dev to detect when
device is a console.
(fh_alloc): Pass device to console constructor.
(build_fh_pc): Short circuit when we detect that the constructor saw an error.
* fhandler.h (fhandler_console::fhandler_console): Accept fh_devices parameter.
(get_tty_stuff): Change to void.
* fhandler_console (fhandler_console::set_unit): Set device to FH_ERROR on
attempt to access anything other than the current console.
(fhandler_console::get_tty_stuff): Change to void return.
(fhandler_console::open): Return EPERM on FH_ERROR device type.
(fhandler_console::fhandler_console): Set the device type appropriately before
calling get_tty_stuff and rely on that function to reset it if necessary.