GDB (API)
|
00001 /* *INDENT-OFF* */ /* ATTRIBUTE_PRINTF confuses indent, avoid running it 00002 for now. */ 00003 /* Basic, host-specific, and target-specific definitions for GDB. 00004 Copyright (C) 1986-2013 Free Software Foundation, Inc. 00005 00006 This file is part of GDB. 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00020 00021 #ifndef DEFS_H 00022 #define DEFS_H 00023 00024 #ifdef GDBSERVER 00025 # error gdbserver should not include gdb/defs.h 00026 #endif 00027 00028 #include "config.h" /* Generated by configure. */ 00029 #include "build-gnulib/config.h" 00030 00031 #include <sys/types.h> 00032 #include <stdio.h> 00033 #include <errno.h> /* System call error return status. */ 00034 #include <limits.h> 00035 #include <stdint.h> 00036 00037 /* The libdecnumber library, on which GDB depends, includes a header file 00038 called gstdint.h instead of relying directly on stdint.h. GDB, on the 00039 other hand, includes stdint.h directly, relying on the fact that gnulib 00040 generates a copy if the system doesn't provide one or if it is missing 00041 some features. Unfortunately, gstdint.h and stdint.h cannot be included 00042 at the same time, which may happen when we include a file from 00043 libdecnumber. 00044 00045 The following macro definition effectively prevents the inclusion of 00046 gstdint.h, as all the definitions it provides are guarded against 00047 the GCC_GENERATED_STDINT_H macro. We already have gnulib/stdint.h 00048 included, so it's ok to blank out gstdint.h. */ 00049 #define GCC_GENERATED_STDINT_H 1 00050 00051 #ifdef HAVE_STDDEF_H 00052 #include <stddef.h> 00053 #endif 00054 00055 #include <unistd.h> 00056 00057 /* For gnulib's PATH_MAX. */ 00058 #include "pathmax.h" 00059 00060 #include <fcntl.h> 00061 00062 /* First include ansidecl.h so we can use the various macro definitions 00063 here and in all subsequent file inclusions. */ 00064 00065 #include "ansidecl.h" 00066 00067 #include "gdb_locale.h" 00068 00069 #include "gdb_wchar.h" 00070 00071 /* For ``enum gdb_signal''. */ 00072 #include "gdb/signals.h" 00073 00074 #include "ui-file.h" 00075 00076 #include "host-defs.h" 00077 00078 /* Just in case they're not defined in stdio.h. */ 00079 00080 #ifndef SEEK_SET 00081 #define SEEK_SET 0 00082 #endif 00083 #ifndef SEEK_CUR 00084 #define SEEK_CUR 1 00085 #endif 00086 00087 /* The O_BINARY flag is defined in fcntl.h on some non-Posix platforms. 00088 It is used as an access modifier in calls to open(), where it acts 00089 similarly to the "b" character in fopen()'s MODE argument. On Posix 00090 platforms it should be a no-op, so it is defined as 0 here. This 00091 ensures that the symbol may be used freely elsewhere in gdb. */ 00092 00093 #ifndef O_BINARY 00094 #define O_BINARY 0 00095 #endif 00096 00097 #include <stdarg.h> /* For va_list. */ 00098 00099 #include "libiberty.h" 00100 #include "hashtab.h" 00101 00102 /* Rather than duplicate all the logic in BFD for figuring out what 00103 types to use (which can be pretty complicated), symply define them 00104 in terms of the corresponding type from BFD. */ 00105 00106 #include "bfd.h" 00107 00108 /* A byte from the program being debugged. */ 00109 typedef bfd_byte gdb_byte; 00110 00111 /* An address in the program being debugged. Host byte order. */ 00112 typedef bfd_vma CORE_ADDR; 00113 00114 /* The largest CORE_ADDR value. */ 00115 #define CORE_ADDR_MAX (~ (CORE_ADDR) 0) 00116 00117 /* This is to make sure that LONGEST is at least as big as CORE_ADDR. */ 00118 00119 #ifdef BFD64 00120 00121 #define LONGEST BFD_HOST_64_BIT 00122 #define ULONGEST BFD_HOST_U_64_BIT 00123 00124 #else /* No BFD64 */ 00125 00126 #define LONGEST long long 00127 #define ULONGEST unsigned long long 00128 00129 #endif /* No BFD64 */ 00130 00131 #ifndef min 00132 #define min(a, b) ((a) < (b) ? (a) : (b)) 00133 #endif 00134 #ifndef max 00135 #define max(a, b) ((a) > (b) ? (a) : (b)) 00136 #endif 00137 00138 #include "ptid.h" 00139 00140 /* Enable xdb commands if set. */ 00141 extern int xdb_commands; 00142 00143 /* Enable dbx commands if set. */ 00144 extern int dbx_commands; 00145 00146 /* System root path, used to find libraries etc. */ 00147 extern char *gdb_sysroot; 00148 00149 /* GDB datadir, used to store data files. */ 00150 extern char *gdb_datadir; 00151 00152 /* If non-NULL, the possibly relocated path to python's "lib" directory 00153 specified with --with-python. */ 00154 extern char *python_libdir; 00155 00156 /* Search path for separate debug files. */ 00157 extern char *debug_file_directory; 00158 00159 /* GDB has two methods for handling SIGINT. When immediate_quit is 00160 nonzero, a SIGINT results in an immediate longjmp out of the signal 00161 handler. Otherwise, SIGINT simply sets a flag; code that might 00162 take a long time, and which ought to be interruptible, checks this 00163 flag using the QUIT macro. 00164 00165 If GDB is built with Python support, it uses Python's low-level 00166 interface to implement the flag. This approach makes it possible 00167 for Python and GDB SIGINT handling to coexist seamlessly. 00168 00169 If GDB is built without Python, it instead uses its traditional 00170 variables. */ 00171 00172 /* Clear the quit flag. */ 00173 extern void clear_quit_flag (void); 00174 /* Evaluate to non-zero if the quit flag is set, zero otherwise. This 00175 will clear the quit flag as a side effect. */ 00176 extern int check_quit_flag (void); 00177 /* Set the quit flag. */ 00178 extern void set_quit_flag (void); 00179 00180 extern int immediate_quit; 00181 00182 extern void quit (void); 00183 00184 /* FIXME: cagney/2000-03-13: It has been suggested that the peformance 00185 benefits of having a ``QUIT'' macro rather than a function are 00186 marginal. If the overhead of a QUIT function call is proving 00187 significant then its calling frequency should probably be reduced 00188 [kingdon]. A profile analyzing the current situtation is 00189 needed. */ 00190 00191 #define QUIT { \ 00192 if (check_quit_flag ()) quit (); \ 00193 if (deprecated_interactive_hook) deprecated_interactive_hook (); \ 00194 } 00195 00196 /* Languages represented in the symbol table and elsewhere. 00197 This should probably be in language.h, but since enum's can't 00198 be forward declared to satisfy opaque references before their 00199 actual definition, needs to be here. */ 00200 00201 enum language 00202 { 00203 language_unknown, /* Language not known */ 00204 language_auto, /* Placeholder for automatic setting */ 00205 language_c, /* C */ 00206 language_cplus, /* C++ */ 00207 language_d, /* D */ 00208 language_go, /* Go */ 00209 language_objc, /* Objective-C */ 00210 language_java, /* Java */ 00211 language_fortran, /* Fortran */ 00212 language_m2, /* Modula-2 */ 00213 language_asm, /* Assembly language */ 00214 language_pascal, /* Pascal */ 00215 language_ada, /* Ada */ 00216 language_opencl, /* OpenCL */ 00217 language_minimal, /* All other languages, minimal support only */ 00218 nr_languages 00219 }; 00220 00221 enum precision_type 00222 { 00223 single_precision, 00224 double_precision, 00225 unspecified_precision 00226 }; 00227 00228 /* A generic, not quite boolean, enumeration. */ 00229 enum auto_boolean 00230 { 00231 AUTO_BOOLEAN_TRUE, 00232 AUTO_BOOLEAN_FALSE, 00233 AUTO_BOOLEAN_AUTO 00234 }; 00235 00236 /* Potential ways that a function can return a value of a given type. */ 00237 enum return_value_convention 00238 { 00239 /* Where the return value has been squeezed into one or more 00240 registers. */ 00241 RETURN_VALUE_REGISTER_CONVENTION, 00242 /* Commonly known as the "struct return convention". The caller 00243 passes an additional hidden first parameter to the caller. That 00244 parameter contains the address at which the value being returned 00245 should be stored. While typically, and historically, used for 00246 large structs, this is convention is applied to values of many 00247 different types. */ 00248 RETURN_VALUE_STRUCT_CONVENTION, 00249 /* Like the "struct return convention" above, but where the ABI 00250 guarantees that the called function stores the address at which 00251 the value being returned is stored in a well-defined location, 00252 such as a register or memory slot in the stack frame. Don't use 00253 this if the ABI doesn't explicitly guarantees this. */ 00254 RETURN_VALUE_ABI_RETURNS_ADDRESS, 00255 /* Like the "struct return convention" above, but where the ABI 00256 guarantees that the address at which the value being returned is 00257 stored will be available in a well-defined location, such as a 00258 register or memory slot in the stack frame. Don't use this if 00259 the ABI doesn't explicitly guarantees this. */ 00260 RETURN_VALUE_ABI_PRESERVES_ADDRESS, 00261 }; 00262 00263 /* Needed for various prototypes */ 00264 00265 struct symtab; 00266 struct breakpoint; 00267 struct frame_info; 00268 struct gdbarch; 00269 struct value; 00270 00271 /* From main.c. */ 00272 00273 /* This really belong in utils.c (path-utils.c?), but it references some 00274 globals that are currently only available to main.c. */ 00275 extern char *relocate_gdb_directory (const char *initial, int flag); 00276 00277 00278 /* Annotation stuff. */ 00279 00280 extern int annotation_level; /* in stack.c */ 00281 00282 00283 /* From regex.c or libc. BSD 4.4 declares this with the argument type as 00284 "const char *" in unistd.h, so we can't declare the argument 00285 as "char *". */ 00286 00287 extern char *re_comp (const char *); 00288 00289 /* From symfile.c */ 00290 00291 extern void symbol_file_command (char *, int); 00292 00293 /* Remote targets may wish to use this as their load function. */ 00294 extern void generic_load (char *name, int from_tty); 00295 00296 /* Report on STREAM the performance of memory transfer operation, 00297 such as 'load'. 00298 DATA_COUNT is the number of bytes transferred. 00299 WRITE_COUNT is the number of separate write operations, or 0, 00300 if that information is not available. 00301 START_TIME is the time at which an operation was started. 00302 END_TIME is the time at which an operation ended. */ 00303 struct timeval; 00304 extern void print_transfer_performance (struct ui_file *stream, 00305 unsigned long data_count, 00306 unsigned long write_count, 00307 const struct timeval *start_time, 00308 const struct timeval *end_time); 00309 00310 /* From top.c */ 00311 00312 typedef void initialize_file_ftype (void); 00313 00314 extern char *gdb_readline (char *); 00315 00316 extern char *gdb_readline_wrapper (char *); 00317 00318 extern char *command_line_input (char *, int, char *); 00319 00320 extern void print_prompt (void); 00321 00322 extern int input_from_terminal_p (void); 00323 00324 extern int info_verbose; 00325 00326 /* From printcmd.c */ 00327 00328 extern void set_next_address (struct gdbarch *, CORE_ADDR); 00329 00330 extern int print_address_symbolic (struct gdbarch *, CORE_ADDR, 00331 struct ui_file *, int, char *); 00332 00333 extern int build_address_symbolic (struct gdbarch *, 00334 CORE_ADDR addr, 00335 int do_demangle, 00336 char **name, 00337 int *offset, 00338 char **filename, 00339 int *line, 00340 int *unmapped); 00341 00342 extern void print_address (struct gdbarch *, CORE_ADDR, struct ui_file *); 00343 extern const char *pc_prefix (CORE_ADDR); 00344 00345 /* From source.c */ 00346 00347 /* See openp function definition for their description. */ 00348 #define OPF_TRY_CWD_FIRST 0x01 00349 #define OPF_SEARCH_IN_PATH 0x02 00350 #define OPF_RETURN_REALPATH 0x04 00351 00352 extern int openp (const char *, int, const char *, int, char **); 00353 00354 extern int source_full_path_of (const char *, char **); 00355 00356 extern void mod_path (char *, char **); 00357 00358 extern void add_path (char *, char **, int); 00359 00360 extern void directory_switch (char *, int); 00361 00362 extern char *source_path; 00363 00364 extern void init_source_path (void); 00365 00366 /* From exec.c */ 00367 00368 /* Process memory area starting at ADDR with length SIZE. Area is readable iff 00369 READ is non-zero, writable if WRITE is non-zero, executable if EXEC is 00370 non-zero. Area is possibly changed against its original file based copy if 00371 MODIFIED is non-zero. DATA is passed without changes from a caller. */ 00372 00373 typedef int (*find_memory_region_ftype) (CORE_ADDR addr, unsigned long size, 00374 int read, int write, int exec, 00375 int modified, void *data); 00376 00377 /* Take over the 'find_mapped_memory' vector from exec.c. */ 00378 extern void exec_set_find_memory_regions 00379 (int (*func) (find_memory_region_ftype func, void *data)); 00380 00381 /* Possible lvalue types. Like enum language, this should be in 00382 value.h, but needs to be here for the same reason. */ 00383 00384 enum lval_type 00385 { 00386 /* Not an lval. */ 00387 not_lval, 00388 /* In memory. */ 00389 lval_memory, 00390 /* In a register. Registers are relative to a frame. */ 00391 lval_register, 00392 /* In a gdb internal variable. */ 00393 lval_internalvar, 00394 /* Part of a gdb internal variable (structure field). */ 00395 lval_internalvar_component, 00396 /* Value's bits are fetched and stored using functions provided by 00397 its creator. */ 00398 lval_computed 00399 }; 00400 00401 /* Control types for commands */ 00402 00403 enum misc_command_type 00404 { 00405 ok_command, 00406 end_command, 00407 else_command, 00408 nop_command 00409 }; 00410 00411 enum command_control_type 00412 { 00413 simple_control, 00414 break_control, 00415 continue_control, 00416 while_control, 00417 if_control, 00418 commands_control, 00419 python_control, 00420 while_stepping_control, 00421 invalid_control 00422 }; 00423 00424 /* Structure for saved commands lines 00425 (for breakpoints, defined commands, etc). */ 00426 00427 struct command_line 00428 { 00429 struct command_line *next; 00430 char *line; 00431 enum command_control_type control_type; 00432 /* The number of elements in body_list. */ 00433 int body_count; 00434 /* For composite commands, the nested lists of commands. For 00435 example, for "if" command this will contain the then branch and 00436 the else branch, if that is available. */ 00437 struct command_line **body_list; 00438 }; 00439 00440 extern struct command_line *read_command_lines (char *, int, int, 00441 void (*)(char *, void *), 00442 void *); 00443 extern struct command_line *read_command_lines_1 (char * (*) (void), int, 00444 void (*)(char *, void *), 00445 void *); 00446 00447 extern void free_command_lines (struct command_line **); 00448 00449 /* Parameters of the "info proc" command. */ 00450 00451 enum info_proc_what 00452 { 00453 /* Display the default cmdline, cwd and exe outputs. */ 00454 IP_MINIMAL, 00455 00456 /* Display `info proc mappings'. */ 00457 IP_MAPPINGS, 00458 00459 /* Display `info proc status'. */ 00460 IP_STATUS, 00461 00462 /* Display `info proc stat'. */ 00463 IP_STAT, 00464 00465 /* Display `info proc cmdline'. */ 00466 IP_CMDLINE, 00467 00468 /* Display `info proc exe'. */ 00469 IP_EXE, 00470 00471 /* Display `info proc cwd'. */ 00472 IP_CWD, 00473 00474 /* Display all of the above. */ 00475 IP_ALL 00476 }; 00477 00478 /* String containing the current directory (what getwd would return). */ 00479 00480 extern char *current_directory; 00481 00482 /* Default radixes for input and output. Only some values supported. */ 00483 extern unsigned input_radix; 00484 extern unsigned output_radix; 00485 00486 /* Possibilities for prettyformat parameters to routines which print 00487 things. Like enum language, this should be in value.h, but needs 00488 to be here for the same reason. FIXME: If we can eliminate this 00489 as an arg to LA_VAL_PRINT, then we can probably move it back to 00490 value.h. */ 00491 00492 enum val_prettyformat 00493 { 00494 Val_no_prettyformat = 0, 00495 Val_prettyformat, 00496 /* Use the default setting which the user has specified. */ 00497 Val_prettyformat_default 00498 }; 00499 00500 /* Optional native machine support. Non-native (and possibly pure 00501 multi-arch) targets do not need a "nm.h" file. This will be a 00502 symlink to one of the nm-*.h files, built by the `configure' 00503 script. */ 00504 00505 #ifdef GDB_NM_FILE 00506 #include "nm.h" 00507 #endif 00508 00509 /* Assume that fopen accepts the letter "b" in the mode string. 00510 It is demanded by ISO C9X, and should be supported on all 00511 platforms that claim to have a standard-conforming C library. On 00512 true POSIX systems it will be ignored and have no effect. There 00513 may still be systems without a standard-conforming C library where 00514 an ISO C9X compiler (GCC) is available. Known examples are SunOS 00515 4.x and 4.3BSD. This assumption means these systems are no longer 00516 supported. */ 00517 #ifndef FOPEN_RB 00518 # include "fopen-bin.h" 00519 #endif 00520 00521 /* Defaults for system-wide constants (if not defined by xm.h, we fake it). 00522 FIXME: Assumes 2's complement arithmetic. */ 00523 00524 #if !defined (UINT_MAX) 00525 #define UINT_MAX ((unsigned int)(~0)) /* 0xFFFFFFFF for 32-bits */ 00526 #endif 00527 00528 #if !defined (INT_MAX) 00529 #define INT_MAX ((int)(UINT_MAX >> 1)) /* 0x7FFFFFFF for 32-bits */ 00530 #endif 00531 00532 #if !defined (INT_MIN) 00533 #define INT_MIN ((int)((int) ~0 ^ INT_MAX)) /* 0x80000000 for 32-bits */ 00534 #endif 00535 00536 #if !defined (ULONG_MAX) 00537 #define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF for 32-bits */ 00538 #endif 00539 00540 #if !defined (LONG_MAX) 00541 #define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF for 32-bits */ 00542 #endif 00543 00544 #if !defined (ULONGEST_MAX) 00545 #define ULONGEST_MAX (~(ULONGEST)0) /* 0xFFFFFFFFFFFFFFFF for 64-bits */ 00546 #endif 00547 00548 #if !defined (LONGEST_MAX) /* 0x7FFFFFFFFFFFFFFF for 64-bits */ 00549 #define LONGEST_MAX ((LONGEST)(ULONGEST_MAX >> 1)) 00550 #endif 00551 00552 /* Convert a LONGEST to an int. This is used in contexts (e.g. number of 00553 arguments to a function, number in a value history, register number, etc.) 00554 where the value must not be larger than can fit in an int. */ 00555 00556 extern int longest_to_int (LONGEST); 00557 00558 /* Utility macros to allocate typed memory. Avoids errors like: 00559 struct foo *foo = xmalloc (sizeof struct bar); and memset (foo, 00560 sizeof (struct foo), 0). */ 00561 #define XZALLOC(TYPE) ((TYPE*) xzalloc (sizeof (TYPE))) 00562 #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) 00563 #define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE))) 00564 00565 #include "common-utils.h" 00566 00567 /* List of known OS ABIs. If you change this, make sure to update the 00568 table in osabi.c. */ 00569 enum gdb_osabi 00570 { 00571 GDB_OSABI_UNINITIALIZED = -1, /* For struct gdbarch_info. */ 00572 00573 GDB_OSABI_UNKNOWN = 0, /* keep this zero */ 00574 00575 GDB_OSABI_SVR4, 00576 GDB_OSABI_HURD, 00577 GDB_OSABI_SOLARIS, 00578 GDB_OSABI_OSF1, 00579 GDB_OSABI_LINUX, 00580 GDB_OSABI_FREEBSD_AOUT, 00581 GDB_OSABI_FREEBSD_ELF, 00582 GDB_OSABI_NETBSD_AOUT, 00583 GDB_OSABI_NETBSD_ELF, 00584 GDB_OSABI_OPENBSD_ELF, 00585 GDB_OSABI_WINCE, 00586 GDB_OSABI_GO32, 00587 GDB_OSABI_IRIX, 00588 GDB_OSABI_HPUX_ELF, 00589 GDB_OSABI_HPUX_SOM, 00590 GDB_OSABI_QNXNTO, 00591 GDB_OSABI_CYGWIN, 00592 GDB_OSABI_AIX, 00593 GDB_OSABI_DICOS, 00594 GDB_OSABI_DARWIN, 00595 GDB_OSABI_SYMBIAN, 00596 GDB_OSABI_OPENVMS, 00597 GDB_OSABI_LYNXOS178, 00598 GDB_OSABI_NEWLIB, 00599 00600 GDB_OSABI_INVALID /* keep this last */ 00601 }; 00602 00603 /* Global functions from other, non-gdb GNU thingies. 00604 Libiberty thingies are no longer declared here. We include libiberty.h 00605 above, instead. */ 00606 00607 /* From other system libraries */ 00608 00609 #ifdef HAVE_STDDEF_H 00610 #include <stddef.h> 00611 #endif 00612 00613 #ifdef HAVE_STDLIB_H 00614 #include <stdlib.h> 00615 #endif 00616 00617 00618 #ifndef atof 00619 extern double atof (const char *); /* X3.159-1989 4.10.1.1 */ 00620 #endif 00621 00622 /* Various possibilities for alloca. */ 00623 #ifndef alloca 00624 #ifdef __GNUC__ 00625 #define alloca __builtin_alloca 00626 #else /* Not GNU C */ 00627 #ifdef HAVE_ALLOCA_H 00628 #include <alloca.h> 00629 #else 00630 #ifdef _AIX 00631 #pragma alloca 00632 #else 00633 00634 /* We need to be careful not to declare this in a way which conflicts with 00635 bison. Bison never declares it as char *, but under various circumstances 00636 (like __hpux) we need to use void *. */ 00637 extern void *alloca (); 00638 #endif /* Not _AIX */ 00639 #endif /* Not HAVE_ALLOCA_H */ 00640 #endif /* Not GNU C */ 00641 #endif /* alloca not defined */ 00642 00643 /* Dynamic target-system-dependent parameters for GDB. */ 00644 #include "gdbarch.h" 00645 00646 /* Maximum size of a register. Something small, but large enough for 00647 all known ISAs. If it turns out to be too small, make it bigger. */ 00648 00649 enum { MAX_REGISTER_SIZE = 64 }; 00650 00651 /* Static target-system-dependent parameters for GDB. */ 00652 00653 /* Number of bits in a char or unsigned char for the target machine. 00654 Just like CHAR_BIT in <limits.h> but describes the target machine. */ 00655 #if !defined (TARGET_CHAR_BIT) 00656 #define TARGET_CHAR_BIT 8 00657 #endif 00658 00659 /* If we picked up a copy of CHAR_BIT from a configuration file 00660 (which may get it by including <limits.h>) then use it to set 00661 the number of bits in a host char. If not, use the same size 00662 as the target. */ 00663 00664 #if defined (CHAR_BIT) 00665 #define HOST_CHAR_BIT CHAR_BIT 00666 #else 00667 #define HOST_CHAR_BIT TARGET_CHAR_BIT 00668 #endif 00669 00670 /* In findvar.c. */ 00671 00672 extern LONGEST extract_signed_integer (const gdb_byte *, int, 00673 enum bfd_endian); 00674 00675 extern ULONGEST extract_unsigned_integer (const gdb_byte *, int, 00676 enum bfd_endian); 00677 00678 extern int extract_long_unsigned_integer (const gdb_byte *, int, 00679 enum bfd_endian, LONGEST *); 00680 00681 extern CORE_ADDR extract_typed_address (const gdb_byte *buf, 00682 struct type *type); 00683 00684 extern void store_signed_integer (gdb_byte *, int, 00685 enum bfd_endian, LONGEST); 00686 00687 extern void store_unsigned_integer (gdb_byte *, int, 00688 enum bfd_endian, ULONGEST); 00689 00690 extern void store_typed_address (gdb_byte *buf, struct type *type, 00691 CORE_ADDR addr); 00692 00693 00694 /* From valops.c */ 00695 00696 extern int watchdog; 00697 00698 /* Hooks for alternate command interfaces. */ 00699 00700 /* The name of the interpreter if specified on the command line. */ 00701 extern char *interpreter_p; 00702 00703 /* If a given interpreter matches INTERPRETER_P then it should update 00704 deprecated_init_ui_hook with the per-interpreter implementation. */ 00705 /* FIXME: deprecated_init_ui_hook should be moved here. */ 00706 00707 struct target_waitstatus; 00708 struct cmd_list_element; 00709 00710 extern void (*deprecated_pre_add_symbol_hook) (const char *); 00711 extern void (*deprecated_post_add_symbol_hook) (void); 00712 extern void (*selected_frame_level_changed_hook) (int); 00713 extern int (*deprecated_ui_loop_hook) (int signo); 00714 extern void (*deprecated_init_ui_hook) (char *argv0); 00715 extern void (*deprecated_show_load_progress) (const char *section, 00716 unsigned long section_sent, 00717 unsigned long section_size, 00718 unsigned long total_sent, 00719 unsigned long total_size); 00720 extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, 00721 int line, 00722 int stopline, 00723 int noerror); 00724 extern int (*deprecated_query_hook) (const char *, va_list) 00725 ATTRIBUTE_FPTR_PRINTF(1,0); 00726 extern void (*deprecated_warning_hook) (const char *, va_list) 00727 ATTRIBUTE_FPTR_PRINTF(1,0); 00728 extern void (*deprecated_flush_hook) (struct ui_file * stream); 00729 extern void (*deprecated_interactive_hook) (void); 00730 extern void (*deprecated_readline_begin_hook) (char *, ...) 00731 ATTRIBUTE_FPTR_PRINTF_1; 00732 extern char *(*deprecated_readline_hook) (char *); 00733 extern void (*deprecated_readline_end_hook) (void); 00734 extern void (*deprecated_register_changed_hook) (int regno); 00735 extern void (*deprecated_context_hook) (int); 00736 extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid, 00737 struct target_waitstatus *status, 00738 int options); 00739 00740 extern void (*deprecated_attach_hook) (void); 00741 extern void (*deprecated_detach_hook) (void); 00742 extern void (*deprecated_call_command_hook) (struct cmd_list_element * c, 00743 char *cmd, int from_tty); 00744 00745 extern void (*deprecated_set_hook) (struct cmd_list_element * c); 00746 00747 extern int (*deprecated_ui_load_progress_hook) (const char *section, 00748 unsigned long num); 00749 00750 /* Inhibit window interface if non-zero. */ 00751 00752 extern int use_windows; 00753 00754 /* If this definition isn't overridden by the header files, assume 00755 that isatty and fileno exist on this system. */ 00756 #ifndef ISATTY 00757 #define ISATTY(FP) (isatty (fileno (FP))) 00758 #endif 00759 00760 /* A width that can achieve a better legibility for GDB MI mode. */ 00761 #define GDB_MI_MSG_WIDTH 80 00762 00763 /* From progspace.c */ 00764 00765 extern void initialize_progspace (void); 00766 extern void initialize_inferiors (void); 00767 00768 /* Special block numbers */ 00769 00770 enum block_enum 00771 { 00772 GLOBAL_BLOCK = 0, 00773 STATIC_BLOCK = 1, 00774 FIRST_LOCAL_BLOCK = 2 00775 }; 00776 00777 #include "utils.h" 00778 00779 #endif /* #ifndef DEFS_H */