From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: DJ Delorie Cc: gdb@sources.redhat.com Subject: Re: DOS/Windows-specific code in sim/ Date: Thu, 10 May 2001 08:33:00 -0000 Message-id: <3AF99F46.6090201@cygnus.com> References: <20010503211502.21716.qmail@web6401.mail.yahoo.com> <3AF1DAA0.3060702@cygnus.com> <200105071609.TAA24129@is.elta.co.il> <200105081156.OAA06345@is.elta.co.il> X-SW-Source: 2001-05/msg00207.html > Eli Zaretskii writes: > >> Does someone know why this is done? If SIGTRAP etc. are not defined, >> the code should simply not reference it. > > > The problem is that the simulators generate these signals (the > simulated environment supports them) but they're translated to the > hosts's SIG* values to "standardize" how they're handled by gdb. If > the sim supports more signals than the host, there needs to be some > fake value they're translated into. > > Not that I agree with the technique, but that's how it is... The simulator currently passes target signal values across its interface. I agree it is silly. To quote the TODO file: -- Fix target_signal_from_host() etc. The name is wrong for starters. ``target_signal'' should probably be ``gdb_signal''. ``from_host'' should be ``from_target_signal''. After that it needs to be multi-arched and made independent of any host signal numbering. -- Suprisingly, remote.c got it right (the doco is wrong). It passes GDB signals to the remote target. Andrew