summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/Makefile.in7
-rw-r--r--gdb/gdbtk/ChangeLog11
-rw-r--r--gdb/gdbtk/generic/gdbtk-cmds.c1
-rw-r--r--gdb/gdbtk/generic/gdbtk-stack.c1
-rw-r--r--gdb/gdbtk/generic/gdbtk-varobj.c9
-rw-r--r--gdb/gdbtk/generic/gdbtk-wrapper.c37
-rw-r--r--gdb/gdbtk/generic/gdbtk-wrapper.h3
8 files changed, 68 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index baf40741778..0587fc3ff0b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-27 Maciej W. Rozycki <macro@mips.com>
+
+ * Makefile.in (gdbtk-wrapper.o): Update dependencies.
+ (gdbtk-varobj.o, gdbtk-cmds.o, gdbtk-stack.o): Likewise.
+
2007-04-27 Ulrich Weigand <uweigand@de.ibm.com>
* config/rs6000/nm-rs6000.h (CHILD_SPECIAL_WAITSTATUS): Remove.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index fab430b44b7..d17cd840b71 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2971,7 +2971,7 @@ gdbtk-cmds.o: $(srcdir)/gdbtk/generic/gdbtk-cmds.c \
$(defs_h) $(inferior_h) $(source_h) $(symfile_h) $(objfiles_h) \
$(gdbcore_h) $(demangle_h) $(linespec_h) $(tui_file_h) $(top_h) \
$(annotate_h) $(block_h) $(dictionary_h) $(gdb_string_h) \
- $(dis_asm_h) $(gdbcmd_h)
+ $(dis_asm_h) $(gdbcmd_h) $(varobj_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
$(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-cmds.c \
@@ -3013,7 +3013,7 @@ gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \
$(srcdir)/gdbtk/generic/gdbtk.h $(srcdir)/gdbtk/generic/gdbtk-cmds.h \
$(srcdir)/gdbtk/generic/gdbtk-wrapper.h \
$(defs_h) $(target_h) $(breakpoint_h) $(linespec_h) \
- $(block_h) $(dictionary_h)
+ $(block_h) $(dictionary_h) $(varobj_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
$(GDBTK_CFLAGS) $(srcdir)/gdbtk/generic/gdbtk-stack.c \
@@ -3021,6 +3021,7 @@ gdbtk-stack.o: $(srcdir)/gdbtk/generic/gdbtk-stack.c \
gdbtk-varobj.o: $(srcdir)/gdbtk/generic/gdbtk-varobj.c \
$(srcdir)/gdbtk/generic/gdbtk.h \
+ $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \
$(defs_h) $(value_h) $(varobj_h) $(gdb_string_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(ITCL_CFLAGS) \
$(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) $(GDBTK_CFLAGS)\
@@ -3028,7 +3029,7 @@ gdbtk-varobj.o: $(srcdir)/gdbtk/generic/gdbtk-varobj.c \
gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c \
$(srcdir)/gdbtk/generic/gdbtk-wrapper.h \
- $(defs_h) $(frame_h) $(value_h)
+ $(defs_h) $(frame_h) $(value_h) $(varobj_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(GDBTK_CFLAGS)\
$(srcdir)/gdbtk/generic/gdbtk-wrapper.c
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog
index 3ea690166be..f483455a4da 100644
--- a/gdb/gdbtk/ChangeLog
+++ b/gdb/gdbtk/ChangeLog
@@ -1,3 +1,14 @@
+2007-04-27 Maciej W. Rozycki <macro@mips.com>
+
+ * generic/gdbtk-wrapper.c (GDB_varobj_update): New function.
+ (wrap_varobj_update): Likewise.
+ * generic/gdbtk-wrapper.h (GDB_varobj_update): New declaration.
+ * generic/gdbtk-varobj.c (variable_update): Call
+ GDB_varobj_update() rather than varobj_update() directly. Take
+ the new semantics of the latter into account.
+ * generic/gdbtk-cmds.c: Include "varobj.h".
+ * generic/gdbtk-stack.c: Likewise.
+
2007-03-13 Kevin Buettner <kevinb@redhat.com>
* generic/gdbtk-cmds.c (gdb_loc): Eliminate use of
diff --git a/gdb/gdbtk/generic/gdbtk-cmds.c b/gdb/gdbtk/generic/gdbtk-cmds.c
index 75cc5a348d5..898f39b22b1 100644
--- a/gdb/gdbtk/generic/gdbtk-cmds.c
+++ b/gdb/gdbtk/generic/gdbtk-cmds.c
@@ -39,6 +39,7 @@
#include "filenames.h"
#include "disasm.h"
#include "value.h"
+#include "varobj.h"
#include "exceptions.h"
/* tcl header files includes varargs.h unless HAS_STDARG is defined,
diff --git a/gdb/gdbtk/generic/gdbtk-stack.c b/gdb/gdbtk/generic/gdbtk-stack.c
index 4bf1a0ac6d3..6380979df47 100644
--- a/gdb/gdbtk/generic/gdbtk-stack.c
+++ b/gdb/gdbtk/generic/gdbtk-stack.c
@@ -24,6 +24,7 @@
#include "linespec.h"
#include "block.h"
#include "dictionary.h"
+#include "varobj.h"
#include <tcl.h>
#include "gdbtk.h"
diff --git a/gdb/gdbtk/generic/gdbtk-varobj.c b/gdb/gdbtk/generic/gdbtk-varobj.c
index 5215c718970..e92177b98ec 100644
--- a/gdb/gdbtk/generic/gdbtk-varobj.c
+++ b/gdb/gdbtk/generic/gdbtk-varobj.c
@@ -26,6 +26,7 @@
#include <tcl.h>
#include "gdbtk.h"
#include "gdbtk-cmds.h"
+#include "gdbtk-wrapper.h"
/*
* Public functions defined in this file
@@ -444,10 +445,12 @@ variable_update (Tcl_Interp *interp, struct varobj **var)
Tcl_Obj *changed;
struct varobj **changelist;
struct varobj **vc;
+ int result;
- /* varobj_update() can return -1 if the variable is no longer around,
- i.e. we stepped out of the frame in which a local existed. */
- if (varobj_update (var, &changelist) == -1)
+ /* varobj_update() throws an error for a non-root variable
+ and otherwise it returns a value < 0 if the variable is
+ not in scope, not valid anymore or has changed type. */
+ if (GDB_varobj_update (var, &changelist, 1, &result) != GDB_OK || result < 0)
return Tcl_NewStringObj ("-1", -1);
changed = Tcl_NewListObj (0, NULL);
diff --git a/gdb/gdbtk/generic/gdbtk-wrapper.c b/gdb/gdbtk/generic/gdbtk-wrapper.c
index 13311bfd4be..77f2c286d77 100644
--- a/gdb/gdbtk/generic/gdbtk-wrapper.c
+++ b/gdb/gdbtk/generic/gdbtk-wrapper.c
@@ -21,6 +21,7 @@
#include "defs.h"
#include "frame.h"
#include "value.h"
+#include "varobj.h"
#include "block.h"
#include "exceptions.h"
#include "gdbtk-wrapper.h"
@@ -81,6 +82,10 @@ gdb_result GDB_find_relative_frame (struct frame_info *fi,
gdb_result GDB_get_current_frame (struct frame_info **result);
+gdb_result GDB_varobj_update (struct varobj **varp,
+ struct varobj ***changelist, int explicit,
+ int *result);
+
/*
* Private functions for this file
*/
@@ -126,6 +131,8 @@ static int wrap_get_next_frame (char *opaque_arg);
static int wrap_find_relative_frame (char *opaque_arg);
static int wrap_get_current_frame (char *opaque_arg);
+
+static int wrap_varobj_update (char *opaque_arg);
static gdb_result
call_wrapped_function (catch_errors_ftype *fn, struct gdb_wrapper_arguments *arg)
@@ -721,3 +728,33 @@ wrap_get_current_frame (char *opaque_arg)
return 1;
}
+gdb_result
+GDB_varobj_update (struct varobj **varp, struct varobj ***changelist,
+ int explicit, int *result)
+{
+ struct gdb_wrapper_arguments args;
+ gdb_result r;
+
+ args.args[0] = (char *) varp;
+ args.args[1] = (char *) changelist;
+ args.args[2] = (char *) explicit;
+
+ r = call_wrapped_function ((catch_errors_ftype *) wrap_varobj_update, &args);
+ if (r != GDB_OK)
+ return r;
+
+ *result = (int) args.result;
+ return GDB_OK;
+}
+
+static int wrap_varobj_update (char *opaque_arg)
+{
+ struct gdb_wrapper_arguments **args
+ = (struct gdb_wrapper_arguments **) opaque_arg;
+ struct varobj **varp = (struct varobj **) (*args)->args[0];
+ struct varobj ***changelist = (struct varobj ***) (*args)->args[1];
+ int explicit = (int) (*args)->args[2];
+
+ (*args)->result = (char *) varobj_update (varp, changelist, explicit);
+ return 1;
+}
diff --git a/gdb/gdbtk/generic/gdbtk-wrapper.h b/gdb/gdbtk/generic/gdbtk-wrapper.h
index c07d8148b23..4ff5e4f8e18 100644
--- a/gdb/gdbtk/generic/gdbtk-wrapper.h
+++ b/gdb/gdbtk/generic/gdbtk-wrapper.h
@@ -80,5 +80,8 @@ extern gdb_result GDB_find_relative_frame (struct frame_info *fi,
int *start,
struct frame_info **result);
extern gdb_result GDB_get_current_frame (struct frame_info **result);
+extern gdb_result GDB_varobj_update (struct varobj **varp,
+ struct varobj ***changelist, int explicit,
+ int *result);
#endif /* GDBTK_WRAPPER_H */