public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org,
	Daniel Jacobowitz <dan@codesourcery.com>,
	       Joel Brobecker <brobecker@adacore.com>,
	Eli Zaretskii <eliz@gnu.org>,
	       Mark Kettenis <mark.kettenis@xs4all.nl>
Subject: Re: [patch 1/9]#2 Rename `enum target_signal' to target_signal_t
Date: Thu, 02 Sep 2010 14:01:00 -0000	[thread overview]
Message-ID: <20100902103122.GA11298@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <201009020254.47745.pedro@codesourcery.com>

On Thu, 02 Sep 2010 03:54:47 +0200, Pedro Alves wrote:
> A target_signal_o array to hold
> all the possible gdb signals, and a target_signal becomes:
> 
> typedef const struct target_signal_o * target_signal;

This means there is abandoned the possibility to associate dynamic information
with a signal (such as to associate siginfo_t with it).  Target signal (SIG*)
without its siginfo_t is an incomplete information.  Therefore I was
automatically trying to fix this problem before.

Therefore if GDB middle-end (infrun.c) does not need the siginfo_t part ...
does it even need to know the signal number (int host_signal - SIG*) part?
	echo * mi/* tui/* gdbserver/*|tr ' ' '\n'|grep -v ChangeLog|xargs cat|perl -lne 'print $& while /\bTARGET_SIGNAL_\w+/g;'|sort|uniq -c|sort -nr|vi -
says GDB references only 30 TARGET_SIGNAL_* signals (out of the 150 existing
ones) so it does not need to really know the specific signal number.

Those 120 signals could be kept private only to remote.c and gdbserver(s) for
the purpose of compatibility of the gdbserver protocol.
(In fact all TARGET_SIGNAL_* should be kept private to the target as for
example the "Treating signal as SIGTRAP" hack in infrun.c should be target
specific and TARGET_SIGNAL_SIGTRAP should be called
TARGET_SIGNAL_BREAKPOINT_HIT etc.  But a full signals abstraction is a too
expensive/naive/unreal clean-up project for now.)

As a proof Linux `SIGSTKFLT' is now missing in the TARGET_SIGNAL_* list.
But no GDB middle-end code needs to know what is `SIGSTKFLT'.  This suggests
we can reduce the TARGET_SIGNAL_* set only to the 30 signals (for an easy
compatibility with current GDB code) and introduce a new target specific field
(similar to the abandoned siginfo field):

typedef struct
  {
    enum target_signal_number sig;  /* TARGET_SIGNAL_* 30 possibilities */
    int host_signal;  /* untranslated SIG* number for TARGET_SIGNAL_UNKNOWN.  */
  } target_signal;
 - Naming is kept compatible with current GDB naming.  The reality is:
   s/target_signal/gdb_signal/
   s/host_signal/target_signal/

Target could provide a number-name table for the `handle' command covering
just the specific 64 signals available at the Linux target (instead of the 150
ones from the TARGET_SIGNAL_* list).


I don't say I want to do it or that it should be done.  It has just explained
to me why target_signal_t does not need to contain the siginfo_t information.


> Anyway, here it is at least for the archives.

BTW I like this approach (when no dynamic information needs and as explained
above probably never will need to get associated).  I do not like the
`target_signal' name used for a type but that is a nitpick.


<bite>
Is ChangeLog required only for the final check-in?  Or are global maintainers
excluded from the ChangeLog submit requirement?  I have spent a whole day
writing it and the review did not get past the basic idea of my patchset.


Thanks,
Jan

  reply	other threads:[~2010-09-02 10:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30  7:11 Jan Kratochvil
2010-08-30  8:14 ` Mark Kettenis
2010-08-30  8:24   ` Jan Kratochvil
2010-08-30 10:09     ` Eli Zaretskii
2010-08-30 11:11       ` Mark Kettenis
2010-08-30 14:08         ` Joel Brobecker
2010-08-31 18:28           ` Jan Kratochvil
2010-08-31 18:45             ` Mark Kettenis
2010-09-01  2:03             ` Joel Brobecker
2010-09-01 18:18             ` Joel Brobecker
2010-09-01 18:30               ` Jan Kratochvil
2010-09-01 18:38                 ` Pedro Alves
2010-09-01 18:45                   ` Jan Kratochvil
2010-09-01 18:40                 ` Joel Brobecker
2010-09-01 18:51                   ` Jan Kratochvil
2010-09-01 19:08                     ` Pedro Alves
2010-09-01 19:28                       ` Jan Kratochvil
2010-09-01 20:06                         ` Pedro Alves
2010-09-01 20:06                           ` Daniel Jacobowitz
2010-09-01 20:10                             ` Pedro Alves
2010-09-02  9:46                               ` Pedro Alves
2010-09-02 14:01                                 ` Jan Kratochvil [this message]
2010-09-02 15:36                                   ` Joel Brobecker
2010-09-02 19:02                                   ` Pedro Alves
2010-09-02 20:46                                     ` Jan Kratochvil
2010-09-07 18:59                                       ` Jan Kratochvil
2010-09-02 16:02                                 ` Joel Brobecker
2010-09-02 17:04                                   ` Jan Kratochvil
2010-09-06  0:29                                 ` Jan Kratochvil
2010-09-06 13:30                                   ` Pedro Alves
2010-09-06 14:52                                     ` Jan Kratochvil
2010-09-08 23:42                                 ` Jan Kratochvil
2010-09-01 20:23                           ` Jan Kratochvil
2010-09-01 20:30                             ` Mark Kettenis
2010-09-01 20:47                             ` Pedro Alves
2010-09-01 21:32                         ` Joseph S. Myers
2010-09-01 19:12                     ` Joel Brobecker
2010-09-01 22:37                     ` Tom Tromey
2010-08-30 14:11         ` Eli Zaretskii
2010-08-30 17:34     ` Michael Snyder

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=20100902103122.GA11298@host1.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=dan@codesourcery.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=pedro@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).