diff options
author | Fred Fish <fnf@specifix.com> | 1993-03-11 17:44:39 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1993-03-11 17:44:39 +0000 |
commit | bd5d07d94c9a05601299885ae906ec2d6f000ba9 (patch) | |
tree | 2f6f4768ac5c148645c516212720566bec9602ba /gdb/defs.h | |
parent | 0b96ed0655e98bdbca122e06b420ac35181215ca (diff) | |
download | gdb-bd5d07d94c9a05601299885ae906ec2d6f000ba9.zip gdb-bd5d07d94c9a05601299885ae906ec2d6f000ba9.tar.gz gdb-bd5d07d94c9a05601299885ae906ec2d6f000ba9.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/defs.h')
-rw-r--r-- | gdb/defs.h | 49 |
1 files changed, 30 insertions, 19 deletions
@@ -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 <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. */ |