Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa] gdbserver signal handling
Date: Thu, 28 Feb 2002 11:29:00 -0000	[thread overview]
Message-ID: <3C7E8527.4070005@cygnus.com> (raw)
In-Reply-To: <20020228124343.A10331@nevyn.them.org>


>> I suspect there is a difference between not including defs.h and 
>> unnecessarily duplicating common code.  My memory was that the signal 
>> enums were to be moved to their own header file (so things like 
>> gdbserver could include them).
>> 
>> This gdb/gdbserver/signals.c looks largely like a copy of big chunks of 
>> gdb/signals.c and other similar code.  I don't know that gdb developers 
>> want to take on responsability for maintaining such duplication.
>> 
>> Again, I think this can be cleaned up properly, but after the 5.2 branch 
>> goes through.
> 
> 
> What do you consider "properly", then?  For one minor thing, GDB wants
> the conversion functions to return an `enum target_signal' whereas
> gdbserver has no need to include "signals.h" in every file and only
> wants an `int' back to send to the remote client.

I don't understand.  Presumably any file that needs to use one of the 
signal conversion routines would include "signals.h" and get both the 
enum and the function signature.  Beyond that, I don't think anyone is 
going to notice if the code assigning the result to an int.  (I'm still 
working on a -Wassign-enum flag for GCC :-^).

> For another, the important reason in that paragraph was not the include
> of "defs.h" but the no code sharing.  I've gone to great lengths now
> to see that changes to GDB will not break gdbserver.  And these
> functions have been updated only perhaps once a year for new signals,
> so the duplication does not convern me overmuch.

I wish :-)  What I suspect will actually happens is that people will 
forget to up date one of the two copies eventuating in bitrot :-(

> Since you seem to strongly prefer sharing it, though, I suppose I could
> do this instead:
>   - create a new directory (``common''?) for files with well-defined
> interfaces.
>   - Move signals.c in there.   Create signals.h in there.
>   - Add that directory to the search paths for both GDB and gdbserver.
> 
> This would probably mean picking up the big signal to name conversion
> table in gdbserver, which I wanted to avoid but no one else seemed
> concerned about.

Not to long ago I suggested splitting up utils.c into smaller more 
independant files and a directory (gdb/utils/).

We could do similar to signals.c.  We could even split the string 
functions off from the conversion functions so that gdbserver didn't get 
bloated by them.

However, not in the next three days :-)

> Meanwhile?  Just leave signal handling in gdbserver crippled for the
> upcoming branch?  OK, I guess.

Yes.  It isn't as bad as it sounds though.  The problem has always been 
there so we're not exactly fixing a regression.  Besides, the next 
release is only 22 weeks away.

enjoy,
Andrew


  reply	other threads:[~2002-02-28 19:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-27 20:12 Daniel Jacobowitz
2002-02-28  7:01 ` Andrew Cagney
2002-02-28  8:55   ` Daniel Jacobowitz
2002-02-28  9:25     ` Andrew Cagney
2002-02-28  9:43       ` Daniel Jacobowitz
2002-02-28 11:29         ` Andrew Cagney [this message]
2002-02-28 12:30           ` Daniel Jacobowitz
2002-02-28 12:55             ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C7E8527.4070005@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox