#define max(a, b) ((a) > (b) ? (a) : (b))
#endif
-/* Gdb does *lots* of string compares. Use macros to speed them up by
- avoiding function calls if the first characters are not the same. */
+/* Macros to do string compares.
+
+ NOTE: cagney/2000-03-14:
+
+ While old code can continue to refer to these macros, new code is
+ probably better off using strcmp() directly vis: ``strcmp() == 0''
+ and ``strcmp() != 0''.
+
+ This is because modern compilers can directly inline strcmp()
+ making the original justification for these macros - avoid function
+ call overhead by pre-testing the first characters
+ (``*X==*Y?...:0'') - redundant.
+
+ ``Even if [...] testing the first character does have a modest
+ performance improvement, I'd rather that whenever a performance
+ issue is found that we spend the effort on algorithmic
+ optimizations than micro-optimizing.'' J.T. */
#define STRCMP(a,b) (*(a) == *(b) ? strcmp ((a), (b)) : (int)*(a) - (int)*(b))
#define STREQ(a,b) (*(a) == *(b) ? !strcmp ((a), (b)) : 0)
-#define STREQ_IW(a,b) (*(a) == *(b) ? !strcmp_iw ((a), (b)) : 0)
#define STREQN(a,b,c) (*(a) == *(b) ? !strncmp ((a), (b), (c)) : 0)
/* The character GNU C++ uses to build identifiers that must be unique from
extern void quit (void);
+/* FIXME: cagney/2000-03-13: It has been suggested that the peformance
+ benefits of having a ``QUIT'' macro rather than a function are
+ marginal. If the overhead of a QUIT function call is proving
+ significant then its calling frequency should probably be reduced
+ [kingdon]. A profile analyzing the current situtation is
+ needed. */
+
#ifdef QUIT
/* do twice to force compiler warning */
#define QUIT_FIXME "FIXME"
char *);
extern int build_address_symbolic (CORE_ADDR addr,
- int do_demangle,
- char **name,
- int *offset,
- char **filename,
- int *line,
+ int do_demangle,
+ char **name,
+ int *offset,
+ char **filename,
+ int *line,
int *unmapped);
extern void print_address_numeric (CORE_ADDR, int, struct ui_file *);
extern void free_command_lines (struct command_line **);
-/* To continue the execution commands when running gdb asynchronously.
- A continuation structure contains a pointer to a function to be called
+/* To continue the execution commands when running gdb asynchronously.
+ A continuation structure contains a pointer to a function to be called
to finish the command, once the target has stopped. Such mechanism is
used bt the finish and until commands, and in the remote protocol
when opening an extended-remote connection. */
extern int longest_to_int (LONGEST);
-/* Assorted functions we can declare, now that const and volatile are
+/* Assorted functions we can declare, now that const and volatile are
defined. */
extern char *savestring (const char *, int);
extern void (*init_ui_hook) (char *argv0);
extern void (*command_loop_hook) (void);
extern void (*show_load_progress) (const char *section,
- unsigned long section_sent,
- unsigned long section_size,
- unsigned long total_sent,
+ unsigned long section_sent,
+ unsigned long section_size,
+ unsigned long total_sent,
unsigned long total_size);
extern void (*print_frame_info_listing_hook) (struct symtab * s,
int line, int stopline,