This is xm.h in view mode; [Download] [Up]
/* Parameters for execution under NextStep, for GDB, the GNU debugger.
Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
This file is part of GDB.
GDB is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
GDB is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef INCLUDE_XM_H
#define INCLUDE_XM_H
#import <mach/mach.h>
#import <xm-dep.h>
#ifndef FOPEN_RT
#include "fopen-same.h"
#endif
extern int find_objc_msgcall PARAMS ((CORE_ADDR stop_pc,
CORE_ADDR *new_pc));
extern struct symtab *symtab_for_misc_function PARAMS ((int ind));
extern int kernel_attached;
extern task_t inferior_task, gdb_task;
extern CORE_ADDR changedAddress;
extern int isTask PARAMS ((task_t task));
extern void NeXT_mourn_inferior();
extern void validateRegister PARAMS ((int regno));
extern char *stringSave PARAMS ((const char *string));
extern char *stringSaveN PARAMS ((const char *string, int n));
extern int any_cplusplus;
extern int force_cplusplus;
extern CORE_ADDR dontSuspendThreadAddress;
extern void dontSuspendThread();
extern boolean_t stopped_in_ptrace;
@class RegionManager;
extern RegionManager *regionManager;
extern struct breakpoint *is_data_break PARAMS ((CORE_ADDR address));
extern void set_view_host PARAMS ((const char *arg));
extern void connect_to PARAMS ((const char *connectionName));
extern void set_noprompt();
/* Do implement the attach and detach commands. */
#define ATTACH_DETACH
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS
/* We have to grab the regs since we store all regs at once. */
#define CHILD_PREPARE_TO_STORE() \
read_register_bytes (0, (char *) NULL, REGISTER_BYTES)
struct mach_oh_nlist {
union {
char *n_name; /* for use when in-core */
long n_strx; /* index into the string table */
} n_un;
unsigned char n_type; /* type flag, see below */
unsigned char n_sect; /* section number or NO_SECT */
short n_desc; /* see <stab.h> */
unsigned long n_value; /* value of this symbol (or stab offset) */
};
#define MACH_OH_N_SECT 0xe /* defined in section number n_sect */
#define MACH_OH_N_TYPE 0x1e /* mask for the type bits */
#define N_TEXT 4
#define N_DATA 6
#define N_BSS 8
#define COMPLETION_LIST_HOOK(text) objc_completion_list_hook(text)
#define DECODE_LINE_1_HOOK(args, value) lookup_method(args, value)
#define CONDENSE_MISC_BUNCHES_HOOK() combine_misc_functions_psymtabs()
#define SYMBOLS_CHANGED_HOOK(obj) symbols_changed_hook((obj))
/* We relocated the blocks */
#define BLOCK_ADDRESS_ABSOLUTE
#define BLOCKS_ARE_UNSORTED
#define LINES_ARE_UNSORTED
#define CREATE_INFERIOR_HOOK create_inferior_hook
#define STOP_HOOK stop_hook
#define WAIT_FOR_INFERIOR_HOOK wait_for_inferior_hook
static inline char *
STRCHR (const char *s, int c)
{
while (*s) {
if (*s == c)
return (char *)s;
s++;
}
return NULL;
}
#include <string.h> /* before we define strchr to STRCHR */
#define strchr(s, c) STRCHR(s, c)
/*
* Find the first colon after the name of a function. This name could be an
Objective C method name, which could have colons in it itself.
*/
static inline char *
colon_from_name (name)
char *name;
{
if (*name == '-' || *name == '+')
return (char *) strchr (strchr (name, ']'), ':');
else
return (char *) strchr (name, ':');
}
#define COLON_FROM_NAME(name) colon_from_name(name)
#define LOCK_EXECUTE_COMMAND
#define ADDITIONAL_OPTIONS \
{"opath", 1, 0, 'o'}, \
{"viewhost", 1, 0, 16}, \
{"viewprogram", 1, 0, 17}, \
{"connect", 1, 0, 18}, \
{"noprompt", 0, 0, 19},
#define ADDITIONAL_OPTION_CASES \
case 'o': \
opath_alias_command (optarg); \
break; \
case 16: \
set_view_host (optarg); \
break; \
case 17: \
set_view_program (optarg); \
break; \
case 18: \
connect_to (optarg); \
break; \
case 19: \
set_noprompt(); \
break;
#define SUN_FIXED_LBRAC_BUG (1)
/* if this doesn't work, try (1)! */
/* (by the way, this belongs in tm*.h!) */
int static inline mach_call_no_error(kern_return_t ret, char *mstring, char *estring)
{
if (ret != KERN_SUCCESS) {
mach_error(mstring, ret);
fprintf(stderr, "%s\n", estring);
}
return ret;
}
void static inline mach_call_no_inferior(kern_return_t ret, char *mstring, char *estring)
{
if (ret != KERN_SUCCESS) {
mach_error(mstring, ret);
fprintf(stderr, "%s\n", estring);
}
}
void static inline mach_call(kern_return_t ret, char *mstring, char *estring)
{ volatile void error();
if (ret != KERN_SUCCESS) {
if (isTask(inferior_task)) {
mach_error(mstring, ret);
error(estring);
} else {
mach_error(mstring, ret);
fprintf(stderr, "%s\n", estring);
NeXT_mourn_inferior();
error("The program you were running has been terminated.");
}
}
}
#define EXTRA_INFERIOR_WORDS 2
#define SAVE_INFERIOR_STATUS_HOOK save_inferior_status_hook
#define RESTORE_INFERIOR_STATUS_HOOK restore_inferior_status_hook
//#define DONT_FILTER
#define DONT_USE_BFD
#define SET_EXECUTE mach_set_execute
extern int mach_set_execute (CORE_ADDR start, unsigned size);
#define UNSET_EXECUTE mach_unset_execute
extern void mach_unset_execute (CORE_ADDR start, unsigned size, vm_prot_t matt);
#endif /* INCLUDE_XM_H */
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.