This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
Re: insight-weekly-6.8.50-20081103 fails to compile
- From: Kevin Buettner <kevinb at redhat dot com>
- To: insight at sourceware dot org
- Date: Fri, 12 Dec 2008 18:11:55 -0700
- Subject: Re: insight-weekly-6.8.50-20081103 fails to compile
- References: <4916DBDF.3000709@gmail.com>
On Sun, 09 Nov 2008 15:47:27 +0300
Martin Rakhmanov <rakhmanov.martin@gmail.com> wrote:
> Latest available snapshot fails to compile: [...]
Below is a patch which fixes the problem that Martin reported.
Okay?
In gdbtk/ChangeLog:
* generic/gdbtk-cmds.c (valprint.h): Include.
(gdb_eval): Fetch print options via get_formatted_print_options.
Update call to val_print.
(gdb_update_mem): Likewise, but for print_scalar_formatted.
* generic/gdbtk-register.c (valprint.h): Include.
(get_register): Use get_formatted_print_options. Update calls
to val_print.
* generic/gdbtk-wrapper.c (valprint.h): Include.
(wrap_val_print): Use get_formatted_print_options. Delete
variables deref_ref and pretty; assign to equivalent fields
in the value_print_options struct instead. Update call to
val_print.
Index: gdbtk/generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.105
diff -u -p -r1.105 gdbtk-cmds.c
--- gdbtk/generic/gdbtk-cmds.c 22 Sep 2008 18:32:41 -0000 1.105
+++ gdbtk/generic/gdbtk-cmds.c 13 Dec 2008 01:08:59 -0000
@@ -43,6 +43,7 @@
#include "exceptions.h"
#include "language.h"
#include "target.h"
+#include "valprint.h"
/* tcl header files includes varargs.h unless HAS_STDARG is defined,
but gdb uses stdarg.h, so make sure HAS_STDARG is defined. */
@@ -614,6 +615,7 @@ gdb_eval (ClientData clientData, Tcl_Int
struct ui_file *stb;
long dummy;
char *result;
+ struct value_print_options opts;
if (objc != 2 && objc != 3)
{
@@ -624,6 +626,8 @@ gdb_eval (ClientData clientData, Tcl_Int
if (objc == 3)
format = *(Tcl_GetStringFromObj (objv[2], NULL));
+ get_formatted_print_options (&opts, format);
+
expr = parse_expression (Tcl_GetStringFromObj (objv[1], NULL));
old_chain = make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
@@ -633,7 +637,7 @@ gdb_eval (ClientData clientData, Tcl_Int
make_cleanup_ui_file_delete (stb);
val_print (value_type (val), value_contents (val),
value_embedded_offset (val), VALUE_ADDRESS (val),
- stb, format, 0, 0, 0, current_language);
+ stb, 0, &opts, current_language);
result = ui_file_xstrdup (stb, &dummy);
Tcl_SetObjResult (interp, Tcl_NewStringObj (result, -1));
xfree (result);
@@ -2529,9 +2533,13 @@ gdb_update_mem (ClientData clientData, T
}
else
{
+ struct value_print_options opts;
+
+ get_formatted_print_options (&opts, format);
+
/* print memory to our uiout file and set the table's variable */
ui_file_rewind (stb);
- print_scalar_formatted (mptr, val_type, format, asize, stb);
+ print_scalar_formatted (mptr, val_type, &opts, asize, stb);
tmp = ui_file_xstrdup (stb, &dummy);
/* See comments above on max_*_len */
Index: gdbtk/generic/gdbtk-register.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v
retrieving revision 1.35
diff -u -p -r1.35 gdbtk-register.c
--- gdbtk/generic/gdbtk-register.c 12 May 2008 07:24:54 -0000 1.35
+++ gdbtk/generic/gdbtk-register.c 13 Dec 2008 01:09:00 -0000
@@ -26,6 +26,7 @@
#include "target.h"
#include "gdb_string.h"
#include "language.h"
+#include "valprint.h"
#include <tcl.h>
#include "gdbtk.h"
@@ -329,16 +330,22 @@ get_register (int regnum, map_arg arg)
}
else
{
+ struct value_print_options opts;
+
+ get_formatted_print_options (&opts, format);
+ opts.deref_ref = 1;
+ opts.pretty = Val_pretty_default;
+
if ((TYPE_CODE (reg_vtype) == TYPE_CODE_UNION)
&& (strcmp (FIELD_NAME (TYPE_FIELD (reg_vtype, 0)),
gdbarch_register_name (current_gdbarch, regnum)) == 0))
{
val_print (FIELD_TYPE (TYPE_FIELD (reg_vtype, 0)), buffer, 0, 0,
- stb, format, 1, 0, Val_pretty_default, current_language);
+ stb, 0, &opts, current_language);
}
else
val_print (reg_vtype, buffer, 0, 0,
- stb, format, 1, 0, Val_pretty_default, current_language);
+ stb, 0, &opts, current_language);
}
res = ui_file_xstrdup (stb, &dummy);
Index: gdbtk/generic/gdbtk-wrapper.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-wrapper.c,v
retrieving revision 1.17
diff -u -p -r1.17 gdbtk-wrapper.c
--- gdbtk/generic/gdbtk-wrapper.c 14 Jul 2008 23:43:36 -0000 1.17
+++ gdbtk/generic/gdbtk-wrapper.c 13 Dec 2008 01:09:00 -0000
@@ -25,6 +25,7 @@
#include "block.h"
#include "exceptions.h"
#include "language.h"
+#include "valprint.h"
#include "gdbtk-wrapper.h"
/*
@@ -204,21 +205,21 @@ wrap_val_print (char *a)
CORE_ADDR address;
struct ui_file *stream;
int format;
- int deref_ref;
int recurse;
- enum val_prettyprint pretty;
+ struct value_print_options opts;
type = (struct type *) (*args)->args[0].ptr;
valaddr = (gdb_byte *) (*args)->args[1].ptr;
address = *(CORE_ADDR *) (*args)->args[2].ptr;
stream = (struct ui_file *) (*args)->args[3].ptr;
format = (*args)->args[4].integer;
- deref_ref = (*args)->args[5].integer;
+ get_formatted_print_options (&opts, format);
+ opts.deref_ref = (*args)->args[5].integer;
recurse = (*args)->args[6].integer;
- pretty = (enum val_prettyprint) (*args)->args[7].integer;
+ opts.pretty = (enum val_prettyprint) (*args)->args[7].integer;
- val_print (type, valaddr, 0, address, stream, format, deref_ref,
- recurse, pretty, current_language);
+ val_print (type, valaddr, 0, address, stream, recurse, &opts,
+ current_language);
return 1;
}