From: Pedro Alves <palves@redhat.com>
To: Michael Eager <eager@eagerm.com>
Cc: "Maciej W. Rozycki" <macro@codesourcery.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] MIPS Linux signals
Date: Mon, 04 Jun 2012 15:49:00 -0000 [thread overview]
Message-ID: <4FCCD900.3040102@redhat.com> (raw)
In-Reply-To: <4FC92EF9.3080804@eagerm.com>
On 06/01/2012 10:07 PM, Michael Eager wrote:
>>> #if defined (REALTIME_LO)
>>
>> Is this #ifdef needed? How about you rewrite this block using
>> MIPS-specific definitions (MIPS_SIGRTMIN, etc.)? Please avoid hardcoded
>> magic numbers too -- e.g. what are the magic values 32 and 33 below and
>> how do they correlate to MIPS_SIGRTMIN, etc.? I can't get it from the
>> change below. Should they be made relative to MIPS_SIGRTMIN perhaps?
>> Are the values GDB_SIGNAL_REALTIME_* expand to not in order?
>
> This code is copied from signals.c. I don't really want to re-design
> the logic since I don't have a straight-forward way to test the code.
>
> I'll recast this in terms of MIPS_SIGRTMIN, but all of your questions
> can be addressed to the code in signals.c. I didn't find it clear, either.
The whole point of gdb_signal_from_target is to be host independent.
common/signals.c is all about host signal mapping. REALTIME_LO
is either defined in the native header files in gdb/config/ (the nm-*.h
files), or, if not defined there, common/signals.c does:
#ifndef REALTIME_LO
# if defined(__SIGRTMIN)
# define REALTIME_LO __SIGRTMIN
# define REALTIME_HI (__SIGRTMAX + 1)
# elif defined(SIGRTMIN)
# define REALTIME_LO SIGRTMIN
# define REALTIME_HI (SIGRTMAX + 1)
# endif
#endif
So that '#if defined (REALTIME_LO)' is really wrong for the gdbarch hook.
The only nm header that defines REALTIME_LO presently,
making the config/signals.c #ifndef be bypassed, is config/nm-nto.h:
/* Setup the valid realtime signal range. */
#define REALTIME_LO 41
#define REALTIME_HI 56
So only when you build GDB hosted for QNX NTO would you see that
new REALTIME_LO block in the mips tdep file be compiled... On all
other hosts, including native GNU/Linux MIPS, you'd miss the
conversions for all the realtime signals.
I'm doing adding a few more comments to the gdbarch hook, plus doing
a code change (that doesn't affect your patch) that hopefully makes
things a bit clearer.
--
Pedro Alves
next prev parent reply other threads:[~2012-06-04 15:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-01 20:21 Michael Eager
2012-06-01 20:53 ` Maciej W. Rozycki
2012-06-01 21:07 ` Michael Eager
2012-06-04 15:49 ` Pedro Alves [this message]
2012-06-04 16:26 ` [PATCH 2/2] Make gdbarch_gdb_signal_from_target a method with predicate Pedro Alves
2012-06-04 16:26 ` [PATCH 1/2] gdbarch_gdb_signal_from_target: Mention host independence Pedro Alves
2012-06-01 22:52 ` [PATCH] MIPS Linux signals Michael Eager
2012-06-06 22:52 ` Maciej W. Rozycki
2012-06-06 23:12 ` Michael Eager
2012-06-11 16:09 ` Michael Eager
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=4FCCD900.3040102@redhat.com \
--to=palves@redhat.com \
--cc=eager@eagerm.com \
--cc=gdb-patches@sourceware.org \
--cc=macro@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