There's at least two different things at issue here. nrun.c, I
believe, does not get linked in when the simulator is used from GDB.
Instead, it's only used for the 'foo-elf-run' binaries. As such, it
receives actual host signals (specifically SIGINT). So that's
undoubtedly a host signal number. But then that queues up SIM_SIGINT
inside the simulator.
What's interesting is to trace a particular use of a host signal number
through the various files, and figure out where it's set and used. I
can generally do them one at a time. For instance, the h8300 use of
SIGBUS:
sim_engine_set_run_state (sd, sim_stopped, SIGBUS);
One call site for sim_engine_set_run_state passes SIM_SIGTRAP, another
passes pending_sigrc, but both are inside #if 0. Another passes 0.
Everything else uses a host signal number, and comes from the h8300
sim. The signal number gets stored in engine->sigrc.
There's two ways to get it out again: sim_stop_reason leaves it as is
if sim_exited and treats it as a SIM_* signal if sim_stopped or
sim_signalled, and sim_engine_get_run_state just returns it.
The other way to set ->sigrc is sim_engine_halt. And pretty much all
call sites use SIM_* constants for that, as far as I checked.