aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:11:19 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:11:19 +0000
commit78267919d631833aaba8deb8c2febf119f653227 (patch)
treeb93b76222a651d83775ceee1dbee898b4224e72b /gdb/tracepoint.c
parent0daa2b63ccc8c016d21d06513058310385cfa221 (diff)
downloadgdb-78267919d631833aaba8deb8c2febf119f653227.zip
gdb-78267919d631833aaba8deb8c2febf119f653227.tar.gz
gdb-78267919d631833aaba8deb8c2febf119f653227.tar.bz2
* gdbtypes.h (struct builtin_type): Add internal_fn member.
* gdbtypes.c (gdbtypes_post_init): Initialize it. * value.c (internal_fn_type): Remove. (_initialize_values): Do not initialize it. * value.c (struct internalvar): Add enum internalvar_kind type and kind member. Restructure union internalvar_data type. Remove type, canonical, and make_value members. (init_if_undefined_command): Update for data structure changes. (create_internalvar): Likewise. (create_internalvar_type_lazy): Likewise. (get_internalvar_integer): Likewise. (get_internalvar_function): Likewise. (set_internalvar_component): Likewise. (set_internalvar): Likewise. (set_internalvar_integer): Likewise. (set_internalvar_function): Likewise. (clear_internalvar): Likewise. (add_internal_function): Likewise. (preserve_one_internalvar): New function. (preserve_values): Call it. * value.h (value_of_internalvar): Add GDBARCH parameter. (internalvar_make_value): Likewise. * value.c (value_of_internalvar): Add GDBARCH parameter. Pass it to make_value callback. Use it to generate per-architecture result value types for internal variables with no pre-defined type. Update for data structure changes. (show_convenience): Pass architecture to value_of_internalvar. * eval.c (evaluate_subexp_standard): Likewise. * infrun.c (siginfo_make_value): Add GDBARCH parameter. Use it instead of current frame architecture. Return per-architecture type. * value.h (set_internalvar_string): Add prototype. * value.c (set_internalvar_string): New function. * tracepoint.c (set_traceframe_context): Use it.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 7da4b16..dcd3df7 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -228,12 +228,6 @@ set_traceframe_context (struct frame_info *trace_frame)
{
CORE_ADDR trace_pc;
- static struct type *func_string, *file_string;
- static struct type *func_range, *file_range;
- struct value *func_val;
- struct value *file_val;
- int len;
-
if (trace_frame == NULL) /* Cease debugging any trace buffers. */
{
traceframe_fun = 0;
@@ -261,20 +255,8 @@ set_traceframe_context (struct frame_info *trace_frame)
|| SYMBOL_LINKAGE_NAME (traceframe_fun) == NULL)
clear_internalvar (lookup_internalvar ("trace_func"));
else
- {
- len = strlen (SYMBOL_LINKAGE_NAME (traceframe_fun));
- func_range = create_range_type (func_range,
- builtin_type_int32, 0, len - 1);
- func_string = create_array_type (func_string,
- builtin_type_true_char, func_range);
- func_val = allocate_value (func_string);
- deprecated_set_value_type (func_val, func_string);
- memcpy (value_contents_raw (func_val),
- SYMBOL_LINKAGE_NAME (traceframe_fun),
- len);
- deprecated_set_value_modifiable (func_val, 0);
- set_internalvar (lookup_internalvar ("trace_func"), func_val);
- }
+ set_internalvar_string (lookup_internalvar ("trace_func"),
+ SYMBOL_LINKAGE_NAME (traceframe_fun));
/* Save file name as "$trace_file", a debugger variable visible to
users. */
@@ -282,20 +264,8 @@ set_traceframe_context (struct frame_info *trace_frame)
|| traceframe_sal.symtab->filename == NULL)
clear_internalvar (lookup_internalvar ("trace_file"));
else
- {
- len = strlen (traceframe_sal.symtab->filename);
- file_range = create_range_type (file_range,
- builtin_type_int32, 0, len - 1);
- file_string = create_array_type (file_string,
- builtin_type_true_char, file_range);
- file_val = allocate_value (file_string);
- deprecated_set_value_type (file_val, file_string);
- memcpy (value_contents_raw (file_val),
- traceframe_sal.symtab->filename,
- len);
- deprecated_set_value_modifiable (file_val, 0);
- set_internalvar (lookup_internalvar ("trace_file"), file_val);
- }
+ set_internalvar_string (lookup_internalvar ("trace_file"),
+ traceframe_sal.symtab->filename);
}
/* ACTIONS functions: */