de_fault (to_pid_to_exec_file, (char *(*)PARAMS ((int))) return_zero);
de_fault (to_core_file_to_sym_file, (char *(*)PARAMS ((char *))) return_zero);
+ de_fault (to_can_async_p, (int (*) (void)) return_zero);
+ de_fault (to_is_async_p, (int (*) (void)) return_zero);
+ de_fault (to_async, (void (*) (void (*) (int, void*, int), void*)) tcomplain);
#undef de_fault
}
INHERIT (to_has_registers, t);
INHERIT (to_has_execution, t);
INHERIT (to_has_thread_control, t);
- INHERIT (to_has_async_exec, t);
INHERIT (to_sections, t);
INHERIT (to_sections_end, t);
+ INHERIT (to_can_async_p, t);
+ INHERIT (to_is_async_p, t);
+ INHERIT (to_async, t);
INHERIT (to_magic, t);
#undef INHERIT
return 1;
}
+/*
+ * Resize the to_sections pointer. Also make sure that anyone that
+ * was holding on to an old value of it gets updated.
+ * Returns the old size.
+ */
+
+int
+target_resize_to_sections (struct target_ops *target, int num_added)
+{
+ struct target_ops **t;
+ struct section_table *old_value;
+ int old_count;
+
+ old_value = target->to_sections;
+
+ if (target->to_sections)
+ {
+ old_count = target->to_sections_end - target->to_sections;
+ target->to_sections = (struct section_table *)
+ xrealloc ((char *) target->to_sections,
+ (sizeof (struct section_table)) * (num_added + old_count));
+ }
+ else
+ {
+ old_count = 0;
+ target->to_sections = (struct section_table *)
+ xmalloc ((sizeof (struct section_table)) * num_added);
+ }
+ target->to_sections_end = target->to_sections + (num_added + old_count);
+
+ /* Check to see if anyone else was pointing to this structure.
+ If old_value was null, then no one was. */
+
+ if (old_value)
+ {
+ for (t = target_structs; t < target_structs + target_struct_size;
+ ++t)
+ {
+ if ((*t)->to_sections == old_value)
+ {
+ (*t)->to_sections = target->to_sections;
+ (*t)->to_sections_end = target->to_sections_end;
+ }
+ }
+ }
+
+ return old_count;
+
+}
+
/* Find a single runnable target in the stack and return it. If for
some reason there is more than one, return NULL. */
{"SIG62", "Real-time event 62"},
{"SIG63", "Real-time event 63"},
{"SIGCANCEL", "LWP internal signal"},
+ {"SIG32", "Real-time event 32"},
#if defined(MACH) || defined(__MACH__)
/* Mach exceptions */
#if defined (REALTIME_LO)
if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
- return (enum target_signal)
- (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
+ {
+ /* This block of TARGET_SIGNAL_REALTIME value is in order. */
+ if (33 <= hostsig && hostsig <= 63)
+ return (enum target_signal)
+ (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
+ else if (hostsig == 32)
+ return TARGET_SIGNAL_REALTIME_32;
+ else
+ error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
+ }
#endif
return TARGET_SIGNAL_UNKNOWN;
}
return SIGPRIO;
#endif
+ case TARGET_SIGNAL_REALTIME_32: return 32; /* by definition */
+
/* Mach exceptions. Assumes that the values for EXC_ are positive! */
#if defined (EXC_BAD_ACCESS) && defined (_NSIG)
case TARGET_EXC_BAD_ACCESS:
static char buf[30];
if (STREQ (current_target.to_shortname, "remote"))
- sprintf (buf, "thread %d\0", pid);
+ sprintf (buf, "thread %d", pid);
else
- sprintf (buf, "process %d\0", pid);
+ sprintf (buf, "process %d", pid);
return buf;
}
fprintf_unfiltered (gdb_stdlog, "target_fetch_registers (%s)",
regno != -1 ? REGISTER_NAME (regno) : "-1");
if (regno != -1)
- fprintf_unfiltered (gdb_stdlog, " = 0x%x %d",
+ fprintf_unfiltered (gdb_stdlog, " = 0x%lx %ld",
(unsigned long) read_register (regno),
- read_register (regno));
+ (unsigned long) read_register (regno));
fprintf_unfiltered (gdb_stdlog, "\n");
}
debug_target.to_store_registers (regno);
if (regno >= 0 && regno < NUM_REGS)
- fprintf_unfiltered (gdb_stdlog, "target_store_registers (%s) = 0x%x %d\n",
+ fprintf_unfiltered (gdb_stdlog, "target_store_registers (%s) = 0x%lx %ld\n",
REGISTER_NAME (regno),
(unsigned long) read_register (regno),
(unsigned long) read_register (regno));
retval = debug_target.to_insert_breakpoint (addr, save);
fprintf_unfiltered (gdb_stdlog,
- "target_insert_breakpoint (0x%x, xxx) = %d\n",
- (unsigned long) addr, retval);
+ "target_insert_breakpoint (0x%lx, xxx) = %ld\n",
+ (unsigned long) addr,
+ (unsigned long) retval);
return retval;
}
retval = debug_target.to_remove_breakpoint (addr, save);
fprintf_unfiltered (gdb_stdlog,
- "target_remove_breakpoint (0x%x, xxx) = %d\n",
- (unsigned long) addr, retval);
+ "target_remove_breakpoint (0x%lx, xxx) = %ld\n",
+ (unsigned long) addr,
+ (unsigned long) retval);
return retval;
}