revert 1.9. Not approved.
[deliverable/binutils-gdb.git] / gdb / defs.h
index ede001b4a5769dd2b24e8f288253aecb33220e57..38e40828c3ce960ca06f25800fd8d65cc1e15911 100644 (file)
@@ -117,12 +117,26 @@ extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs);
 #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
@@ -154,6 +168,13 @@ extern int sevenbit_strings;
 
 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"
@@ -232,7 +253,7 @@ struct cleanup
    works everywhere we use it. */
 
 #ifndef ATTR_NORETURN
-#if defined(__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 7
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
 #define ATTR_NORETURN __attribute__ ((noreturn))
 #else
 #define ATTR_NORETURN          /* nothing */
@@ -240,7 +261,7 @@ struct cleanup
 #endif
 
 #ifndef ATTR_FORMAT
-#if defined(__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 4
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4))
 #define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y)))
 #else
 #define ATTR_FORMAT(type, x, y)        /* nothing */
@@ -333,7 +354,7 @@ extern void restore_cleanups (struct cleanup *);
 extern void restore_final_cleanups (struct cleanup *);
 extern void restore_my_cleanups (struct cleanup **, struct cleanup *);
 
-extern void free_current_contents (char **);
+extern void free_current_contents (void *);
 
 extern void null_cleanup (void *);
 
@@ -517,11 +538,11 @@ extern void print_address_symbolic (CORE_ADDR, struct ui_file *, int,
                                    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 *);
@@ -620,8 +641,8 @@ extern struct command_line *read_command_lines (char *, int);
 
 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. */
@@ -629,7 +650,11 @@ extern void free_command_lines (struct command_line **);
 struct continuation_arg
   {
     struct continuation_arg *next;
-    void *data;
+    union continuation_data {
+      void *pointer;
+      int   integer;
+      long  longint;
+    } data;
   };
 
 struct continuation
@@ -763,7 +788,7 @@ enum val_prettyprint
 
 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);
@@ -959,6 +984,12 @@ extern char *alloca ();
 
 /* Dynamic target-system-dependent parameters for GDB. */
 #include "gdbarch.h"
+#if (GDB_MULTI_ARCH == 0)
+/* Multi-arch targets _should_ be including "arch-utils.h" directly
+   into their *-tdep.c file.  This is a prop to help old non-
+   multi-arch targets to continue to compile. */
+#include "arch-utils.h"
+#endif
 
 /* Static target-system-dependent parameters for GDB. */
 
@@ -1042,12 +1073,16 @@ extern int extract_long_unsigned_integer (void *, int, LONGEST *);
 
 extern CORE_ADDR extract_address (void *, int);
 
+extern CORE_ADDR extract_typed_address (void *buf, struct type *type);
+
 extern void store_signed_integer (void *, int, LONGEST);
 
 extern void store_unsigned_integer (void *, int, ULONGEST);
 
 extern void store_address (void *, int, LONGEST);
 
+extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr);
+
 /* Setup definitions for host and target floating point formats.  We need to
    consider the format for `float', `double', and `long double' for both target
    and host.  We need to do this so that we know what kind of conversions need
@@ -1161,9 +1196,9 @@ extern int event_loop_p;
 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,
This page took 0.026601 seconds and 4 git commands to generate.