* Makefile.in (CLIBS): Put LIBIBERTY last.

* gdbtk.c (gdbtk_wait gdbtk_init):  Portability improvements for
	SIGIO handling.
This commit is contained in:
Stu Grossman 1994-12-24 00:32:14 +00:00
parent ee6e208776
commit 736a82e724
3 changed files with 49 additions and 39 deletions

View File

@ -1,3 +1,9 @@
Fri Dec 23 16:18:50 1994 Stu Grossman (grossman@cygnus.com)
* Makefile.in (CLIBS): Put LIBIBERTY last.
* gdbtk.c (gdbtk_wait gdbtk_init): Portability improvements for
SIGIO handling.
Thu Dec 22 09:27:16 1994 Jim Kingdon <kingdon@deneb.cygnus.com>
* ser-tcp.c (tcp_open): Cast to struct sockaddr when passing to

View File

@ -185,8 +185,8 @@ REGEX1 = regex.o
INSTALLED_LIBS=-lbfd -lreadline $(TERMCAP) -lopcodes -lmmalloc \
-liberty $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(ENABLE_CLIBS)
CLIBS = $(BFD) $(READLINE) $(OPCODES) $(MMALLOC) \
$(LIBIBERTY) $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) \
$(ENABLE_CLIBS)
$(ENABLE_CLIBS) $(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) \
$(LIBIBERTY)
CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(BFD) $(READLINE) $(OPCODES) \
$(MMALLOC) $(LIBIBERTY)
@ -519,7 +519,14 @@ install-only:
@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
uninstall: force
rm -f $(bindir)/gdb $(man1dir)/gdb.1
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "s/brokensed/brokensed/" $$t` ; \
if test "x$$transformed_name" = x; then \
transformed_name=gdb ; \
else \
true ; \
fi ; \
rm -f $(bindir)/$$transformed_name $(man1dir)/$$transformed_name.1
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
# We do this by grepping through sources. If that turns out to be too slow,
@ -855,14 +862,6 @@ MAKEOVERRIDES=
## with no dependencies and no actions.
unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
# These are things from config/*/*.m? fragments. There is no good reason
# why they are separate from the lists of files above.
HPREAD_SOURCE=
# start-sanitize-hpread
HPREAD_SOURCE=hpread.c
# end-sanitize-hpread
ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
29k-share/udi/udi2go32.c \
a29k-pinsn.c a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
@ -873,6 +872,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \
go32-xdep.c gould-pinsn.c gould-xdep.c h8300-tdep.c h8500-tdep.c \
hp300ux-nat.c hppa-pinsn.c hppa-tdep.c hppab-nat.c hppah-nat.c \
hpread.c \
i386-pinsn.c i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c \
i386aix-nat.c i386m3-nat.c i386v4-nat.c i386ly-tdep.c \
i387-tdep.c \
@ -1271,10 +1271,8 @@ somread.o: somread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
somsolib.o: somsolib.c $(defs_h)
# start-sanitize-hpread
hpread.o: hpread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
gdb-stabs.h objfiles.h symfile.h $(symtab_h)
# end-sanitize-hpread
parse.o: parse.c $(command_h) $(defs_h) $(expression_h) $(frame_h) \
$(gdbtypes_h) language.h parser-defs.h $(symtab_h) $(value_h)

View File

@ -33,10 +33,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <unistd.h>
#include <setjmp.h>
#include "top.h"
#ifndef FASYNC
#include <sys/ioctl.h>
#include <string.h>
#ifndef FIOASYNC
#include <sys/stropts.h>
#endif
#include <string.h>
/* Non-zero means that we're doing the gdbtk interface. */
int gdbtk = 0;
@ -718,28 +720,23 @@ gdbtk_wait (pid, ourstatus)
int pid;
struct target_waitstatus *ourstatus;
{
#ifdef FASYNC
signal (SIGIO, x_event);
#else
#if 1
sigset (SIGIO, x_event);
#else
/* This is possibly needed for SVR4... */
{
struct sigaction action;
static sigset_t nullsigmask = {0};
struct sigaction action;
static sigset_t nullsigmask = {0};
action.sa_handler = iosig;
action.sa_mask = nullsigmask;
action.sa_flags = SA_RESTART;
sigaction(SIGIO, &action, NULL);
}
#endif
#ifndef SA_RESTART
/* Needed for SunOS 4.1.x */
#define SA_RESTART 0
#endif
action.sa_handler = x_event;
action.sa_mask = nullsigmask;
action.sa_flags = SA_RESTART;
sigaction(SIGIO, &action, NULL);
pid = target_wait (pid, ourstatus);
signal (SIGIO, SIG_IGN);
action.sa_handler = SIG_IGN;
sigaction(SIGIO, &action, NULL);
return pid;
}
@ -772,6 +769,8 @@ gdbtk_init ()
struct cleanup *old_chain;
char *gdbtk_filename;
int i;
struct sigaction action;
static sigset_t nullsigmask = {0};
old_chain = make_cleanup (cleanup_init, 0);
@ -824,16 +823,23 @@ gdbtk_init ()
/* Setup for I/O interrupts */
signal (SIGIO, SIG_IGN);
action.sa_mask = nullsigmask;
action.sa_flags = 0;
action.sa_handler = SIG_IGN;
sigaction(SIGIO, &action, NULL);
#ifdef FASYNC
i = fcntl (x_fd, F_GETFL, 0);
fcntl (x_fd, F_SETFL, i|FASYNC);
fcntl (x_fd, F_SETOWN, getpid());
#ifdef FIOASYNC
i = 1;
if (ioctl (x_fd, FIOASYNC, &i))
perror_with_name ("gdbtk_init: ioctl FIOASYNC failed");
i = getpid();
if (ioctl (x_fd, SIOCSPGRP, &i))
perror_with_name ("gdbtk_init: ioctl SIOCSPGRP failed");
#else
if (ioctl (x_fd, I_SETSIG, S_INPUT|S_RDNORM) < 0)
perror ("gdbtk_init: ioctl I_SETSIG failed");
#endif /* ifndef FASYNC */
perror_with_name ("gdbtk_init: ioctl I_SETSIG failed");
#endif /* ifndef FIOASYNC */
command_loop_hook = Tk_MainLoop;
fputs_unfiltered_hook = gdbtk_fputs;