#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
+/* Gdb does *lots* of string compares. Use macros to speed them up by
+ avoiding function calls if the first characters are not the same. */
+
+#define STRCMP(a,b) (*(a) == *(b) ? strcmp ((a), (b)) : (int)*(a) - (int)*(b))
+#define STREQ(a,b) (*(a) == *(b) ? !strcmp ((a), (b)) : 0)
+#define STREQN(a,b,c) (*(a) == *(b) ? !strncmp ((a), (b), (c)) : 0)
+
/* 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 */
extern int quit_flag;
extern int immediate_quit;
+extern int sevenbit_strings;
extern void
quit PARAMS ((void));
#define QUIT { if (quit_flag) quit (); }
-/* Notes on classes: class_alias is for alias commands which are not
- abbreviations of the original command. */
+/* 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
{
/* 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_alias, class_obscure, class_user, class_maintenance,
+ class_pseudo
+};
+
+/* Languages represented in the symbol table and elsewhere.
+ This should probably be in language.h, but since enum's can't
+ be forward declared to satisfy opaque references before their
+ actual definition, needs to be here. */
+
+enum language
+{
+ language_unknown, /* Language not known */
+ language_auto, /* Placeholder for automatic setting */
+ language_c, /* C */
+ language_cplus, /* C++ */
+ language_chill, /* Chill */
+ language_m2 /* Modula-2 */
};
/* the cleanup list records things that have to be undone
extern int
inside_main_func PARAMS ((CORE_ADDR pc));
-/* From cplus-dem.c */
+/* From ch-lang.c, for the moment. (FIXME) */
+
+extern char *
+chill_demangle PARAMS ((const char *));
+
+/* From libiberty.a */
extern char *
cplus_demangle PARAMS ((const char *, int));
/* From utils.c */
-extern char *
-demangle_and_match PARAMS ((const char *, const char *, int));
-
extern int
strcmp_iw PARAMS ((const char *, const char *));
extern int
query ();
+extern void
+begin_line PARAMS ((void));
+
extern void
wrap_here PARAMS ((char *));
extern void
puts_filtered PARAMS ((char *));
+extern void
+vprintf_filtered ();
+
extern void
vfprintf_filtered ();
n_spaces PARAMS ((int));
extern void
-printchar PARAMS ((int, FILE *, int));
-
-extern char *
-strdup_demangled PARAMS ((const char *));
-
-extern void
-fprint_symbol PARAMS ((FILE *, char *));
+gdb_printchar PARAMS ((int, FILE *, int));
extern void
-fputs_demangled PARAMS ((char *, FILE *, int));
+fprintf_symbol_filtered PARAMS ((FILE *, char *, enum language, int));
extern void
perror_with_name PARAMS ((char *));
/* Baud rate specified for communication with serial target systems. */
extern char *baud_rate;
-/* Languages represented in the symbol table and elsewhere. */
+/* Possibilities for prettyprint parameters to routines which print
+ things. Like enum language, this should be in value.h, but needs
+ to be here for the same reason. FIXME: If we can eliminate this
+ as an arg to LA_VAL_PRINT, then we can probably move it back to
+ value.h. */
-enum language
+enum val_prettyprint
{
- language_unknown, /* Language not known */
- language_auto, /* Placeholder for automatic setting */
- language_c, /* C */
- language_cplus, /* C++ */
- language_m2 /* Modula-2 */
+ Val_no_prettyprint = 0,
+ Val_prettyprint,
+ /* Use the default setting which the user has specified. */
+ Val_pretty_default
};
-/* 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 */
-
\f
/* Host machine definition. This will be a symlink to one of the
xm-*.h files, built by the `configure' script. */
#include "xm.h"
+/* Native machine support. This will be a symlink to one of the
+ nm-*.h files, built by the `configure' script. */
+
+#include "nm.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 */
# endif
#endif
+/* If we picked up a copy of CHAR_BIT from a configuration file
+ (which may get it by including <limits.h>) then use it to set
+ the number of bits in a host char. If not, use the same size
+ as the target. */
+
+#if defined (CHAR_BIT)
+#define HOST_CHAR_BIT CHAR_BIT
+#else
+#define HOST_CHAR_BIT TARGET_CHAR_BIT
+#endif
+
/* Assorted functions we can declare, now that const and volatile are
defined. */
#define MAINTENANCE_CMDS 1
#endif
-#include "energize.h"
-
#endif /* !defined (DEFS_H) */