* arch-utils.c (default_gdb_signal_from_target): Delete.
* arch-utils.h (default_gdb_signal_from_target): Delete.
* corelow.c (core_open) <signal mapping>: Extended comment. Check
gdbarch_gdb_signal_from_target_p.
* gdbarch.sh (gdb_signal_from_target): Make it an M method (with
predicate).
* gdbarch.h: Regenerate.
* gdbarch.c: Regenerate.
+2012-06-04 Pedro Alves <palves@redhat.com>
+
+ * arch-utils.c (default_gdb_signal_from_target): Delete.
+ * arch-utils.h (default_gdb_signal_from_target): Delete.
+ * corelow.c (core_open) <signal mapping>: Extended comment. Check
+ gdbarch_gdb_signal_from_target_p.
+ * gdbarch.sh (gdb_signal_from_target): Make it an M method (with
+ predicate).
+ * gdbarch.h: Regenerate.
+ * gdbarch.c: Regenerate.
+
2012-06-04 Pedro Alves <palves@redhat.com>
* gdbarch.sh (gdb_signal_from_target): Mention that the
error (_("This architecture has no method to collect a return address."));
}
-enum gdb_signal
-default_gdb_signal_from_target (struct gdbarch *gdbarch, int signo)
-{
- /* Lacking a better mapping, assume host signal numbers. If
- debugging a cross-core, most likely this translation will be
- incorrect. */
- return gdb_signal_from_host (signo);
-}
-
/* */
/* -Wmissing-prototypes */
extern const char *default_auto_charset (void);
extern const char *default_auto_wide_charset (void);
-extern enum gdb_signal default_gdb_signal_from_target (struct gdbarch *,
- int);
-
#endif
if (siggy > 0)
{
/* If we don't have a CORE_GDBARCH to work with, assume a native
- core. */
+ core (map gdb_signal from host signals). If we do have
+ CORE_GDBARCH to work with, but no gdb_signal_from_target
+ implementation for that gdbarch, as a fallback measure,
+ assume the host signal mapping. It'll be correct for native
+ cores, but most likely incorrect for cross-cores. */
enum gdb_signal sig = (core_gdbarch != NULL
- ? gdbarch_gdb_signal_from_target (core_gdbarch,
- siggy)
- : gdb_signal_from_host (siggy));
+ && gdbarch_gdb_signal_from_target_p (core_gdbarch)
+ ? gdbarch_gdb_signal_from_target (core_gdbarch,
+ siggy)
+ : gdb_signal_from_host (siggy));
printf_filtered (_("Program terminated with signal %d, %s.\n"),
siggy, gdb_signal_to_string (sig));
0, /* sofun_address_maybe_missing */
0, /* process_record */
0, /* process_record_signal */
- default_gdb_signal_from_target, /* gdb_signal_from_target */
+ 0, /* gdb_signal_from_target */
0, /* get_siginfo_type */
0, /* record_special_symbol */
0, /* get_syscall_number */
gdbarch->displaced_step_free_closure = NULL;
gdbarch->displaced_step_location = NULL;
gdbarch->relocate_instruction = NULL;
- gdbarch->gdb_signal_from_target = default_gdb_signal_from_target;
gdbarch->has_shared_address_space = default_has_shared_address_space;
gdbarch->fast_tracepoint_valid_at = default_fast_tracepoint_valid_at;
gdbarch->auto_charset = default_auto_charset;
/* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
/* Skip verify of process_record, has predicate. */
/* Skip verify of process_record_signal, has predicate. */
- /* Skip verify of gdb_signal_from_target, invalid_p == 0 */
+ /* Skip verify of gdb_signal_from_target, has predicate. */
/* Skip verify of get_siginfo_type, has predicate. */
/* Skip verify of record_special_symbol, has predicate. */
/* Skip verify of get_syscall_number, has predicate. */
fprintf_unfiltered (file,
"gdbarch_dump: gcore_bfd_target = %s\n",
pstring (gdbarch->gcore_bfd_target));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_gdb_signal_from_target_p() = %d\n",
+ gdbarch_gdb_signal_from_target_p (gdbarch));
fprintf_unfiltered (file,
"gdbarch_dump: gdb_signal_from_target = <%s>\n",
host_address_to_string (gdbarch->gdb_signal_from_target));
gdbarch->process_record_signal = process_record_signal;
}
+int
+gdbarch_gdb_signal_from_target_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->gdb_signal_from_target != NULL;
+}
+
enum gdb_signal
gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, int signo)
{
header (the nm-*.h files), the host <signal.h> header, or similar
headers. This is mainly used when cross-debugging core files ---
"Live" targets hide the translation behind the target interface
- (target_wait, target_resume, etc.). The default is to do the
- translation using host signal numbers. */
+ (target_wait, target_resume, etc.). */
+
+extern int gdbarch_gdb_signal_from_target_p (struct gdbarch *gdbarch);
typedef enum gdb_signal (gdbarch_gdb_signal_from_target_ftype) (struct gdbarch *gdbarch, int signo);
extern enum gdb_signal gdbarch_gdb_signal_from_target (struct gdbarch *gdbarch, int signo);
# header (the nm-*.h files), the host <signal.h> header, or similar
# headers. This is mainly used when cross-debugging core files ---
# "Live" targets hide the translation behind the target interface
-# (target_wait, target_resume, etc.). The default is to do the
-# translation using host signal numbers.
-m:enum gdb_signal:gdb_signal_from_target:int signo:signo::default_gdb_signal_from_target::0
+# (target_wait, target_resume, etc.).
+M:enum gdb_signal:gdb_signal_from_target:int signo:signo
# Extra signal info inspection.
#