+2003-05-23 Andrew Cagney <cagney@redhat.com>
+
+ * objc-lang.c: Include "gdb_assert.h".
+ (objc_op_print_tab): Use OP_NULL and PREC_NULL instead of 0.
+ (CHECK, CHECK_FATAL, __CHECK_FUNCTION): Delete macros.
+ (gdb_check, gdb_check_fatal): Delete functions.
+ (read_objc_methlist_method): Replace CHECK and CHECK_FATAL with
+ gdb_assert.
+ (parse_selector, parse_method, find_methods, find_imps): Ditto.
+ * Makefile.in (objc-lang.o): Update dependencies.
+
2003-05-22 Ian Lance Taylor <ian@airs.com>
* disasm.c (gdb_disassemble_info): Initialize disassemble_info
#include "block.h"
#include "infcall.h"
#include "valprint.h"
+#include "gdb_assert.h"
#include <ctype.h>
CORE_ADDR imp;
};
-/* Complaints about ObjC classes, selectors, etc. */
-
-#if (!defined __GNUC__ || __GNUC__ < 2 || __GNUC_MINOR__ < (defined __cplusplus ? 6 : 4))
-#define __CHECK_FUNCTION ((__const char *) 0)
-#else
-#define __CHECK_FUNCTION __PRETTY_FUNCTION__
-#endif
-
-#define CHECK(expression) \
- ((void) ((expression) ? 0 : gdb_check (#expression, __FILE__, __LINE__, \
- __CHECK_FUNCTION)))
-
-#define CHECK_FATAL(expression) \
- ((void) ((expression) ? 0 : gdb_check_fatal (#expression, __FILE__, \
- __LINE__, __CHECK_FUNCTION)))
-
-static void
-gdb_check (const char *str, const char *file,
- unsigned int line, const char *func)
-{
- error ("assertion failure on line %u of \"%s\" in function \"%s\": %s\n",
- line, file, func, str);
-}
-
-static void
-gdb_check_fatal (const char *str, const char *file,
- unsigned int line, const char *func)
-{
- internal_error (file, line,
- "assertion failure in function \"%s\": %s\n", func, str);
-}
-
/* Lookup a structure type named "struct NAME", visible in lexical
block BLOCK. If NOERR is nonzero, return zero if NAME is not
suitably defined. */
{"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
{"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
{"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_NULL, 0}
};
struct type ** const (objc_builtin_types[]) =
char *nselector = NULL;
- CHECK (selector != NULL);
+ gdb_assert (selector != NULL);
s1 = method;
char *ncategory = NULL;
char *nselector = NULL;
- CHECK (type != NULL);
- CHECK (class != NULL);
- CHECK (category != NULL);
- CHECK (selector != NULL);
+ gdb_assert (type != NULL);
+ gdb_assert (class != NULL);
+ gdb_assert (category != NULL);
+ gdb_assert (selector != NULL);
s1 = method;
static char *tmp = NULL;
static unsigned int tmplen = 0;
- CHECK (nsym != NULL);
- CHECK (ndebug != NULL);
+ gdb_assert (nsym != NULL);
+ gdb_assert (ndebug != NULL);
if (symtab)
block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
char *buf = NULL;
char *tmp = NULL;
- CHECK (nsym != NULL);
- CHECK (ndebug != NULL);
+ gdb_assert (nsym != NULL);
+ gdb_assert (ndebug != NULL);
if (nsym != NULL)
*nsym = 0;
read_objc_methlist_method (CORE_ADDR addr, unsigned long num,
struct objc_method *method)
{
- CHECK_FATAL (num < read_objc_methlist_nmethods (addr));
+ gdb_assert (num < read_objc_methlist_nmethods (addr));
read_objc_method (addr + 8 + (12 * num), method);
}