diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9f84f717cd..af1c34a7db 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-07-10 Andrew Cagney + + * gdbarch.sh: When a variable, but not a function, compare against + 0. Fix problem in previous patch. + * gdbarch.c: Re-generate. + 2003-07-10 Andrew Cagney * gdbarch.sh: Use gdb_assert instead of internal_error. Compare diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 7333952893..8567c0555a 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -3422,7 +3422,7 @@ int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_max_register_raw_size != NULL; + return gdbarch->deprecated_max_register_raw_size != 0; } int @@ -3445,7 +3445,7 @@ int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_max_register_virtual_size != NULL; + return gdbarch->deprecated_max_register_virtual_size != 0; } int @@ -3802,7 +3802,7 @@ int gdbarch_deprecated_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); - return gdbarch->deprecated_call_dummy_stack_adjust != NULL; + return gdbarch->deprecated_call_dummy_stack_adjust != 0; } int diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 0688559800..75687f6a65 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -1732,7 +1732,11 @@ do if [ -n "${predicate}" ] then printf " return ${predicate};\n" - else + elif class_is_variable_p + then + printf " return gdbarch->${function} != 0;\n" + elif class_is_function_p + then printf " return gdbarch->${function} != NULL;\n" fi printf "}\n"