From bd5d07d94c9a05601299885ae906ec2d6f000ba9 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Thu, 11 Mar 1993 17:44:39 +0000 Subject: * utils.c (fputs_demangled): Complete rewrite to clean up and add a language parameter that is used to select the demangling algorithm. * defs.h (enum language): Move further up in file so enum can be used in prototypes. * defs.h (fputs_demangled): Update prototype to add lang arg. * c-typeprint.c (cp_type_print_method_args): Add language arg to fputs_demangled calls, remove DMGL_PARAMS flag. * stack.c (print_frame_info): Remove obsolete code so we don't have to update fputs_demangled usage in it. * stack.c (print_frame_info, frame_info): Add language variable to pass to fputs_demangled and initialize it from the symbol's language. Call fputs_demangled with language arg. * symtab.c (find_methods): Add language arg to fputs_demangled call. --- gdb/defs.h | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) (limited to 'gdb/defs.h') diff --git a/gdb/defs.h b/gdb/defs.h index 283b589..9c13881 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -36,7 +36,7 @@ typedef unsigned int CORE_ADDR; /* 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)) : *(a) - *(b)) +#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) @@ -72,6 +72,23 @@ enum command_class 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++ */ + /* start-sanitize-chill */ + language_chill, /* Chill */ + /* end-sanitize-chill */ + language_m2 /* Modula-2 */ +}; + /* 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 @@ -247,7 +264,7 @@ extern void fprint_symbol PARAMS ((FILE *, char *)); extern void -fputs_demangled PARAMS ((char *, FILE *, int)); +fputs_demangled PARAMS ((char *, FILE *, int, enum language)); extern void perror_with_name PARAMS ((char *)); @@ -349,23 +366,6 @@ 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. - 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++ */ - /* start-sanitize-chill */ - language_chill, /* Chill */ - /* end-sanitize-chill */ - language_m2 /* Modula-2 */ -}; - /* 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 @@ -538,6 +538,17 @@ enum val_prettyprint # endif #endif +/* If we picked up a copy of CHAR_BIT from a configuration file + (which may get it by including ) 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. */ -- cgit v1.1