📄 defs.h
字号:
/* Basic, host-specific, and target-specific definitions for GDB. Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc.This file is part of GDB.This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */#if !defined (DEFS_H)#define DEFS_H 1#include <limits.h>#include <stdio.h>/* First include ansidecl.h so we can use the various macro definitions here and in all subsequent file inclusions. */#include "ansidecl.h"/* An address in the program being debugged. Host byte order. */typedef unsigned int CORE_ADDR;#define min(a, b) ((a) < (b) ? (a) : (b))#define max(a, b) ((a) > (b) ? (a) : (b))/* The character C++ uses to build identifiers that must be unique from the program's identifiers (such as $this and $$vptr). */#define CPLUS_MARKER '$' /* May be overridden to '.' for SysV */#include <errno.h> /* System call error return status */extern int quit_flag;extern int immediate_quit;extern voidquit PARAMS ((void));#define QUIT { if (quit_flag) quit (); }/* Command classes are top-level categories into which commands are broken down for "help" purposes. Notes on classes: class_alias is for alias commands which are not abbreviations of the original command. class-pseudo is for commands which are not really commands nor help topics ("stop"). */enum command_class{ /* Special args to help_list */ all_classes = -2, all_commands = -1, /* Classes of commands */ no_class = -1, class_run = 0, class_vars, class_stack, class_files, class_support, class_info, class_breakpoint, class_alias, class_obscure, class_user, class_maintenance, class_pseudo};/* the cleanup list records things that have to be undone if an error happens (descriptors to be closed, memory to be freed, etc.) Each link in the chain records a function to call and an argument to give it. Use make_cleanup to add an element to the cleanup chain. Use do_cleanups to do all cleanup actions back to a given point in the chain. Use discard_cleanups to remove cleanups from the chain back to a given point, not doing them. */struct cleanup{ struct cleanup *next; void (*function) PARAMS ((PTR)); PTR arg;};/* From blockframe.c */extern intinside_entry_func PARAMS ((CORE_ADDR));extern intinside_entry_file PARAMS ((CORE_ADDR addr));extern intinside_main_func PARAMS ((CORE_ADDR pc));/* From cplus-dem.c */extern char *cplus_demangle PARAMS ((const char *, int));extern char *cplus_mangle_opname PARAMS ((char *, int));/* From libmmalloc.a (memory mapped malloc library) */extern PTRmmalloc_attach PARAMS ((int, PTR));extern PTRmmalloc_detach PARAMS ((PTR));extern PTRmmalloc PARAMS ((PTR, long));extern PTRmrealloc PARAMS ((PTR, PTR, long));extern voidmfree PARAMS ((PTR, PTR));extern intmmalloc_setkey PARAMS ((PTR, int, PTR));extern PTRmmalloc_getkey PARAMS ((PTR, int));/* From utils.c */extern char *demangle_and_match PARAMS ((const char *, const char *, int));extern intstrcmp_iw PARAMS ((const char *, const char *));extern char *safe_strerror PARAMS ((int));extern char *safe_strsignal PARAMS ((int));extern voidinit_malloc PARAMS ((PTR));extern voidrequest_quit PARAMS ((int));extern voiddo_cleanups PARAMS ((struct cleanup *));extern voiddiscard_cleanups PARAMS ((struct cleanup *));/* The bare make_cleanup function is one of those rare beasts that takes almost any type of function as the first arg and anything that will fit in a "void *" as the second arg. Should be, once all calls and called-functions are cleaned up:extern struct cleanup *make_cleanup PARAMS ((void (*function) (PTR), PTR)); Until then, lint and/or various type-checking compiler options will complain about make_cleanup calls. It'd be wrong to just cast things, since the type actually passed when the function is called would be wrong. */extern struct cleanup *make_cleanup ();extern struct cleanup *save_cleanups PARAMS ((void));extern voidrestore_cleanups PARAMS ((struct cleanup *));extern voidfree_current_contents PARAMS ((char **));extern voidnull_cleanup PARAMS ((char **));extern intmyread PARAMS ((int, char *, int));extern intquery ();extern voidwrap_here PARAMS ((char *));extern voidreinitialize_more_filter PARAMS ((void));extern intprint_insn PARAMS ((CORE_ADDR, FILE *));extern voidfputs_filtered PARAMS ((const char *, FILE *));extern voidputs_filtered PARAMS ((char *));extern voidvfprintf_filtered ();extern voidfprintf_filtered ();extern voidfprintfi_filtered ();extern voidprintf_filtered ();extern voidprintfi_filtered ();extern voidprint_spaces PARAMS ((int, FILE *));extern voidprint_spaces_filtered PARAMS ((int, FILE *));extern char *n_spaces PARAMS ((int));extern voidprintchar PARAMS ((int, FILE *, int));extern char *strdup_demangled PARAMS ((const char *));extern voidfprint_symbol PARAMS ((FILE *, char *));extern voidfputs_demangled PARAMS ((char *, FILE *, int));extern voidperror_with_name PARAMS ((char *));extern voidprint_sys_errmsg PARAMS ((char *, int));/* From regex.c */extern char *re_comp PARAMS ((char *));/* From symfile.c */extern voidsymbol_file_command PARAMS ((char *, int));/* From main.c */extern char *skip_quoted PARAMS ((char *));extern char *gdb_readline PARAMS ((char *));extern char *command_line_input PARAMS ((char *, int));extern voidprint_prompt PARAMS ((void));extern intbatch_mode PARAMS ((void));extern intinput_from_terminal_p PARAMS ((void));extern intcatch_errors PARAMS ((int (*) (char *), char *, char *));/* From printcmd.c */extern voidset_next_address PARAMS ((CORE_ADDR));extern voidprint_address_symbolic PARAMS ((CORE_ADDR, FILE *, int, char *));extern voidprint_address PARAMS ((CORE_ADDR, FILE *));/* From source.c */extern intopenp PARAMS ((char *, int, char *, int, int, char **));extern voidmod_path PARAMS ((char *, char **));extern voiddirectory_command PARAMS ((char *, int));extern voidinit_source_path PARAMS ((void));/* From findvar.c */extern intread_relative_register_raw_bytes PARAMS ((int, char *));/* From readline (but not in any readline .h files). */extern char *tilde_expand PARAMS ((char *));/* Structure for saved commands lines (for breakpoints, defined commands, etc). */struct command_line{ struct command_line *next; char *line; int type; /* statement type */#define CL_END 0#define CL_NORMAL 1#define CL_WHILE 2#define CL_IF 3#define CL_EXITLOOP 4#define CL_NOP 5 struct command_line *body; /* body of loop for while, body of if */ struct command_line *elsebody; /* body of else part of if */};extern struct command_line *read_command_lines PARAMS ((int));extern voidfree_command_lines PARAMS ((struct command_line *));/* String containing the current directory (what getwd would return). */extern char *current_directory;/* Default radixes for input and output. Only some values supported. */extern unsigned input_radix;extern unsigned output_radix;/* Baud rate specified for communication with serial target systems. */extern char *baud_rate;/* Languages represented in the symbol table and elsewhere. */enum language { language_unknown, /* Language not known */ language_auto, /* Placeholder for automatic setting */ language_c, /* C */ language_cplus, /* C++ */ language_m2 /* Modula-2 */};/* Return a format string for printf that will print a number in the local (language-specific) hexadecimal format. Result is static and is overwritten by the next call. local_hex_format_custom takes printf options like "08" or "l" (to produce e.g. %08x or %lx). */#define local_hex_format() (current_language->la_hex_format)extern char *local_hex_format_custom PARAMS ((char *)); /* language.c *//* Return a string that contains a number formatted in the local (language-specific) hexadecimal format. Result is static and is overwritten by the next call. local_hex_string_custom takes printf options like "08" or "l". */extern char *local_hex_string PARAMS ((int)); /* language.c */extern char *local_hex_string_custom PARAMS ((int, char *)); /* language.c *//* Host machine definition. This will be a symlink to one of the xm-*.h files, built by the `configure' script. */#include "xm.h"/* If the xm.h file did not define the mode string used to open the files, assume that binary files are opened the same way as text files */#ifndef FOPEN_RB#include "fopen-same.h"#endif/* * Allow things in gdb to be declared "const". If compiling ANSI, it * just works. If compiling with gcc but non-ansi, redefine to __const__. * If non-ansi, non-gcc, then eliminate "const" entirely, making those * objects be read-write rather than read-only. */#ifndef const#ifndef __STDC__# ifdef __GNUC__# define const __const__# else# define const /*nothing*/# endif /* GNUC */#endif /* STDC */#endif /* const */#ifndef volatile#ifndef __STDC__# ifdef __GNUC__# define volatile __volatile__# else# define volatile /*nothing*/# endif /* GNUC */#endif /* STDC */#endif /* volatile */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -