From 4fa62494657f9b422edd7049c7207bd6c6849c3f Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Wed, 3 Jun 2009 18:16:44 +0000 Subject: * value.h (struct internalvar): Remove. (get_internalvar_integer): Add prototype. (set_internalvar_integer): Add prototype. (clear_internalvar): Add prototype. * value.c (struct internalvar): Move here. Add type member. Remove endian member. Add union_internalvar member instead of value member. (init_if_undefined_command): Use intvar->type. (create_internalvar): Do not initialize value/endian, but type. (create_internalvar_type_lazy): Call create_internalvar. (value_of_internalvar): Handle host-side internalvar contents. (set_internalvar_component): Likewise. (set_internalvar): Likewise. (get_internalvar_integer): New function. (clear_internalvar): Likewise. (set_internalvar_integer): Likewise. (preserve_values): Handle host-side internalvar contents. * breakpoint.c (set_breakpoint_count, set_tracepoint_count): Call set_internalvar_integer instead of set_internalvar. * findcmd.c (find_command): Likewise. * infrun.c (handle_inferior_event): Likewise. * source.c (forward_search_command, reverse_search_command): Likewise. * tracepoint.c (set_traceframe_num, set_tracepoint_num, set_traceframe_context): Likewise. * printcmd.c (x_command): Call clear_internalvar instead of set_internalvar. * tracepoint.c (set_traceframe_context): Likewise. * breakpoint.c (get_number_trailer): Call get_internalvar_integer instead of value_of_internalvar. * linespec.c (decode_dollar): Likewise. * expprint.c (dump_subexp_body_standard): Use internalvar_name instead of accessing internalvar private elements. * valops.c (value_assign): Copy from original source instead of accessing internalvar private elements. --- gdb/source.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gdb/source.c') diff --git a/gdb/source.c b/gdb/source.c index e1bbb7f..e476616 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1615,9 +1615,7 @@ forward_search_command (char *regex, int from_tty) /* Match! */ fclose (stream); print_source_lines (current_source_symtab, line, line + 1, 0); - set_internalvar (lookup_internalvar ("_"), - value_from_longest (builtin_type_int32, - (LONGEST) line)); + set_internalvar_integer (lookup_internalvar ("_"), line); current_source_line = max (line - lines_to_list / 2, 1); return; } @@ -1695,9 +1693,7 @@ reverse_search_command (char *regex, int from_tty) /* Match! */ fclose (stream); print_source_lines (current_source_symtab, line, line + 1, 0); - set_internalvar (lookup_internalvar ("_"), - value_from_longest (builtin_type_int32, - (LONGEST) line)); + set_internalvar_integer (lookup_internalvar ("_"), line); current_source_line = max (line - lines_to_list / 2, 1); return; } -- cgit v1.1