#include "server.h"
#include "target.h"
#include "macosx-threads.h"
#include "macosx-excthread.h"
#define get_process_thread(proc) ((struct thread_info *) \
find_inferior_id (&all_threads, \
get_process (proc)->tid))
struct macosx_process_info
{
pid_t pid;
struct macosx_exception_thread_status *status;
CORE_ADDR bp_reinsert;
int stepping;
thread_t thread_to_step;
thread_t stopped_thread;
struct thread_resume *resume;
};
struct macosx_thread_info
{
struct macosx_process_info *process;
int suspend_count;
thread_t app_thread_id;
};
struct macosx_target_ops
{
void (*low_fetch_registers) (int regno);
void (*low_store_registers) (int regno);
void (*low_single_step_thread) (thread_t thread, int on);
int (*low_clear_single_step) (thread_t thread);
};
#define get_thread_process(thr) (((struct macosx_thread_info *) (inferior_target_data (thr)))->process)
extern struct macosx_target_ops the_low_target;
#if (defined __GNUC__)
#define __MACH_CHECK_FUNCTION __PRETTY_FUNCTION__
#else
#define __MACH_CHECK_FUNCTION ((__const char *) 0)
#endif
#define MACH_PROPAGATE_ERROR(ret) \
{ MACH_WARN_ERROR(ret); if ((ret) != KERN_SUCCESS) { return ret; } }
#define MACH_CHECK_ERROR(ret) \
mach_check_error (ret, __FILE__, __LINE__, __MACH_CHECK_FUNCTION);
#define MACH_WARN_ERROR(ret) \
mach_warn_error (ret, __FILE__, __LINE__, __MACH_CHECK_FUNCTION);
#define MACH_ERROR_STRING(ret) \
(mach_error_string (ret) ? mach_error_string (ret) : "[UNKNOWN]")
void mach_check_error (kern_return_t ret, const char *file, unsigned int line,
const char *func);
void mach_warn_error (kern_return_t ret, const char *file, unsigned int line,
const char *func);