* Makefile.in (gdbtk-wrapper.o): Update dependencies.
(gdbtk-varobj.o, gdbtk-cmds.o, gdbtk-stack.o): Likewise.
gdb/gdbtk/:
* 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-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.
$(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 \
$(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 \
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)\
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
+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
#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,
#include "linespec.h"
#include "block.h"
#include "dictionary.h"
+#include "varobj.h"
#include <tcl.h>
#include "gdbtk.h"
#include <tcl.h>
#include "gdbtk.h"
#include "gdbtk-cmds.h"
+#include "gdbtk-wrapper.h"
/*
* Public functions defined in this file
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);
#include "defs.h"
#include "frame.h"
#include "value.h"
+#include "varobj.h"
#include "block.h"
#include "exceptions.h"
#include "gdbtk-wrapper.h"
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
*/
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);
\f
static gdb_result
call_wrapped_function (catch_errors_ftype *fn, struct gdb_wrapper_arguments *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;
+}
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 */