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: Mingw GDB build fails for M16C target


On Tue, 28 Apr 2009 22:35:11 -0400
Daniel Jacobowitz <drow@false.org> wrote:

> On Tue, Apr 28, 2009 at 03:57:24PM -0700, Kevin Buettner wrote:
> > Jim,
> > 
> > It appears to me that comment, "Oddly, the gdb/sim interface uses host
> > signal numbers...", isn't true.  My patch deletes this comment in
> > addition to using TARGET_SIGNAL_foo instead of SIGfoo.  If you look at
> > remote-sim.c, you'll see that `enum target_signal' (which defines the
> > various TARGET_SIGNAL_foo constants) is used throughout the file.
> 
> Shouldn't this be the same as common/sim-signal.c?  sim_signal_to_host
> uses native numbers and sim_signal_to_target uses GDB protocol
> numbers.

It's not clear to me what you're asking about.

If you're asking why m32c/gdb-if.c doesn't use common/sim-signal.c,
that's because the m32c sim doesn't use the infrastructure in common/
at all.

If you're asking why I don't simply copy sim_signal_to_target for
use in m32c/gdb-if.c, that's because the m32c sim doesn't use the
SIM_SIGfoo constants that common/sim-signal.c uses.  It does bother me
though that m32c_signal_to_target() uses hardcoded constants like 4,
5, 10, 11, etc.  I suspect it was done this way because including the
correct newlib header file (without conflict with certain system
headers) was difficult.  That's just a guess though.

> Then again, I'm totally baffled by this bit of the sim.  It looks like
> sim_stop_reason returns a target signal and the callers check it
> against a host signal???

I looked at that yesterday prior to posting my patch.  I thought I
understood what was going on, but now that I look at it closer, I
too am baffled.  I noticed yesterday that signal() is being called to
handle SIGINT.  My thought at the time was that the handler was
somehow manipulating the sim's state so that it would return the sim
specific code for the signal.  But that's not what's happening.  The
handler simply checks to make sure that it (the sim) is not stopped;
if not, it prints a message, and then exits.  So it seems to me that
sim_signal_to_host() and that check that you mention are completely
unnecessary.

Kevin


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