2003-05-23 Theodore A. Roth * breakpoint.c: Compiler warning cleanups. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.120 diff -u -r1.120 breakpoint.c --- breakpoint.c 5 May 2003 17:56:54 -0000 1.120 +++ breakpoint.c 23 May 2003 20:44:35 -0000 @@ -187,8 +187,6 @@ static char *ep_parse_optional_if_clause (char **arg); -static char *ep_parse_optional_filename (char **arg); - #if defined(CHILD_INSERT_EXEC_CATCHPOINT) static void catch_exec_command_1 (char *arg, int tempflag, int from_tty); #endif @@ -703,6 +701,11 @@ } +#if !defined (DISABLE_UNSETTABLE_BREAK) +#define DISABLE_UNSETTABLE_BREAK(addr) \ + (0) +#endif + /* insert_breakpoints is used when starting or continuing the program. remove_breakpoints is used when the program stops. Both return zero if successful, @@ -824,7 +827,6 @@ if (val) { /* Can't set the breakpoint. */ -#if defined (DISABLE_UNSETTABLE_BREAK) if (DISABLE_UNSETTABLE_BREAK (b->address)) { /* See also: disable_breakpoints_in_shlibs. */ @@ -843,7 +845,6 @@ "breakpoint #%d\n", b->number); } else -#endif { #ifdef ONE_PROCESS_WRITETEXT process_warning = 1; @@ -961,6 +962,8 @@ if (within_current_scope) { + char *contents; + /* Evaluate the expression and cut the chain of values produced off from the value chain. @@ -968,7 +971,7 @@ laziness to determine what memory GDB actually needed in order to compute the value of the expression. */ v = evaluate_expression (b->exp); - VALUE_CONTENTS(v); + contents = VALUE_CONTENTS(v); value_release_to_mark (mark); b->val_chain = v; @@ -5469,7 +5472,8 @@ #if !defined(TARGET_REGION_OK_FOR_HW_WATCHPOINT) #define TARGET_REGION_OK_FOR_HW_WATCHPOINT(ADDR,LEN) \ - (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(LEN)) + ((void)(ADDR), /* not used, quells warning */\ + TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(LEN)) #endif static int @@ -5783,42 +5787,6 @@ return cond_string; } -/* This function attempts to parse an optional filename from the arg - string. If one is not found, it returns NULL. - - Else, it returns a pointer to the parsed filename. (This function - makes no attempt to verify that a file of that name exists, or is - accessible.) And, it updates arg to point to the first character - following the parsed filename in the arg string. - - Note that clients needing to preserve the returned filename for - future access should copy it to their own buffers. */ -static char * -ep_parse_optional_filename (char **arg) -{ - static char filename[1024]; - char *arg_p = *arg; - int i; - char c; - - if ((*arg_p == '\0') || isspace (*arg_p)) - return NULL; - - for (i = 0;; i++) - { - c = *arg_p; - if (isspace (c)) - c = '\0'; - filename[i] = c; - if (c == '\0') - break; - arg_p++; - } - *arg = arg_p; - - return filename; -} - /* Commands to deal with catching events, such as signals, exceptions, process start/exit, etc. */ @@ -7203,8 +7171,6 @@ int i = hw_watchpoint_used_count (bpt->type, &other_type_used); int mem_cnt = can_use_hardware_watchpoint (bpt->val); - /* Hack around 'unused var' error for some targets here */ - (void) mem_cnt, i; target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT ( bpt->type, i + mem_cnt, other_type_used); /* we can consider of type is bp_hardware_watchpoint, convert to