This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch]: Fix build for GO32 and WIN32 targets


On Friday 22 January 2010 07:34:14, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Thu, 21 Jan 2010 22:18:44 +0000
> > Cc: gdb-patches@sourceware.org,  ktietz70@googlemail.com
> > 
> > I've answered your question of why don't other targets hit the same
> > problem.  If there's something to should be done to implement some
> > missing bits for djgpp or mingw, that's a completely separate
> > change.
> 
> I never said that I objected to this change (I don't), I just wanted
> to understand it, regardless.
> 

Before Kai's patch, the code looked like

static
check_syscall ()
{
...
}

new_tty ()
{
#if !defined(__GO32__) && !defined(_WIN32)
  check_syscall ();
#endif
}

So, check_syscall was never called in a djgpp or win32 build of
gdb.  This was fine up recently, when we introduced
the -Wunused-function warning, because it now warns on
djgpp and win32 that check_syscall is never used.  With -Werror, that
warning becomes an error, so the build is broken.  The fix is obvious,
wrap check_syscall in `#if !defined(__GO32__) && !defined(_WIN32)' too.
That's precisely, and only, what Kai's patch did.

You seem to be asking why are all the calls to
check_syscall compiled out on djgpp and win32.  If you actually
try looking at the code, and who is calling it, you'll see that
this is code that runs in the context of the inferior process,
not gdb, in the fork_inferior dance, when creating a new
inferior.  These targets don't use fork_inferior to create a
process.  The code is ifdefed out presumably because
it wouldn't compile on those systems.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]