diff --git a/.cvsignore b/.cvsignore index 6f53a4b..d5a29d0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gdb-6.8.50.20090910.tar.bz2 +gdb-6.8.91.20090917.tar.bz2 diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 55bfaab..0aa6426 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -4,20 +4,20 @@ to install and uninstall. * gstack.sh, gstack.1: New files. -Index: gdb-6.8.50.20090802/gdb/Makefile.in +Index: gdb-6.8.91.20090917/gdb/Makefile.in =================================================================== ---- gdb-6.8.50.20090802.orig/gdb/Makefile.in 2009-08-03 09:50:57.000000000 +0200 -+++ gdb-6.8.50.20090802/gdb/Makefile.in 2009-08-03 11:09:49.000000000 +0200 -@@ -947,7 +947,7 @@ gdb.z:gdb.1 - # time it takes for make to check that all is up to date. - # install-only is intended to address that need. - install: all install-only --install-only: $(CONFIG_INSTALL) -+install-only: install-gstack $(CONFIG_INSTALL) +--- gdb-6.8.91.20090917.orig/gdb/Makefile.in 2009-09-17 12:47:07.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/Makefile.in 2009-09-17 12:47:38.000000000 +0200 +@@ -989,7 +989,7 @@ install: all install-only + + # The "install-only" target also installs the syscalls' XML files in + # the system. +-install-only: $(CONFIG_INSTALL) xml-syscall-install ++install-only: install-gstack $(CONFIG_INSTALL) xml-syscall-install transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -979,9 +979,26 @@ install-tui: +@@ -1021,9 +1021,26 @@ install-tui: $(DESTDIR)$(man1dir) ; \ $(INSTALL_DATA) $(srcdir)/gdb.1 \ $(DESTDIR)$(man1dir)/$$transformed_name.1 @@ -45,7 +45,7 @@ Index: gdb-6.8.50.20090802/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1003,6 +1020,17 @@ uninstall-tui: +@@ -1045,6 +1062,17 @@ uninstall-tui: fi ; \ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \ $(DESTDIR)$(man1dir)/$$transformed_name.1 @@ -63,10 +63,10 @@ Index: gdb-6.8.50.20090802/gdb/Makefile.in # The C++ name parser can be built standalone for testing. test-cp-name-parser.o: cp-name-parser.c -Index: gdb-6.8.50.20090802/gdb/gstack.sh +Index: gdb-6.8.91.20090917/gdb/gstack.sh =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/gstack.sh 2009-08-03 11:08:52.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/gstack.sh 2009-09-17 12:47:14.000000000 +0200 @@ -0,0 +1,48 @@ +#!/bin/sh + diff --git a/gdb-6.3-ia64-sigtramp-fp-20050926.patch b/gdb-6.3-ia64-sigtramp-fp-20050926.patch deleted file mode 100644 index 9baf801..0000000 --- a/gdb-6.3-ia64-sigtramp-fp-20050926.patch +++ /dev/null @@ -1,163 +0,0 @@ -2005-09-27 Jeff Johnston - - * libunwind-frame.c (libunwind_frame_cache): Save the current - stack pointer in the cache. - (libunwind_sigtramp_frame_this_id): New function. - (libunwind_sigtramp_frame_unwind): New unwinder. - (libunwind_sigtramp_frame_sniffer): Return - libunwind_sigtramp_frame_unwind address. - * libunwind-frame.h (libunwind_sigtramp_frame_this_id): New - prototype. - * ia64-tdep.c (ia64_libunwind_sigtramp_frame_this_id): Calculate - the base address using the current stack pointer plus a fixed - offset. - -2007-10-14 Jan Kratochvil - - Port to GDB-6.7. - -2008-02-24 Jan Kratochvil - - Port to GDB-6.8pre. - -2008-04-16 Yi Zhan - - Fix a compilation error on a typo. - -Index: gdb-6.8.50.20090803/gdb/libunwind-frame.c -=================================================================== ---- gdb-6.8.50.20090803.orig/gdb/libunwind-frame.c 2009-01-03 06:57:52.000000000 +0100 -+++ gdb-6.8.50.20090803/gdb/libunwind-frame.c 2009-08-04 06:31:34.000000000 +0200 -@@ -62,6 +62,7 @@ static unw_word_t (*unw_find_dyn_list_p) - struct libunwind_frame_cache - { - CORE_ADDR base; -+ CORE_ADDR sp; - CORE_ADDR func_addr; - unw_cursor_t cursor; - unw_addr_space_t as; -@@ -134,6 +135,7 @@ libunwind_frame_cache (struct frame_info - unw_accessors_t *acc; - unw_addr_space_t as; - unw_word_t fp; -+ unw_word_t sp; - unw_regnum_t uw_sp_regnum; - struct libunwind_frame_cache *cache; - struct libunwind_descr *descr; -@@ -175,14 +177,30 @@ libunwind_frame_cache (struct frame_info - : __LITTLE_ENDIAN); - - unw_init_remote_p (&cache->cursor, as, this_frame); -+ -+ /* For the base address, we have a small problem. The majority -+ of the time, we can get the stack pointer of the previous -+ frame to use as a frame pointer. In the case where we have -+ a signal trampoline, the stack may change due to a sigaltstack -+ being set up. In that case, the normal mechanism will give us -+ an address in the regular stack which is not at the end of the -+ sigaltstack as we want. To handle this, we record the stack -+ address so the caller may calculate a more correct base address -+ to use. */ -+ uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (gdbarch)); -+ ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &sp); -+ if (ret < 0) -+ { -+ unw_destroy_addr_space_p (as); -+ error (_("Can't get libunwind sp register.")); -+ } -+ - if (unw_step_p (&cache->cursor) < 0) - { - unw_destroy_addr_space_p (as); - return NULL; - } - -- /* To get base address, get sp from previous frame. */ -- uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (gdbarch)); - ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp); - if (ret < 0) - { -@@ -190,6 +208,7 @@ libunwind_frame_cache (struct frame_info - error (_("Can't get libunwind sp register.")); - } - -+ cache->sp = (CORE_ADDR)sp; - cache->base = (CORE_ADDR)fp; - cache->as = as; - -@@ -377,6 +396,31 @@ libunwind_search_unwind_table (void *as, - di, pi, need_unwind_info, args); - } - -+void -+libunwind_sigtramp_frame_this_id (struct frame_info *this_frame, -+ void **this_cache, -+ struct frame_id *this_id) -+{ -+ struct libunwind_frame_cache *cache = -+ libunwind_frame_cache (this_frame, this_cache); -+ -+ /* Unlike a regular frame, we can't use the normal frame pointer -+ mechanism because a sigaltstack may have been used. Instead, -+ we return the current stack pointer for the caller to use -+ to calculate the base address. */ -+ if (cache != NULL) -+ (*this_id) = frame_id_build (cache->sp, cache->func_addr); -+ else -+ (*this_id) = null_frame_id; -+} -+ -+static const struct frame_unwind libunwind_sigtramp_frame_unwind = -+{ -+ SIGTRAMP_FRAME, -+ libunwind_sigtramp_frame_this_id, -+ libunwind_frame_prev_register -+}; -+ - /* Verify if we are in a sigtramp frame and we can use libunwind to unwind. */ - int - libunwind_sigtramp_frame_sniffer (const struct frame_unwind *self, -Index: gdb-6.8.50.20090803/gdb/libunwind-frame.h -=================================================================== ---- gdb-6.8.50.20090803.orig/gdb/libunwind-frame.h 2009-01-03 06:57:52.000000000 +0100 -+++ gdb-6.8.50.20090803/gdb/libunwind-frame.h 2009-08-04 06:31:34.000000000 +0200 -@@ -52,6 +52,9 @@ void libunwind_frame_set_descr (struct g - - void libunwind_frame_this_id (struct frame_info *this_frame, void **this_cache, - struct frame_id *this_id); -+void libunwind_sigtramp_frame_this_id (struct frame_info *this_frame, -+ void **this_cache, -+ struct frame_id *this_id); - struct value *libunwind_frame_prev_register (struct frame_info *this_frame, - void **this_cache, int regnum); - void libunwind_frame_dealloc_cache (struct frame_info *self, void *cache); -Index: gdb-6.8.50.20090803/gdb/ia64-tdep.c -=================================================================== ---- gdb-6.8.50.20090803.orig/gdb/ia64-tdep.c 2009-08-04 06:30:45.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/ia64-tdep.c 2009-08-04 06:31:34.000000000 +0200 -@@ -3023,7 +3023,7 @@ ia64_libunwind_sigtramp_frame_this_id (s - struct frame_id id; - CORE_ADDR prev_ip; - -- libunwind_frame_this_id (this_frame, this_cache, &id); -+ libunwind_sigtramp_frame_this_id (this_frame, this_cache, &id); - if (frame_id_eq (id, null_frame_id)) - { - (*this_id) = null_frame_id; -@@ -3035,8 +3035,14 @@ ia64_libunwind_sigtramp_frame_this_id (s - get_frame_register (this_frame, IA64_BSP_REGNUM, buf); - bsp = extract_unsigned_integer (buf, 8, byte_order); - -- /* For a sigtramp frame, we don't make the check for previous ip being 0. */ -- (*this_id) = frame_id_build_special (id.stack_addr, id.code_addr, bsp); -+ /* For a sigtramp frame, we don't make the check for previous ip being 0. -+ We also must calculate the frame pointer because libunwind will give -+ us back the current stack pointer instead of the frame pointer since -+ it cannot figure this out when in a sigaltstack. We make a basic -+ assumption of 16 (default size) + 8 bytes for sigcontext address. -+ FIXME: if libunwind were to export the frame pointer address, we -+ could eliminate the assumption and get the actual value. */ -+ (*this_id) = frame_id_build_special (id.stack_addr + 24, id.code_addr, bsp); - - if (gdbarch_debug >= 1) - fprintf_unfiltered (gdb_stdlog, diff --git a/gdb-6.3-pie-20050110.patch b/gdb-6.3-pie-20050110.patch index f6621b2..04755ea 100644 --- a/gdb-6.3-pie-20050110.patch +++ b/gdb-6.3-pie-20050110.patch @@ -26,10 +26,10 @@ Fix scan_dyntag() for binaries provided by valgrind (BZ 460319). -Index: gdb-6.8.50.20090909/gdb/amd64-tdep.c +Index: gdb-6.8.91.20090917/gdb/amd64-tdep.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/amd64-tdep.c 2009-09-09 19:09:31.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/amd64-tdep.c 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/amd64-tdep.c 2009-09-17 12:48:49.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/amd64-tdep.c 2009-09-17 12:50:07.000000000 +0200 @@ -36,6 +36,7 @@ #include "regcache.h" #include "regset.h" @@ -138,10 +138,10 @@ Index: gdb-6.8.50.20090909/gdb/amd64-tdep.c return pc; } -Index: gdb-6.8.50.20090909/gdb/auxv.c +Index: gdb-6.8.91.20090917/gdb/auxv.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/auxv.c 2009-07-02 19:25:52.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/auxv.c 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/auxv.c 2009-07-02 19:25:52.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/auxv.c 2009-09-17 12:50:07.000000000 +0200 @@ -78,7 +78,7 @@ procfs_xfer_auxv (struct target_ops *ops Return 1 if an entry was read into *TYPEP and *VALP. */ static int @@ -230,10 +230,10 @@ Index: gdb-6.8.50.20090909/gdb/auxv.c break; } -Index: gdb-6.8.50.20090909/gdb/auxv.h +Index: gdb-6.8.91.20090917/gdb/auxv.h =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/auxv.h 2009-06-07 21:07:08.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/auxv.h 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/auxv.h 2009-06-07 21:07:08.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/auxv.h 2009-09-17 12:50:07.000000000 +0200 @@ -31,14 +31,14 @@ Return 1 if an entry was read into *TYPEP and *VALP. */ extern int target_auxv_parse (struct target_ops *ops, @@ -251,11 +251,11 @@ Index: gdb-6.8.50.20090909/gdb/auxv.h /* Print the contents of the target's AUXV on the specified file. */ extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops); -Index: gdb-6.8.50.20090909/gdb/dwarf2read.c +Index: gdb-6.8.91.20090917/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/dwarf2read.c 2009-09-09 19:21:23.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/dwarf2read.c 2009-09-09 19:24:13.000000000 +0200 -@@ -1719,7 +1719,7 @@ dwarf2_build_psymtabs (struct objfile *o +--- gdb-6.8.91.20090917.orig/gdb/dwarf2read.c 2009-09-17 12:49:20.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/dwarf2read.c 2009-09-17 12:50:07.000000000 +0200 +@@ -1717,7 +1717,7 @@ dwarf2_build_psymtabs (struct objfile *o dwarf2_read_section (objfile, &dwarf2_per_objfile->eh_frame); dwarf2_read_section (objfile, &dwarf2_per_objfile->frame); @@ -264,10 +264,10 @@ Index: gdb-6.8.50.20090909/gdb/dwarf2read.c || (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)) { -Index: gdb-6.8.50.20090909/gdb/elfread.c +Index: gdb-6.8.91.20090917/gdb/elfread.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/elfread.c 2009-09-09 19:05:55.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/elfread.c 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/elfread.c 2009-09-17 12:47:07.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/elfread.c 2009-09-17 12:50:07.000000000 +0200 @@ -681,7 +681,7 @@ elf_symfile_read (struct objfile *objfil /* If we are reinitializing, or if we have never loaded syms yet, set table to empty. MAINLINE is cleared so that *_read_psymtab @@ -277,11 +277,11 @@ Index: gdb-6.8.50.20090909/gdb/elfread.c { init_psymbol_list (objfile, 0); mainline = 0; -Index: gdb-6.8.50.20090909/gdb/infrun.c +Index: gdb-6.8.91.20090917/gdb/infrun.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/infrun.c 2009-09-09 19:09:31.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/infrun.c 2009-09-09 19:24:13.000000000 +0200 -@@ -3602,6 +3602,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( +--- gdb-6.8.91.20090917.orig/gdb/infrun.c 2009-09-17 12:48:50.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/infrun.c 2009-09-17 12:50:07.000000000 +0200 +@@ -3659,6 +3659,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( #endif target_terminal_inferior (); @@ -292,13 +292,13 @@ Index: gdb-6.8.50.20090909/gdb/infrun.c /* If requested, stop when the dynamic linker notifies gdb of events. This allows the user to get control and place breakpoints in initializer routines for -Index: gdb-6.8.50.20090909/gdb/objfiles.c +Index: gdb-6.8.91.20090917/gdb/objfiles.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/objfiles.c 2009-09-09 19:23:05.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/objfiles.c 2009-09-09 19:24:13.000000000 +0200 -@@ -51,6 +51,9 @@ - #include "arch-utils.h" - #include "exec.h" +--- gdb-6.8.91.20090917.orig/gdb/objfiles.c 2009-09-17 12:47:07.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/objfiles.c 2009-09-17 12:50:20.000000000 +0200 +@@ -53,6 +53,9 @@ + #include "observer.h" + #include "complaints.h" +#include "auxv.h" +#include "elf/common.h" @@ -306,7 +306,7 @@ Index: gdb-6.8.50.20090909/gdb/objfiles.c /* Prototypes for local functions */ static void objfile_alloc_data (struct objfile *objfile); -@@ -278,9 +281,17 @@ init_entry_point_info (struct objfile *o +@@ -280,9 +283,17 @@ init_entry_point_info (struct objfile *o CORE_ADDR entry_point_address (void) { @@ -324,7 +324,7 @@ Index: gdb-6.8.50.20090909/gdb/objfiles.c if (symfile_objfile == NULL) return 0; -@@ -465,6 +476,9 @@ free_objfile (struct objfile *objfile) +@@ -467,6 +478,9 @@ free_objfile (struct objfile *objfile) if (objfile == symfile_objfile) symfile_objfile = NULL; @@ -334,10 +334,10 @@ Index: gdb-6.8.50.20090909/gdb/objfiles.c /* Before the symbol table code was redone to make it easier to selectively load and remove information particular to a specific linkage unit, gdb used to do these things whenever the monolithic -Index: gdb-6.8.50.20090909/gdb/solib-svr4.c +Index: gdb-6.8.91.20090917/gdb/solib-svr4.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/solib-svr4.c 2009-09-09 19:09:35.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/solib-svr4.c 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/solib-svr4.c 2009-09-17 12:48:50.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/solib-svr4.c 2009-09-17 12:50:07.000000000 +0200 @@ -47,6 +47,7 @@ #include "exec.h" #include "auxv.h" @@ -1000,10 +1000,10 @@ Index: gdb-6.8.50.20090909/gdb/solib-svr4.c + add_info ("linkmap", info_linkmap_command, + "Display the inferior's linkmap."); } -Index: gdb-6.8.50.20090909/gdb/solib.c +Index: gdb-6.8.91.20090917/gdb/solib.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/solib.c 2009-09-09 19:05:56.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/solib.c 2009-09-09 19:25:18.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/solib.c 2009-09-17 12:47:07.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/solib.c 2009-09-17 12:50:07.000000000 +0200 @@ -82,6 +82,8 @@ set_solib_ops (struct gdbarch *gdbarch, /* external data declarations */ @@ -1140,10 +1140,10 @@ Index: gdb-6.8.50.20090909/gdb/solib.c + NULL, NULL, + &setdebuglist, &showdebuglist); } -Index: gdb-6.8.50.20090909/gdb/solist.h +Index: gdb-6.8.91.20090917/gdb/solist.h =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/solist.h 2009-09-09 19:05:56.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/solist.h 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/solist.h 2009-09-17 12:47:07.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/solist.h 2009-09-17 12:50:07.000000000 +0200 @@ -61,6 +61,8 @@ struct so_list bfd *abfd; char symbols_loaded; /* flag: symbols read in yet? */ @@ -1164,10 +1164,10 @@ Index: gdb-6.8.50.20090909/gdb/solist.h +extern int debug_solib; + #endif -Index: gdb-6.8.50.20090909/gdb/symfile-mem.c +Index: gdb-6.8.91.20090917/gdb/symfile-mem.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/symfile-mem.c 2009-09-09 19:06:57.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/symfile-mem.c 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/symfile-mem.c 2009-09-17 12:48:49.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/symfile-mem.c 2009-09-17 12:50:07.000000000 +0200 @@ -115,7 +115,7 @@ symbol_file_add_from_memory (struct bfd ++i; } @@ -1177,10 +1177,10 @@ Index: gdb-6.8.50.20090909/gdb/symfile-mem.c sai, OBJF_SHARED); /* This might change our ideas about frames already looked at. */ -Index: gdb-6.8.50.20090909/gdb/symfile.c +Index: gdb-6.8.91.20090917/gdb/symfile.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/symfile.c 2009-09-09 19:15:43.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/symfile.c 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/symfile.c 2009-09-17 12:48:50.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/symfile.c 2009-09-17 12:50:07.000000000 +0200 @@ -49,6 +49,7 @@ #include "readline/readline.h" #include "gdb_assert.h" @@ -1250,7 +1250,7 @@ Index: gdb-6.8.50.20090909/gdb/symfile.c && (have_full_symbols () || have_partial_symbols ()) && from_tty && (have_full_symbols () || have_partial_symbols ()) -@@ -1162,6 +1168,9 @@ symbol_file_clear (int from_tty) +@@ -1163,6 +1169,9 @@ symbol_file_clear (int from_tty) symfile_objfile->name) : !query (_("Discard symbol table? ")))) error (_("Not confirmed.")); @@ -1269,11 +1269,11 @@ Index: gdb-6.8.50.20090909/gdb/symfile.c /* If the mtime has changed between the time we set new_modtime and now, we *want* this to be out of date, so don't call stat again now. */ -Index: gdb-6.8.50.20090909/gdb/target.h +Index: gdb-6.8.91.20090917/gdb/target.h =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/target.h 2009-09-09 19:07:36.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/target.h 2009-09-09 19:24:13.000000000 +0200 -@@ -528,7 +528,7 @@ struct target_ops +--- gdb-6.8.91.20090917.orig/gdb/target.h 2009-09-17 12:48:49.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/target.h 2009-09-17 12:50:07.000000000 +0200 +@@ -545,7 +545,7 @@ struct target_ops Return -1 if there is insufficient buffer for a whole entry. Return 1 if an entry was read into *TYPEP and *VALP. */ int (*to_auxv_parse) (struct target_ops *ops, gdb_byte **readptr, @@ -1282,10 +1282,10 @@ Index: gdb-6.8.50.20090909/gdb/target.h /* Search SEARCH_SPACE_LEN bytes beginning at START_ADDR for the sequence of bytes in PATTERN with length PATTERN_LEN. -Index: gdb-6.8.50.20090909/gdb/symfile.h +Index: gdb-6.8.91.20090917/gdb/symfile.h =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/symfile.h 2009-09-09 19:15:43.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/symfile.h 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/symfile.h 2009-09-17 12:48:50.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/symfile.h 2009-09-17 12:50:07.000000000 +0200 @@ -229,7 +229,13 @@ enum symfile_add_flags SYMFILE_MAINLINE = 1 << 2, @@ -1301,10 +1301,10 @@ Index: gdb-6.8.50.20090909/gdb/symfile.h }; extern void syms_from_objfile (struct objfile *, -Index: gdb-6.8.50.20090909/gdb/infcmd.c +Index: gdb-6.8.91.20090917/gdb/infcmd.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/infcmd.c 2009-09-09 19:20:33.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/infcmd.c 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/infcmd.c 2009-09-17 12:49:01.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/infcmd.c 2009-09-17 12:50:07.000000000 +0200 @@ -2308,6 +2308,9 @@ attach_command_post_wait (char *args, in post_create_inferior (¤t_target, from_tty); @@ -1315,10 +1315,10 @@ Index: gdb-6.8.50.20090909/gdb/infcmd.c /* Install inferior's terminal modes. */ target_terminal_inferior (); -Index: gdb-6.8.50.20090909/gdb/linux-tdep.c +Index: gdb-6.8.91.20090917/gdb/linux-tdep.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/linux-tdep.c 2009-08-04 22:41:13.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/linux-tdep.c 2009-09-09 19:24:13.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/linux-tdep.c 2009-08-04 22:41:13.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/linux-tdep.c 2009-09-17 12:50:07.000000000 +0200 @@ -163,5 +163,7 @@ in this session.\n")); void _initialize_linux_tdep (void) diff --git a/gdb-6.8-inlining-addon.patch b/gdb-6.8-inlining-addon.patch index c8e6159..4edcd1a 100644 --- a/gdb-6.8-inlining-addon.patch +++ b/gdb-6.8-inlining-addon.patch @@ -5,10 +5,10 @@ causing: FAIL: gdb.base/unwindonsignal.exp: unwindonsignal, stack unwound resume() -> target_resume() move of clear_inline_frame_state() is for: gdb.mi/mi-nsmoribund.exp -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-bt.c +Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-bt.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/testsuite/gdb.opt/inline-bt.c 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-bt.c 2009-09-09 19:20:00.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-bt.c 2009-06-28 02:20:24.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-bt.c 2009-09-17 12:49:01.000000000 +0200 @@ -13,10 +13,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -28,10 +28,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-bt.c inline int func1(void) { -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-cmds.c +Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-cmds.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/testsuite/gdb.opt/inline-cmds.c 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-cmds.c 2009-09-09 19:20:00.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-cmds.c 2009-06-28 02:20:24.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-cmds.c 2009-09-17 12:49:01.000000000 +0200 @@ -13,13 +13,19 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -54,10 +54,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-cmds.c inline int func1(void) { bar (); -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-cmds.exp +Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-cmds.exp =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-09-09 19:20:00.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-06-28 02:20:24.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-09-17 12:49:01.000000000 +0200 @@ -230,7 +230,7 @@ set line3 [gdb_get_line_number "set brea gdb_breakpoint $line3 gdb_continue_to_breakpoint "consecutive func1" @@ -110,10 +110,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-cmds.exp +gdb_test "info frame" "inlined into frame.*" "outer_inline2 inlined" +gdb_test "fini" "" "up from outer_inline2" +gdb_test "info frame" " in main \[^\n\]*\n source language.*" "main not inlined" -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-locals.c +Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-locals.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/testsuite/gdb.opt/inline-locals.c 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-locals.c 2009-09-09 19:20:00.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-locals.c 2009-06-28 02:20:24.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-locals.c 2009-09-17 12:49:01.000000000 +0200 @@ -13,11 +13,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -133,10 +133,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-locals.c inline int func1(int arg1) { -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-locals.exp +Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-locals.exp =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/testsuite/gdb.opt/inline-locals.exp 2009-06-30 17:50:27.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-locals.exp 2009-09-09 19:20:00.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-locals.exp 2009-06-30 17:50:27.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-locals.exp 2009-09-17 12:49:01.000000000 +0200 @@ -77,6 +77,9 @@ if { ! $no_frames } { # Make sure that locals on the stack are found. This is an array to @@ -155,11 +155,11 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-locals.exp + setup_kfail *-*-* "gcc/debug.optimization" +} gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local (3)" -Index: gdb-6.8.50.20090909/gdb/frame.c +Index: gdb-6.8.91.20090917/gdb/frame.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/frame.c 2009-09-09 19:06:46.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/frame.c 2009-09-09 19:20:00.000000000 +0200 -@@ -276,7 +276,7 @@ fprint_frame (struct ui_file *file, stru +--- gdb-6.8.91.20090917.orig/gdb/frame.c 2009-09-17 12:48:49.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/frame.c 2009-09-17 12:49:01.000000000 +0200 +@@ -310,7 +310,7 @@ fprint_frame (struct ui_file *file, stru static struct frame_info * skip_inlined_frames (struct frame_info *frame) { @@ -168,7 +168,7 @@ Index: gdb-6.8.50.20090909/gdb/frame.c frame = get_prev_frame (frame); return frame; -@@ -1715,6 +1715,7 @@ get_frame_address_in_block (struct frame +@@ -1778,6 +1778,7 @@ get_frame_address_in_block (struct frame { /* A draft address. */ CORE_ADDR pc = get_frame_pc (this_frame); @@ -176,7 +176,7 @@ Index: gdb-6.8.50.20090909/gdb/frame.c struct frame_info *next_frame = this_frame->next; -@@ -1757,6 +1758,9 @@ get_frame_address_in_block (struct frame +@@ -1820,6 +1821,9 @@ get_frame_address_in_block (struct frame while in an inlined function, then the code address of the "calling" normal function should not be adjusted either. */ @@ -186,7 +186,7 @@ Index: gdb-6.8.50.20090909/gdb/frame.c while (get_frame_type (next_frame) == INLINE_FRAME) next_frame = next_frame->next; -@@ -1788,7 +1792,7 @@ find_frame_sal (struct frame_info *frame +@@ -1851,7 +1855,7 @@ find_frame_sal (struct frame_info *frame sym = inline_skipped_symbol (inferior_ptid); init_sal (sal); @@ -195,19 +195,19 @@ Index: gdb-6.8.50.20090909/gdb/frame.c { sal->symtab = SYMBOL_SYMTAB (sym); sal->line = SYMBOL_LINE (sym); -Index: gdb-6.8.50.20090909/gdb/breakpoint.c +Index: gdb-6.8.91.20090917/gdb/breakpoint.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/breakpoint.c 2009-09-09 19:19:46.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/breakpoint.c 2009-09-09 19:21:14.000000000 +0200 -@@ -61,6 +61,7 @@ - #include "valprint.h" +--- gdb-6.8.91.20090917.orig/gdb/breakpoint.c 2009-09-17 12:48:51.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/breakpoint.c 2009-09-17 12:49:12.000000000 +0200 +@@ -62,6 +62,7 @@ #include "jit.h" + #include "xml-syscall.h" #include "parser-defs.h" +#include "inline-frame.h" /* readline include files */ #include "readline/readline.h" -@@ -3217,10 +3218,24 @@ bpstat_check_breakpoint_conditions (bpst +@@ -3220,10 +3221,24 @@ bpstat_check_breakpoint_conditions (bpst const struct bp_location *bl = bs->breakpoint_at; struct breakpoint *b = bl->owner; @@ -236,7 +236,7 @@ Index: gdb-6.8.50.20090909/gdb/breakpoint.c { int value_is_zero = 0; -@@ -3380,6 +3395,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p +@@ -3383,6 +3398,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p bs->print = 0; } bs->commands = copy_command_lines (bs->commands); @@ -249,7 +249,7 @@ Index: gdb-6.8.50.20090909/gdb/breakpoint.c } /* Print nothing for this entry if we dont stop or if we dont print. */ -@@ -5278,9 +5299,9 @@ set_momentary_breakpoint (struct gdbarch +@@ -5572,9 +5593,9 @@ set_momentary_breakpoint (struct gdbarch { struct breakpoint *b; @@ -262,11 +262,11 @@ Index: gdb-6.8.50.20090909/gdb/breakpoint.c b = set_raw_breakpoint (gdbarch, sal, type); b->enable_state = bp_enabled; -Index: gdb-6.8.50.20090909/gdb/inline-frame.c +Index: gdb-6.8.91.20090917/gdb/inline-frame.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/inline-frame.c 2009-06-28 02:20:22.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/inline-frame.c 2009-09-09 19:20:00.000000000 +0200 -@@ -195,6 +195,12 @@ inline_frame_sniffer (const struct frame +--- gdb-6.8.91.20090917.orig/gdb/inline-frame.c 2009-09-13 18:28:28.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/inline-frame.c 2009-09-17 12:49:01.000000000 +0200 +@@ -199,6 +199,12 @@ inline_frame_sniffer (const struct frame if (frame_block == NULL) return 0; @@ -279,7 +279,7 @@ Index: gdb-6.8.50.20090909/gdb/inline-frame.c /* Calculate DEPTH, the number of inlined functions at this location. */ depth = 0; -@@ -204,6 +210,10 @@ inline_frame_sniffer (const struct frame +@@ -208,6 +214,10 @@ inline_frame_sniffer (const struct frame if (block_inlined_p (cur_block)) depth++; @@ -290,7 +290,7 @@ Index: gdb-6.8.50.20090909/gdb/inline-frame.c cur_block = BLOCK_SUPERBLOCK (cur_block); } -@@ -287,7 +297,6 @@ skip_inline_frames (ptid_t ptid) +@@ -291,7 +301,6 @@ skip_inline_frames (ptid_t ptid) { CORE_ADDR this_pc; struct block *frame_block, *cur_block; @@ -298,7 +298,7 @@ Index: gdb-6.8.50.20090909/gdb/inline-frame.c int skip_count = 0; struct inline_state *state; -@@ -308,10 +317,7 @@ skip_inline_frames (ptid_t ptid) +@@ -312,10 +321,7 @@ skip_inline_frames (ptid_t ptid) of BLOCK_START. */ if (BLOCK_START (cur_block) == this_pc || block_starting_point_at (this_pc, cur_block)) @@ -310,7 +310,7 @@ Index: gdb-6.8.50.20090909/gdb/inline-frame.c else break; } -@@ -323,7 +329,6 @@ skip_inline_frames (ptid_t ptid) +@@ -327,7 +333,6 @@ skip_inline_frames (ptid_t ptid) state = allocate_inline_frame_state (ptid); state->skipped_frames = skip_count; state->saved_pc = this_pc; @@ -318,7 +318,7 @@ Index: gdb-6.8.50.20090909/gdb/inline-frame.c if (skip_count != 0) reinit_frame_cache (); -@@ -341,6 +346,23 @@ step_into_inline_frame (ptid_t ptid) +@@ -345,6 +350,23 @@ step_into_inline_frame (ptid_t ptid) reinit_frame_cache (); } @@ -342,10 +342,10 @@ Index: gdb-6.8.50.20090909/gdb/inline-frame.c /* Return the number of hidden functions inlined into the current frame. */ -Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-markers.c +Index: gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-markers.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/testsuite/gdb.opt/inline-markers.c 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-markers.c 2009-09-09 19:20:00.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/testsuite/gdb.opt/inline-markers.c 2009-06-28 02:20:24.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/testsuite/gdb.opt/inline-markers.c 2009-09-17 12:49:01.000000000 +0200 @@ -15,11 +15,6 @@ extern int x, y; @@ -358,10 +358,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-markers.c void marker(void) { x += y; /* set breakpoint 2 here */ -Index: gdb-6.8.50.20090909/gdb/gdbthread.h +Index: gdb-6.8.91.20090917/gdb/gdbthread.h =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/gdbthread.h 2009-09-09 19:05:56.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/gdbthread.h 2009-09-09 19:20:00.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/gdbthread.h 2009-09-17 12:47:07.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/gdbthread.h 2009-09-17 12:49:01.000000000 +0200 @@ -191,6 +191,12 @@ struct thread_info /* Private data used by the target vector implementation. */ @@ -375,10 +375,10 @@ Index: gdb-6.8.50.20090909/gdb/gdbthread.h }; /* Create an empty thread list, or empty the existing one. */ -Index: gdb-6.8.50.20090909/gdb/infcmd.c +Index: gdb-6.8.91.20090917/gdb/infcmd.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/infcmd.c 2009-09-09 19:05:56.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/infcmd.c 2009-09-09 19:20:33.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/infcmd.c 2009-09-17 12:47:07.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/infcmd.c 2009-09-17 12:49:01.000000000 +0200 @@ -1434,11 +1434,11 @@ finish_command_continuation (void *arg) struct type *value_type; @@ -518,11 +518,11 @@ Index: gdb-6.8.50.20090909/gdb/infcmd.c } -Index: gdb-6.8.50.20090909/gdb/target.c +Index: gdb-6.8.91.20090917/gdb/target.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/target.c 2009-09-09 19:09:31.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/target.c 2009-09-09 19:21:00.000000000 +0200 -@@ -2182,6 +2182,7 @@ target_resume (ptid_t ptid, int step, en +--- gdb-6.8.91.20090917.orig/gdb/target.c 2009-09-17 12:48:49.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/target.c 2009-09-17 12:49:01.000000000 +0200 +@@ -2187,6 +2187,7 @@ target_resume (ptid_t ptid, int step, en { struct target_ops *t; @@ -530,10 +530,10 @@ Index: gdb-6.8.50.20090909/gdb/target.c target_dcache_invalidate (); for (t = current_target.beneath; t != NULL; t = t->beneath) -Index: gdb-6.8.50.20090909/gdb/inline-frame.h +Index: gdb-6.8.91.20090917/gdb/inline-frame.h =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/inline-frame.h 2009-06-28 02:20:22.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/inline-frame.h 2009-09-09 19:20:00.000000000 +0200 +--- gdb-6.8.91.20090917.orig/gdb/inline-frame.h 2009-06-28 02:20:22.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/inline-frame.h 2009-09-17 12:49:01.000000000 +0200 @@ -43,6 +43,10 @@ void clear_inline_frame_state (ptid_t pt void step_into_inline_frame (ptid_t ptid); @@ -545,11 +545,11 @@ Index: gdb-6.8.50.20090909/gdb/inline-frame.h /* Return the number of hidden functions inlined into the current frame. */ -Index: gdb-6.8.50.20090909/gdb/dwarf2read.c +Index: gdb-6.8.91.20090917/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.50.20090909.orig/gdb/dwarf2read.c 2009-09-09 19:19:46.000000000 +0200 -+++ gdb-6.8.50.20090909/gdb/dwarf2read.c 2009-09-09 19:20:00.000000000 +0200 -@@ -4130,6 +4130,7 @@ read_func_scope (struct die_info *die, s +--- gdb-6.8.91.20090917.orig/gdb/dwarf2read.c 2009-09-17 12:48:51.000000000 +0200 ++++ gdb-6.8.91.20090917/gdb/dwarf2read.c 2009-09-17 12:49:01.000000000 +0200 +@@ -4128,6 +4128,7 @@ read_func_scope (struct die_info *die, s struct block *block; unsigned die_children = 0; int inlined_func = (die->tag == DW_TAG_inlined_subroutine); @@ -557,7 +557,7 @@ Index: gdb-6.8.50.20090909/gdb/dwarf2read.c if (inlined_func) { -@@ -4171,7 +4172,10 @@ read_func_scope (struct die_info *die, s +@@ -4169,7 +4170,10 @@ read_func_scope (struct die_info *die, s add_to_cu_func_list (name, lowpc, highpc, cu); new = push_context (0, lowpc); diff --git a/gdb-archer.patch b/gdb-archer.patch index 31e2d4b..04c33a1 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,7 +2,7 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit 941eb487a42933e442cb4d11344cda96ecb8a04d +commit 16f3f01cc2cbc15283462eaabdfcde92cf42cdc6 branch `archer' - the merge of branches: archer-tromey-call-frame-cfa @@ -19,16 +19,13 @@ archer-pmuldoon-next-over-throw diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index 7f2fe58..ac3a4a0 100644 +index f5e1dde..73ee55c 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -166,6 +166,13 @@ INTL_CFLAGS = @INCINTL@ - TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ - TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ +@@ -169,6 +169,10 @@ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ + # Did the user give us a --with-gdb-datadir option? + GDB_DATADIR_PATH = @GDB_DATADIR_PATH@ -+# Did the user give us a --with-gdb-datadir option? -+GDB_DATADIR_PATH = @GDB_DATADIR_PATH@ -+ +# The argument to --with-pythondir. If not given, this is +# GDB_DATADIR_PATH/python. +pythondir = @pythondir@ @@ -36,7 +33,7 @@ index 7f2fe58..ac3a4a0 100644 # Helper code from gnulib. LIBGNU = gnulib/libgnu.a INCGNU = -I$(srcdir)/gnulib -Ignulib -@@ -264,21 +271,37 @@ SUBDIR_TUI_CFLAGS= \ +@@ -267,21 +271,37 @@ SUBDIR_TUI_CFLAGS= \ # SUBDIR_PYTHON_OBS = \ python.o \ @@ -74,25 +71,25 @@ index 7f2fe58..ac3a4a0 100644 python/py-type.c \ python/py-utils.c \ python/py-value.c -@@ -746,7 +769,7 @@ config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \ +@@ -750,7 +770,7 @@ config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \ annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h \ remote-fileio.h i386-linux-tdep.h vax-tdep.h objc-lang.h \ sentinel-frame.h bcache.h symfile.h windows-tdep.h linux-tdep.h \ --gdb_usleep.h jit.h -+gdb_usleep.h jit.h python/python.h python/python-internal.h +-gdb_usleep.h jit.h xml-syscall.h ada-operator.inc ++gdb_usleep.h jit.h xml-syscall.h ada-operator.inc python/python.h python/python-internal.h # Header files that already have srcdir in them, or which are in objdir. -@@ -864,7 +887,7 @@ generated_files = config.h observer.h observer.inc ada-lex.c \ +@@ -874,7 +894,7 @@ generated_files = config.h observer.h observer.inc ada-lex.c \ $(COMPILE) $< $(POSTCOMPILE) --all: gdb$(EXEEXT) $(CONFIG_ALL) -+all: gdb$(EXEEXT) $(CONFIG_ALL) .gdbinit +-all: gdb$(EXEEXT) $(CONFIG_ALL) xml-syscall-copy ++all: gdb$(EXEEXT) $(CONFIG_ALL) xml-syscall-copy .gdbinit @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do .PHONY: all-tui all-tui: $(TUI)$(EXEEXT) -@@ -1221,6 +1244,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -1264,6 +1284,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -105,7 +102,7 @@ index 7f2fe58..ac3a4a0 100644 config.status: $(srcdir)/configure configure.tgt configure.host $(SHELL) config.status --recheck -@@ -1920,6 +1949,14 @@ python.o: $(srcdir)/python/python.c +@@ -1963,6 +1989,14 @@ python.o: $(srcdir)/python/python.c $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python.c $(POSTCOMPILE) @@ -120,7 +117,7 @@ index 7f2fe58..ac3a4a0 100644 py-cmd.o: $(srcdir)/python/py-cmd.c $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-cmd.c $(POSTCOMPILE) -@@ -1932,14 +1969,38 @@ py-function.o: $(srcdir)/python/py-function.c +@@ -1975,14 +2009,38 @@ py-function.o: $(srcdir)/python/py-function.c $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-function.c $(POSTCOMPILE) @@ -159,7 +156,7 @@ index 7f2fe58..ac3a4a0 100644 py-type.o: $(srcdir)/python/py-type.c $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-type.c $(POSTCOMPILE) -@@ -1952,6 +2013,36 @@ py-value.o: $(srcdir)/python/py-value.c +@@ -1995,6 +2053,36 @@ py-value.o: $(srcdir)/python/py-value.c $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-value.c $(POSTCOMPILE) @@ -197,10 +194,10 @@ index 7f2fe58..ac3a4a0 100644 # Dependency tracking. Most of this is conditional on GNU Make being # found by configure; if GNU Make is not found, we fall back to a diff --git a/gdb/NEWS b/gdb/NEWS -index 14da6c8..1979f42 100644 +index 4fc6dcd..6744b23 100644 --- a/gdb/NEWS +++ b/gdb/NEWS -@@ -444,6 +444,13 @@ x86/x86_64 Darwin i[34567]86-*-darwin* +@@ -462,6 +462,13 @@ x86/x86_64 Darwin i[34567]86-*-darwin* x86_64 MinGW x86_64-*-mingw* @@ -466,18 +463,18 @@ index 53e7371..d373f8a 100644 + #endif /* BLOCK_H */ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 9f50872..a4255d7 100644 +index 811cdfb..b0bf314 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -60,6 +60,7 @@ - #include "wrapper.h" +@@ -61,6 +61,7 @@ #include "valprint.h" #include "jit.h" + #include "xml-syscall.h" +#include "parser-defs.h" /* readline include files */ #include "readline/readline.h" -@@ -111,8 +112,6 @@ struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch, +@@ -112,8 +113,6 @@ struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch, struct symtab_and_line, enum bptype); @@ -486,7 +483,7 @@ index 9f50872..a4255d7 100644 static void breakpoint_adjustment_warning (CORE_ADDR, CORE_ADDR, int, int); static CORE_ADDR adjust_breakpoint_address (struct gdbarch *gdbarch, -@@ -334,14 +333,14 @@ static int executing_startup; +@@ -337,14 +336,14 @@ static int executing_startup; B ? (TMP=B->next, 1): 0; \ B = TMP) @@ -508,7 +505,7 @@ index 9f50872..a4255d7 100644 /* Iterator for tracepoints only. */ -@@ -353,10 +352,31 @@ static int executing_startup; +@@ -356,10 +355,31 @@ static int executing_startup; struct breakpoint *breakpoint_chain; @@ -542,7 +539,7 @@ index 9f50872..a4255d7 100644 may still be reported by a target. */ VEC(bp_location_p) *moribund_locations = NULL; -@@ -579,6 +599,53 @@ get_breakpoint (int num) +@@ -582,6 +602,53 @@ get_breakpoint (int num) } @@ -596,7 +593,7 @@ index 9f50872..a4255d7 100644 /* condition N EXP -- set break condition of breakpoint N to EXP. */ static void -@@ -599,42 +666,7 @@ condition_command (char *arg, int from_tty) +@@ -602,42 +669,7 @@ condition_command (char *arg, int from_tty) ALL_BREAKPOINTS (b) if (b->number == bnum) { @@ -640,7 +637,7 @@ index 9f50872..a4255d7 100644 return; } -@@ -732,35 +764,88 @@ commands_from_control_command (char *arg, struct command_line *cmd) +@@ -735,35 +767,88 @@ commands_from_control_command (char *arg, struct command_line *cmd) } error (_("No breakpoint number %d."), bnum); } @@ -742,7 +739,7 @@ index 9f50872..a4255d7 100644 if (bp_addr + bp_size <= memaddr) /* The breakpoint is entirely before the chunk of memory we -@@ -909,7 +994,7 @@ update_watchpoint (struct breakpoint *b, int reparse) +@@ -912,7 +997,7 @@ update_watchpoint (struct breakpoint *b, int reparse) struct bp_location *loc; bpstat bs; @@ -751,7 +748,7 @@ index 9f50872..a4255d7 100644 update_global_locations will eventually delete them and remove breakpoints if needed. */ b->loc = NULL; -@@ -1344,7 +1429,7 @@ static void +@@ -1347,7 +1432,7 @@ static void insert_breakpoint_locations (void) { struct breakpoint *bpt; @@ -760,7 +757,7 @@ index 9f50872..a4255d7 100644 int error = 0; int val = 0; int disabled_breaks = 0; -@@ -1357,7 +1442,7 @@ insert_breakpoint_locations (void) +@@ -1360,7 +1445,7 @@ insert_breakpoint_locations (void) there was an error. */ fprintf_unfiltered (tmp_error_stream, "Warning:\n"); @@ -769,7 +766,7 @@ index 9f50872..a4255d7 100644 { if (!should_be_inserted (b) || b->inserted) continue; -@@ -1431,10 +1516,10 @@ You may have requested too many hardware breakpoints/watchpoints.\n"); +@@ -1434,10 +1519,10 @@ You may have requested too many hardware breakpoints/watchpoints.\n"); int remove_breakpoints (void) { @@ -782,7 +779,7 @@ index 9f50872..a4255d7 100644 { if (b->inserted) val |= remove_breakpoint (b, mark_uninserted); -@@ -1445,10 +1530,10 @@ remove_breakpoints (void) +@@ -1448,10 +1533,10 @@ remove_breakpoints (void) int remove_hw_watchpoints (void) { @@ -795,7 +792,7 @@ index 9f50872..a4255d7 100644 { if (b->inserted && b->loc_type == bp_loc_hardware_watchpoint) val |= remove_breakpoint (b, mark_uninserted); -@@ -1459,7 +1544,7 @@ remove_hw_watchpoints (void) +@@ -1462,7 +1547,7 @@ remove_hw_watchpoints (void) int reattach_breakpoints (int pid) { @@ -804,7 +801,7 @@ index 9f50872..a4255d7 100644 int val; struct cleanup *old_chain = save_inferior_ptid (); struct ui_file *tmp_error_stream = mem_fileopen (); -@@ -1468,7 +1553,7 @@ reattach_breakpoints (int pid) +@@ -1471,7 +1556,7 @@ reattach_breakpoints (int pid) make_cleanup_ui_file_delete (tmp_error_stream); inferior_ptid = pid_to_ptid (pid); @@ -813,7 +810,7 @@ index 9f50872..a4255d7 100644 { if (b->inserted) { -@@ -1566,12 +1651,42 @@ create_longjmp_master_breakpoint (char *func_name) +@@ -1569,12 +1654,42 @@ create_longjmp_master_breakpoint (char *func_name) update_global_location_list (1); } @@ -857,7 +854,7 @@ index 9f50872..a4255d7 100644 /* We're about to delete breakpoints from GDB's lists. If the INSERTED flag is true, GDB will try to lift the breakpoints by -@@ -1581,7 +1696,7 @@ update_breakpoints_after_exec (void) +@@ -1584,7 +1699,7 @@ update_breakpoints_after_exec (void) breakpoints out as soon as it detects an exec. We don't do that here instead, because there may be other attempts to delete breakpoints after detecting an exec and before reaching here. */ @@ -866,7 +863,7 @@ index 9f50872..a4255d7 100644 gdb_assert (!bploc->inserted); ALL_BREAKPOINTS_SAFE (b, temp) -@@ -1603,7 +1718,7 @@ update_breakpoints_after_exec (void) +@@ -1606,7 +1721,7 @@ update_breakpoints_after_exec (void) /* Thread event breakpoints must be set anew after an exec(), as must overlay event and longjmp master breakpoints. */ if (b->type == bp_thread_event || b->type == bp_overlay_event @@ -875,7 +872,7 @@ index 9f50872..a4255d7 100644 { delete_breakpoint (b); continue; -@@ -1618,7 +1733,8 @@ update_breakpoints_after_exec (void) +@@ -1621,7 +1736,8 @@ update_breakpoints_after_exec (void) /* Longjmp and longjmp-resume breakpoints are also meaningless after an exec. */ @@ -885,7 +882,7 @@ index 9f50872..a4255d7 100644 { delete_breakpoint (b); continue; -@@ -1679,12 +1795,13 @@ update_breakpoints_after_exec (void) +@@ -1682,12 +1798,13 @@ update_breakpoints_after_exec (void) create_longjmp_master_breakpoint ("_longjmp"); create_longjmp_master_breakpoint ("siglongjmp"); create_longjmp_master_breakpoint ("_siglongjmp"); @@ -900,7 +897,7 @@ index 9f50872..a4255d7 100644 int val = 0; struct cleanup *old_chain = save_inferior_ptid (); -@@ -1693,11 +1810,12 @@ detach_breakpoints (int pid) +@@ -1696,11 +1813,12 @@ detach_breakpoints (int pid) /* Set inferior_ptid; remove_breakpoint uses this global. */ inferior_ptid = pid_to_ptid (pid); @@ -914,7 +911,7 @@ index 9f50872..a4255d7 100644 do_cleanups (old_chain); return val; } -@@ -1790,12 +1908,14 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) +@@ -1793,12 +1911,14 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) return val; b->inserted = (is == mark_inserted); } @@ -931,7 +928,7 @@ index 9f50872..a4255d7 100644 val = target_remove_watchpoint (b->address, b->length, b->watchpoint_type); -@@ -1824,9 +1944,9 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) +@@ -1827,9 +1947,9 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) void mark_breakpoints_out (void) { @@ -943,7 +940,7 @@ index 9f50872..a4255d7 100644 bpt->inserted = 0; } -@@ -1846,7 +1966,7 @@ void +@@ -1849,7 +1969,7 @@ void breakpoint_init_inferior (enum inf_context context) { struct breakpoint *b, *temp; @@ -952,7 +949,7 @@ index 9f50872..a4255d7 100644 int ix; /* If breakpoint locations are shared across processes, then there's -@@ -1854,7 +1974,7 @@ breakpoint_init_inferior (enum inf_context context) +@@ -1857,7 +1977,7 @@ breakpoint_init_inferior (enum inf_context context) if (gdbarch_has_global_breakpoints (target_gdbarch)) return; @@ -961,7 +958,7 @@ index 9f50872..a4255d7 100644 if (bpt->owner->enable_state != bp_permanent) bpt->inserted = 0; -@@ -1915,10 +2035,10 @@ breakpoint_init_inferior (enum inf_context context) +@@ -1918,10 +2038,10 @@ breakpoint_init_inferior (enum inf_context context) enum breakpoint_here breakpoint_here_p (CORE_ADDR pc) { @@ -974,7 +971,7 @@ index 9f50872..a4255d7 100644 { if (bpt->loc_type != bp_loc_software_breakpoint && bpt->loc_type != bp_loc_hardware_breakpoint) -@@ -1958,16 +2078,16 @@ moribund_breakpoint_here_p (CORE_ADDR pc) +@@ -1961,16 +2081,16 @@ moribund_breakpoint_here_p (CORE_ADDR pc) } /* Returns non-zero if there's a breakpoint inserted at PC, which is @@ -994,7 +991,7 @@ index 9f50872..a4255d7 100644 { if (bpt->loc_type != bp_loc_software_breakpoint && bpt->loc_type != bp_loc_hardware_breakpoint) -@@ -2008,10 +2128,10 @@ breakpoint_inserted_here_p (CORE_ADDR pc) +@@ -2011,10 +2131,10 @@ breakpoint_inserted_here_p (CORE_ADDR pc) int software_breakpoint_inserted_here_p (CORE_ADDR pc) { @@ -1007,7 +1004,7 @@ index 9f50872..a4255d7 100644 { if (bpt->loc_type != bp_loc_software_breakpoint) continue; -@@ -2041,12 +2161,12 @@ software_breakpoint_inserted_here_p (CORE_ADDR pc) +@@ -2044,12 +2164,12 @@ software_breakpoint_inserted_here_p (CORE_ADDR pc) int breakpoint_thread_match (CORE_ADDR pc, ptid_t ptid) { @@ -1022,7 +1019,7 @@ index 9f50872..a4255d7 100644 { if (bpt->loc_type != bp_loc_software_breakpoint && bpt->loc_type != bp_loc_hardware_breakpoint) -@@ -2500,6 +2620,12 @@ print_it_typical (bpstat bs) +@@ -2503,6 +2623,12 @@ print_it_typical (bpstat bs) result = PRINT_NOTHING; break; @@ -1035,7 +1032,7 @@ index 9f50872..a4255d7 100644 case bp_watchpoint: case bp_hardware_watchpoint: annotate_watchpoint (b->number); -@@ -2587,6 +2713,8 @@ print_it_typical (bpstat bs) +@@ -2590,6 +2716,8 @@ print_it_typical (bpstat bs) case bp_none: case bp_longjmp: case bp_longjmp_resume: @@ -1044,7 +1041,7 @@ index 9f50872..a4255d7 100644 case bp_step_resume: case bp_watchpoint_scope: case bp_call_dummy: -@@ -2970,8 +3098,12 @@ bpstat_check_location (const struct bp_location *bl, CORE_ADDR bp_addr) +@@ -2973,8 +3101,12 @@ bpstat_check_location (const struct bp_location *bl, CORE_ADDR bp_addr) /* If BS refers to a watchpoint, determine if the watched values has actually changed, and we should stop. If not, set BS->stop @@ -1059,7 +1056,7 @@ index 9f50872..a4255d7 100644 bpstat_check_watchpoint (bpstat bs) { const struct bp_location *bl = bs->breakpoint_at; -@@ -3060,8 +3192,10 @@ bpstat_check_watchpoint (bpstat bs) +@@ -3063,8 +3195,10 @@ bpstat_check_watchpoint (bpstat bs) anything for this watchpoint. */ bs->print_it = print_it_noop; bs->stop = 0; @@ -1070,7 +1067,7 @@ index 9f50872..a4255d7 100644 } -@@ -3154,17 +3288,19 @@ bpstat +@@ -3157,17 +3291,19 @@ bpstat bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) { struct breakpoint *b = NULL; @@ -1093,7 +1090,7 @@ index 9f50872..a4255d7 100644 b = bl->owner; gdb_assert (b); if (!breakpoint_enabled (b) && b->enable_state != bp_permanent) -@@ -3185,6 +3321,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) +@@ -3188,6 +3324,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) /* Come here if it's a watchpoint, or if the break address matches */ bs = bpstat_alloc (bl, bs); /* Alloc a bpstat to explain stop */ @@ -1101,7 +1098,7 @@ index 9f50872..a4255d7 100644 /* Assume we stop. Should we find watchpoint that is not actually triggered, or if condition of breakpoint is false, we'll reset -@@ -3192,12 +3329,21 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) +@@ -3195,12 +3332,21 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) bs->stop = 1; bs->print = 1; @@ -1127,7 +1124,7 @@ index 9f50872..a4255d7 100644 /* We do not stop for these. */ bs->stop = 0; else -@@ -3205,14 +3351,15 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) +@@ -3208,14 +3354,15 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) if (bs->stop) { @@ -1145,7 +1142,7 @@ index 9f50872..a4255d7 100644 } if (b->silent) bs->print = 0; -@@ -3232,6 +3379,10 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) +@@ -3235,6 +3382,10 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) bs->print_it = print_it_noop; } @@ -1156,7 +1153,7 @@ index 9f50872..a4255d7 100644 for (ix = 0; VEC_iterate (bp_location_p, moribund_locations, ix, loc); ++ix) { if (loc->address == bp_addr) -@@ -3409,6 +3560,7 @@ bpstat_what (bpstat bs) +@@ -3412,6 +3563,7 @@ bpstat_what (bpstat bs) struct bpstat_what retval; retval.call_dummy = 0; @@ -1164,7 +1161,7 @@ index 9f50872..a4255d7 100644 for (; bs != NULL; bs = bs->next) { enum class bs_class = no_effect; -@@ -3455,10 +3607,15 @@ bpstat_what (bpstat bs) +@@ -3458,10 +3610,15 @@ bpstat_what (bpstat bs) bs_class = no_effect; break; case bp_longjmp: @@ -1180,7 +1177,7 @@ index 9f50872..a4255d7 100644 break; case bp_step_resume: if (bs->stop) -@@ -3481,6 +3638,7 @@ bpstat_what (bpstat bs) +@@ -3484,6 +3641,7 @@ bpstat_what (bpstat bs) case bp_thread_event: case bp_overlay_event: case bp_longjmp_master: @@ -1188,7 +1185,7 @@ index 9f50872..a4255d7 100644 bs_class = bp_nostop; break; case bp_catchpoint: -@@ -3602,6 +3760,8 @@ print_one_breakpoint_location (struct breakpoint *b, +@@ -3605,6 +3763,8 @@ print_one_breakpoint_location (struct breakpoint *b, {bp_access_watchpoint, "acc watchpoint"}, {bp_longjmp, "longjmp"}, {bp_longjmp_resume, "longjmp resume"}, @@ -1197,7 +1194,7 @@ index 9f50872..a4255d7 100644 {bp_step_resume, "step resume"}, {bp_watchpoint_scope, "watchpoint scope"}, {bp_call_dummy, "call dummy"}, -@@ -3609,6 +3769,7 @@ print_one_breakpoint_location (struct breakpoint *b, +@@ -3612,6 +3772,7 @@ print_one_breakpoint_location (struct breakpoint *b, {bp_thread_event, "thread events"}, {bp_overlay_event, "overlay events"}, {bp_longjmp_master, "longjmp master"}, @@ -1205,7 +1202,7 @@ index 9f50872..a4255d7 100644 {bp_catchpoint, "catchpoint"}, {bp_tracepoint, "tracepoint"}, {bp_jit_event, "jit events"}, -@@ -3732,6 +3893,8 @@ print_one_breakpoint_location (struct breakpoint *b, +@@ -3735,6 +3896,8 @@ print_one_breakpoint_location (struct breakpoint *b, case bp_finish: case bp_longjmp: case bp_longjmp_resume: @@ -1214,7 +1211,7 @@ index 9f50872..a4255d7 100644 case bp_step_resume: case bp_watchpoint_scope: case bp_call_dummy: -@@ -3739,6 +3902,7 @@ print_one_breakpoint_location (struct breakpoint *b, +@@ -3742,6 +3905,7 @@ print_one_breakpoint_location (struct breakpoint *b, case bp_thread_event: case bp_overlay_event: case bp_longjmp_master: @@ -1222,7 +1219,7 @@ index 9f50872..a4255d7 100644 case bp_tracepoint: case bp_jit_event: if (opts.addressprint) -@@ -4194,9 +4358,8 @@ set_default_breakpoint (int valid, CORE_ADDR addr, struct symtab *symtab, +@@ -4197,9 +4361,8 @@ set_default_breakpoint (int valid, CORE_ADDR addr, struct symtab *symtab, (or use it for any other purpose either). More specifically, each of the following breakpoint types will always @@ -1234,7 +1231,7 @@ index 9f50872..a4255d7 100644 bp_watchpoint bp_hardware_watchpoint -@@ -4216,88 +4379,6 @@ breakpoint_address_is_meaningful (struct breakpoint *bpt) +@@ -4219,88 +4382,6 @@ breakpoint_address_is_meaningful (struct breakpoint *bpt) && type != bp_catchpoint); } @@ -1323,7 +1320,7 @@ index 9f50872..a4255d7 100644 static void breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr, int bnum, int have_bnum) -@@ -4379,6 +4460,8 @@ allocate_bp_location (struct breakpoint *bpt) +@@ -4382,6 +4463,8 @@ allocate_bp_location (struct breakpoint *bpt) case bp_finish: case bp_longjmp: case bp_longjmp_resume: @@ -1332,7 +1329,7 @@ index 9f50872..a4255d7 100644 case bp_step_resume: case bp_watchpoint_scope: case bp_call_dummy: -@@ -4387,6 +4470,7 @@ allocate_bp_location (struct breakpoint *bpt) +@@ -4390,6 +4473,7 @@ allocate_bp_location (struct breakpoint *bpt) case bp_overlay_event: case bp_jit_event: case bp_longjmp_master: @@ -1340,7 +1337,7 @@ index 9f50872..a4255d7 100644 loc->loc_type = bp_loc_software_breakpoint; break; case bp_hardware_breakpoint: -@@ -4564,8 +4648,7 @@ make_breakpoint_permanent (struct breakpoint *b) +@@ -4568,8 +4652,7 @@ make_breakpoint_permanent (struct breakpoint *b) } /* Call this routine when stepping and nexting to enable a breakpoint @@ -1350,7 +1347,7 @@ index 9f50872..a4255d7 100644 void set_longjmp_breakpoint (int thread) -@@ -4577,10 +4660,10 @@ set_longjmp_breakpoint (int thread) +@@ -4581,10 +4664,10 @@ set_longjmp_breakpoint (int thread) longjmp "master" breakpoints. Here, we simply create momentary clones of those and enable them for the requested thread. */ ALL_BREAKPOINTS_SAFE (b, temp) @@ -1363,7 +1360,7 @@ index 9f50872..a4255d7 100644 clone->thread = thread; } } -@@ -4592,7 +4675,7 @@ delete_longjmp_breakpoint (int thread) +@@ -4596,7 +4679,7 @@ delete_longjmp_breakpoint (int thread) struct breakpoint *b, *temp; ALL_BREAKPOINTS_SAFE (b, temp) @@ -1372,7 +1369,7 @@ index 9f50872..a4255d7 100644 { if (b->thread == thread) delete_breakpoint (b); -@@ -4706,9 +4789,9 @@ create_solib_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address) +@@ -4710,9 +4793,9 @@ create_solib_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address) void disable_breakpoints_in_shlibs (void) { @@ -1384,7 +1381,7 @@ index 9f50872..a4255d7 100644 { struct breakpoint *b = loc->owner; /* We apply the check to all breakpoints, including disabled -@@ -4738,7 +4821,7 @@ disable_breakpoints_in_shlibs (void) +@@ -4742,7 +4825,7 @@ disable_breakpoints_in_shlibs (void) static void disable_breakpoints_in_unloaded_shlib (struct so_list *solib) { @@ -1393,7 +1390,7 @@ index 9f50872..a4255d7 100644 int disabled_shlib_breaks = 0; /* SunOS a.out shared libraries are always mapped, so do not -@@ -4749,7 +4832,7 @@ disable_breakpoints_in_unloaded_shlib (struct so_list *solib) +@@ -4753,7 +4836,7 @@ disable_breakpoints_in_unloaded_shlib (struct so_list *solib) && bfd_get_flavour (exec_bfd) == bfd_target_aout_flavour) return; @@ -1402,7 +1399,7 @@ index 9f50872..a4255d7 100644 { struct breakpoint *b = loc->owner; if ((loc->loc_type == bp_loc_hardware_breakpoint -@@ -5354,6 +5437,8 @@ mention (struct breakpoint *b) +@@ -5648,6 +5731,8 @@ mention (struct breakpoint *b) case bp_finish: case bp_longjmp: case bp_longjmp_resume: @@ -1411,7 +1408,7 @@ index 9f50872..a4255d7 100644 case bp_step_resume: case bp_call_dummy: case bp_watchpoint_scope: -@@ -5362,6 +5447,7 @@ mention (struct breakpoint *b) +@@ -5656,6 +5741,7 @@ mention (struct breakpoint *b) case bp_overlay_event: case bp_jit_event: case bp_longjmp_master: @@ -1419,7 +1416,7 @@ index 9f50872..a4255d7 100644 break; } -@@ -6664,6 +6750,7 @@ struct until_break_command_continuation_args +@@ -6958,6 +7044,7 @@ struct until_break_command_continuation_args { struct breakpoint *breakpoint; struct breakpoint *breakpoint2; @@ -1427,7 +1424,7 @@ index 9f50872..a4255d7 100644 }; /* This function is called by fetch_inferior_event via the -@@ -6678,6 +6765,7 @@ until_break_command_continuation (void *arg) +@@ -6972,6 +7059,7 @@ until_break_command_continuation (void *arg) delete_breakpoint (a->breakpoint); if (a->breakpoint2) delete_breakpoint (a->breakpoint2); @@ -1435,7 +1432,7 @@ index 9f50872..a4255d7 100644 } void -@@ -6689,6 +6777,8 @@ until_break_command (char *arg, int from_tty, int anywhere) +@@ -6983,6 +7071,8 @@ until_break_command (char *arg, int from_tty, int anywhere) struct breakpoint *breakpoint; struct breakpoint *breakpoint2 = NULL; struct cleanup *old_chain; @@ -1444,7 +1441,7 @@ index 9f50872..a4255d7 100644 clear_proceed_status (); -@@ -6727,6 +6817,9 @@ until_break_command (char *arg, int from_tty, int anywhere) +@@ -7021,6 +7111,9 @@ until_break_command (char *arg, int from_tty, int anywhere) old_chain = make_cleanup_delete_breakpoint (breakpoint); @@ -1454,7 +1451,7 @@ index 9f50872..a4255d7 100644 /* Keep within the current frame, or in frames called by the current one. */ -@@ -6739,6 +6832,10 @@ until_break_command (char *arg, int from_tty, int anywhere) +@@ -7033,6 +7126,10 @@ until_break_command (char *arg, int from_tty, int anywhere) frame_unwind_caller_id (frame), bp_until); make_cleanup_delete_breakpoint (breakpoint2); @@ -1465,7 +1462,7 @@ index 9f50872..a4255d7 100644 } proceed (-1, TARGET_SIGNAL_DEFAULT, 0); -@@ -6755,6 +6852,7 @@ until_break_command (char *arg, int from_tty, int anywhere) +@@ -7049,6 +7146,7 @@ until_break_command (char *arg, int from_tty, int anywhere) args->breakpoint = breakpoint; args->breakpoint2 = breakpoint2; @@ -1473,7 +1470,7 @@ index 9f50872..a4255d7 100644 discard_cleanups (old_chain); add_continuation (inferior_thread (), -@@ -7357,6 +7455,82 @@ do_vec_free (void *p) +@@ -7758,6 +7856,82 @@ do_vec_free (void *p) VEC_free (bp_location_p, *vec); } @@ -1556,7 +1553,7 @@ index 9f50872..a4255d7 100644 /* If SHOULD_INSERT is false, do not insert any breakpoint locations into the inferior, only remove already-inserted locations that no longer should be inserted. Functions that delete a breakpoint or -@@ -7376,49 +7550,66 @@ static void +@@ -7777,49 +7951,66 @@ static void update_global_location_list (int should_insert) { struct breakpoint *b; @@ -1652,7 +1649,7 @@ index 9f50872..a4255d7 100644 /* If this location is no longer present, and inserted, look if there's maybe a new location at the same address. If so, mark that one -@@ -7426,11 +7617,11 @@ update_global_location_list (int should_insert) +@@ -7827,11 +8018,11 @@ update_global_location_list (int should_insert) don't have a time window where a breakpoint at certain location is not inserted. */ @@ -1666,7 +1663,7 @@ index 9f50872..a4255d7 100644 { /* The location is still present in the location list, and still should be inserted. Don't do anything. */ -@@ -7441,37 +7632,46 @@ update_global_location_list (int should_insert) +@@ -7842,37 +8033,46 @@ update_global_location_list (int should_insert) /* The location is either no longer present, or got disabled. See if there's another location at the same address, in which case we don't need to remove this one from the target. */ @@ -1731,7 +1728,7 @@ index 9f50872..a4255d7 100644 } removed = 1; } -@@ -7493,19 +7693,59 @@ update_global_location_list (int should_insert) +@@ -7894,19 +8094,59 @@ update_global_location_list (int should_insert) longer need to keep this breakpoint. This is just a heuristic, but if it's wrong, we'll report unexpected SIGTRAP, which is usability issue, but not a correctness problem. */ @@ -1797,7 +1794,7 @@ index 9f50872..a4255d7 100644 } if (breakpoints_always_inserted_mode () && should_insert -@@ -7681,6 +7921,7 @@ delete_command (char *arg, int from_tty) +@@ -8083,6 +8323,7 @@ delete_command (char *arg, int from_tty) && b->type != bp_thread_event && b->type != bp_overlay_event && b->type != bp_longjmp_master @@ -1805,7 +1802,7 @@ index 9f50872..a4255d7 100644 && b->number >= 0) { breaks_to_delete = 1; -@@ -7700,6 +7941,7 @@ delete_command (char *arg, int from_tty) +@@ -8102,6 +8343,7 @@ delete_command (char *arg, int from_tty) && b->type != bp_jit_event && b->type != bp_overlay_event && b->type != bp_longjmp_master @@ -1813,7 +1810,7 @@ index 9f50872..a4255d7 100644 && b->number >= 0) delete_breakpoint (b); } -@@ -8002,6 +8244,7 @@ breakpoint_re_set_one (void *bint) +@@ -8404,6 +8646,7 @@ breakpoint_re_set_one (void *bint) reset later by breakpoint_re_set. */ case bp_overlay_event: case bp_longjmp_master: @@ -1821,7 +1818,7 @@ index 9f50872..a4255d7 100644 delete_breakpoint (b); break; -@@ -8025,6 +8268,8 @@ breakpoint_re_set_one (void *bint) +@@ -8427,6 +8670,8 @@ breakpoint_re_set_one (void *bint) case bp_longjmp: case bp_longjmp_resume: case bp_jit_event: @@ -1830,7 +1827,7 @@ index 9f50872..a4255d7 100644 break; } -@@ -8060,6 +8305,7 @@ breakpoint_re_set (void) +@@ -8462,6 +8707,7 @@ breakpoint_re_set (void) create_longjmp_master_breakpoint ("_longjmp"); create_longjmp_master_breakpoint ("siglongjmp"); create_longjmp_master_breakpoint ("_siglongjmp"); @@ -1838,7 +1835,7 @@ index 9f50872..a4255d7 100644 } /* Reset the thread number of this breakpoint: -@@ -8871,6 +9117,22 @@ all_tracepoints () +@@ -9327,6 +9573,22 @@ all_tracepoints () return tp_vec; } @@ -1861,17 +1858,17 @@ index 9f50872..a4255d7 100644 /* This help string is used for the break, hbreak, tbreak and thbreak commands. It is defined as a macro to prevent duplication. -@@ -9373,4 +9635,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."), +@@ -9850,4 +10112,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."), automatic_hardware_breakpoints = 1; observer_attach_about_to_proceed (breakpoint_about_to_proceed); + observer_attach_mark_used (breakpoint_types_mark_used); } diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h -index 70b1398..0f05b5a 100644 +index ba499c6..80f702f 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h -@@ -55,6 +55,13 @@ enum bptype +@@ -56,6 +56,13 @@ enum bptype bp_longjmp, /* secret breakpoint to find longjmp() */ bp_longjmp_resume, /* secret breakpoint to escape longjmp() */ @@ -1885,7 +1882,7 @@ index 70b1398..0f05b5a 100644 /* Used by wait_for_inferior for stepping over subroutine calls, for stepping over signal handlers, and for skipping prologues. */ bp_step_resume, -@@ -117,6 +124,9 @@ enum bptype +@@ -118,6 +125,9 @@ enum bptype bp_longjmp_master, @@ -1895,7 +1892,7 @@ index 70b1398..0f05b5a 100644 bp_catchpoint, bp_tracepoint, -@@ -227,10 +237,6 @@ struct bp_location +@@ -228,10 +238,6 @@ struct bp_location the same parent breakpoint. */ struct bp_location *next; @@ -1906,7 +1903,7 @@ index 70b1398..0f05b5a 100644 /* Type of this breakpoint location. */ enum bp_loc_type loc_type; -@@ -573,6 +579,10 @@ struct bpstat_what +@@ -583,6 +589,10 @@ struct bpstat_what continuing from a call dummy without popping the frame is not a useful one). */ int call_dummy; @@ -1917,7 +1914,7 @@ index 70b1398..0f05b5a 100644 }; /* The possible return values for print_bpstat, print_it_normal, -@@ -927,6 +937,9 @@ extern void breakpoint_retire_moribund (void); +@@ -946,6 +956,9 @@ extern int catching_syscall_number (int syscall_number); /* Tell a breakpoint to be quiet. */ extern void make_breakpoint_silent (struct breakpoint *); @@ -2340,9 +2337,18 @@ index f8e4f12..5b47e2e 100644 } } diff --git a/gdb/c-lang.c b/gdb/c-lang.c -index 4ba81ba..053f685 100644 +index 4ba81ba..bc35a3e 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c +@@ -459,7 +459,7 @@ c_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, + single character in isolation. This makes the code simpler + and probably does the sensible thing in the majority of + cases. */ +- while (num_chars == 1) ++ while (num_chars == 1 && things_printed < options->print_max) + { + /* Count the number of repetitions. */ + unsigned int reps = 0; @@ -715,7 +715,7 @@ c_get_string (struct value *value, gdb_byte **buffer, int *length, If length returned from read_string was > 0, return the number of characters read by dividing the number of bytes by width. */ @@ -3787,7 +3793,7 @@ index 7cb016d..bb9e35a 100644 default_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 7b26675..0e0c288 100644 +index 5a5f542..2c6bcef 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -959,8 +959,10 @@ Connect to process ID @var{number}, as with the @code{attach} command. @@ -3820,7 +3826,7 @@ index 7b26675..0e0c288 100644 @c resolve the situation of these eventually @item -tui @cindex @code{--tui} -@@ -18519,7 +18531,7 @@ command: +@@ -18650,7 +18662,7 @@ command: @table @code @kindex source @cindex execute commands from a file @@ -3829,7 +3835,7 @@ index 7b26675..0e0c288 100644 Execute the command file @var{filename}. @end table -@@ -18536,6 +18548,11 @@ If @code{-v}, for verbose mode, is given then @value{GDBN} displays +@@ -18667,6 +18679,11 @@ If @code{-v}, for verbose mode, is given then @value{GDBN} displays each command as it is executed. The option must be given before @var{filename}, and is interpreted as part of the filename anywhere else. @@ -3841,7 +3847,7 @@ index 7b26675..0e0c288 100644 Commands that would ask for confirmation if used interactively proceed without asking when used in a command file. Many @value{GDBN} commands that normally print messages to say what they are doing omit the messages -@@ -18797,8 +18814,6 @@ containing @code{end}. For example: +@@ -18928,8 +18945,6 @@ containing @code{end}. For example: @smallexample (@value{GDBP}) python @@ -3850,7 +3856,7 @@ index 7b26675..0e0c288 100644 >print 23 >end 23 -@@ -18811,6 +18826,14 @@ in a Python script. This can be controlled using @code{maint set +@@ -18942,6 +18957,14 @@ in a Python script. This can be controlled using @code{maint set python print-stack}: if @code{on}, the default, then Python stack printing is enabled; if @code{off}, then Python stack printing is disabled. @@ -3865,7 +3871,7 @@ index 7b26675..0e0c288 100644 @end table @node Python API -@@ -18818,6 +18841,14 @@ disabled. +@@ -18949,6 +18972,14 @@ disabled. @cindex python api @cindex programming in python @@ -3880,7 +3886,7 @@ index 7b26675..0e0c288 100644 @cindex python stdout @cindex python pagination At startup, @value{GDBN} overrides Python's @code{sys.stdout} and -@@ -18830,13 +18861,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown. +@@ -18961,13 +18992,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown. * Basic Python:: Basic Python Functions. * Exception Handling:: * Auto-loading:: Automatically loading Python code. @@ -3899,7 +3905,7 @@ index 7b26675..0e0c288 100644 * Frames In Python:: Acessing inferior stack frames from Python. @end menu -@@ -18863,6 +18898,12 @@ command as having originated from the user invoking it interactively. +@@ -18994,6 +19029,12 @@ command as having originated from the user invoking it interactively. It must be a boolean value. If omitted, it defaults to @code{False}. @end defun @@ -3912,7 +3918,7 @@ index 7b26675..0e0c288 100644 @findex gdb.parameter @defun parameter parameter Return the value of a @value{GDBN} parameter. @var{parameter} is a -@@ -18879,6 +18920,7 @@ a Python value of the appropriate type, and returned. +@@ -19010,6 +19051,7 @@ a Python value of the appropriate type, and returned. @defun history number Return a value from @value{GDBN}'s value history (@pxref{Value History}). @var{number} indicates which history element to return. @@ -3920,7 +3926,7 @@ index 7b26675..0e0c288 100644 If @var{number} is negative, then @value{GDBN} will take its absolute value and count backward from the last element (i.e., the most recent element) to find the value to return. If @var{number} is zero, then @value{GDBN} will -@@ -18890,6 +18932,28 @@ If no exception is raised, the return value is always an instance of +@@ -19021,6 +19063,28 @@ If no exception is raised, the return value is always an instance of @code{gdb.Value} (@pxref{Values From Inferior}). @end defun @@ -3949,7 +3955,7 @@ index 7b26675..0e0c288 100644 @findex gdb.write @defun write string Print a string to @value{GDBN}'s paginated standard output stream. -@@ -18904,6 +18968,11 @@ Flush @value{GDBN}'s paginated standard output stream. Flushing +@@ -19035,6 +19099,11 @@ Flush @value{GDBN}'s paginated standard output stream. Flushing function. @end defun @@ -3961,7 +3967,7 @@ index 7b26675..0e0c288 100644 @node Exception Handling @subsubsection Exception Handling @cindex python exceptions -@@ -19040,6 +19109,13 @@ The type of this @code{gdb.Value}. The value of this attribute is a +@@ -19171,6 +19240,13 @@ The type of this @code{gdb.Value}. The value of this attribute is a The following methods are provided: @table @code @@ -3975,7 +3981,7 @@ index 7b26675..0e0c288 100644 @defmethod Value dereference For pointer data types, this method returns a new @code{gdb.Value} object whose contents is the object pointed to by the pointer. For example, if -@@ -19111,6 +19187,9 @@ module: +@@ -19242,6 +19318,9 @@ module: This function looks up a type by name. @var{name} is the name of the type to look up. It must be a string. @@ -3985,7 +3991,7 @@ index 7b26675..0e0c288 100644 Ordinarily, this function will return an instance of @code{gdb.Type}. If the named type cannot be found, it will throw an exception. @end defun -@@ -19163,6 +19242,12 @@ This is @code{True} if the field is artificial, usually meaning that +@@ -19294,6 +19373,12 @@ This is @code{True} if the field is artificial, usually meaning that it was provided by the compiler and not the user. This attribute is always provided, and is @code{False} if the field is not artificial. @@ -3998,7 +4004,7 @@ index 7b26675..0e0c288 100644 @item bitsize If the field is packed, or is a bitfield, then this will have a non-zero value, which is the size of the field in bits. Otherwise, -@@ -19215,7 +19300,7 @@ If the type does not have a target, this method will throw an +@@ -19346,7 +19431,7 @@ If the type does not have a target, this method will throw an exception. @end defmethod @@ -4007,7 +4013,7 @@ index 7b26675..0e0c288 100644 If this @code{gdb.Type} is an instantiation of a template, this will return a new @code{gdb.Type} which represents the type of the @var{n}th template argument. -@@ -19223,7 +19308,8 @@ return a new @code{gdb.Type} which represents the type of the +@@ -19354,7 +19439,8 @@ return a new @code{gdb.Type} which represents the type of the If this @code{gdb.Type} is not a template type, this will throw an exception. Ordinarily, only C@t{++} code will have template types. @@ -4017,7 +4023,7 @@ index 7b26675..0e0c288 100644 @end defmethod @end table -@@ -19577,6 +19663,121 @@ import gdb.libstdcxx.v6 +@@ -19708,6 +19794,121 @@ import gdb.libstdcxx.v6 gdb.libstdcxx.v6.register_printers (gdb.current_objfile ()) @end smallexample @@ -4139,7 +4145,7 @@ index 7b26675..0e0c288 100644 @node Commands In Python @subsubsection Commands In Python -@@ -19829,6 +20030,135 @@ registration of the command with @value{GDBN}. Depending on how the +@@ -19960,6 +20161,135 @@ registration of the command with @value{GDBN}. Depending on how the Python code is read into @value{GDBN}, you may need to import the @code{gdb} module explicitly. @@ -4275,7 +4281,7 @@ index 7b26675..0e0c288 100644 @node Functions In Python @subsubsection Writing new convenience functions -@@ -19933,6 +20263,82 @@ which is used to format the value. @xref{Pretty Printing}, for more +@@ -20064,6 +20394,82 @@ which is used to format the value. @xref{Pretty Printing}, for more information. @end defivar @@ -4358,7 +4364,7 @@ index 7b26675..0e0c288 100644 @node Frames In Python @subsubsection Acessing inferior stack frames from Python. -@@ -19997,6 +20403,14 @@ function to a string. +@@ -20128,6 +20534,14 @@ function to a string. Returns the frame's resume address. @end defmethod @@ -4373,7 +4379,7 @@ index 7b26675..0e0c288 100644 @defmethod Frame older Return the frame that called this frame. @end defmethod -@@ -20005,10 +20419,18 @@ Return the frame that called this frame. +@@ -20136,10 +20550,18 @@ Return the frame that called this frame. Return the frame called by this frame. @end defmethod @@ -4392,304 +4398,11 @@ index 7b26675..0e0c288 100644 @end table @node Interpreters -@@ -23360,6 +23782,8 @@ access this functionality: - @item @strong{Operation} - @tab @strong{Description} - -+@item @code{-enable-pretty-printing} -+@tab enable Python-based pretty-printing - @item @code{-var-create} - @tab create a variable object - @item @code{-var-delete} -@@ -23388,6 +23812,8 @@ access this functionality: - @tab update the variable and its children - @item @code{-var-set-frozen} - @tab set frozeness attribute -+@item @code{-var-set-update-range} -+@tab set range of children to display on update - @end multitable - - In the next subsection we describe each operation in detail and suggest -@@ -23395,6 +23821,23 @@ how it can be used. - - @subheading Description And Use of Operations on Variable Objects - -+@subheading The @code{-enable-pretty-printing} Command -+@findex -enable-pretty-printing -+ -+@smallexample -+-enable-pretty-printing -+@end smallexample -+ -+@value{GDBN} allows Python-based visualizers to affect the output of the -+MI variable object commands. However, because there was no way to -+implement this in a fully backward-compatible way, a front end must -+request that this functionality be enabled. -+ -+Once sent, this command cannot be undone. -+ -+Note that if Python support has not been compiled into @value{GDBN}, -+this command will still succeed. -+ - @subheading The @code{-var-create} Command - @findex -var-create - -@@ -23434,15 +23877,55 @@ begin with a @samp{*}), or one of the following: - @samp{$@var{regname}} --- a CPU register name - @end itemize - -+A varobj's contents may be provided by a Python-based pretty-printer. In this -+case the varobj is known as a @dfn{dynamic varobj}. Dynamic varobjs -+have slightly different semantics in some cases. If the -+@code{-enable-pretty-printing} command is not sent, then @value{GDBN} -+will never create a dynamic varobj. This ensures backward -+compatibility for existing clients. -+ - @subsubheading Result - --This operation returns the name, number of children and the type of the --object created. Type is returned as a string as the ones generated by --the @value{GDBN} CLI. If a fixed variable object is bound to a --specific thread, the thread is is also printed: -+This operation returns attributes of the newly-created varobj. These -+include, but are not limited to: -+ -+@table @samp -+@item name -+The name of the varobj. -+ -+@item numchild -+The number of children of the varobj. This number is not necessarily -+reliable for a dynamic varobj. Instead, you must examine the -+@samp{has_more} attribute. -+ -+@item value -+The varobj's scalar value. For a varobj whose type is some sort of -+aggregate (e.g., a @code{struct}), or for a dynamic varobj, this value -+will not be interesting. -+ -+@item type -+The varobj's type. This is a string representation of the type, as -+would be printed by the @value{GDBN} CLI. -+ -+@item thread-id -+If a fixed variable object is bound to a specific thread, then this is -+the thread's identifier. -+ -+@item has_more -+For a dynamic varobj, this indicates whether there appear to be any -+children available. For a non-dynamic varobj, this will be 0. -+ -+@item dynamic -+This attribute will be present and have the value @samp{1} if the -+varobj is a dynamic varobj. If the varobj is not a dynamic varobj, -+then this attribute will not be present. -+@end table -+ -+Typical output will look like this: - - @smallexample -- name="@var{name}",numchild="@var{N}",type="@var{type}",thread-id="@var{M}" -+ name="@var{name}",numchild="@var{N}",type="@var{type}",thread-id="@var{M}", -+ has_more="@var{has_more}" - @end smallexample - - -@@ -23520,6 +24003,10 @@ Returns the number of children of a variable object @var{name}: - numchild=@var{n} - @end smallexample - -+Note that this number is not completely reliable for a dynamic varobj. -+It will return the current number of children, but more children may -+be available. -+ - - @subheading The @code{-var-list-children} Command - @findex -var-list-children -@@ -23527,7 +24014,7 @@ Returns the number of children of a variable object @var{name}: - @subsubheading Synopsis - - @smallexample -- -var-list-children [@var{print-values}] @var{name} -+ -var-list-children [@var{print-values}] @var{name} [@var{from} @var{to}] - @end smallexample - @anchor{-var-list-children} - -@@ -23540,6 +24027,22 @@ values; and if it is 2 or @code{--simple-values} print the name and - value for simple data types and just the name for arrays, structures - and unions. - -+@var{from} and @var{to}, if specified, indicate the range of children -+to report. If @var{from} or @var{to} is less than zero, the range is -+reset and all children will be reported. Otherwise, children starting -+at @var{from} (zero-based) and ending just before @var{to} will be -+reported. -+ -+If a child range is requested, it will not affect the range of -+children reported by a future call to @code{-var-update}. For this, -+you must instead use @code{-var-set-update-range}. The intent of this -+approach is to enable a front end to implement any update approach it -+likes; for example, scrolling a view may cause the front end to -+request more children with @code{-var-list-children}, and then the -+front end could call @code{-var-set-update-range} with a different -+range to ensure that future updates are restricted to just the visible -+items. -+ - For each child the following results are returned: - - @table @var -@@ -23556,8 +24059,13 @@ designate access qualifiers. For these pseudo children @var{exp} is - @samp{public}, @samp{private}, or @samp{protected}. In this case the - type and value are not present. - -+For a dynamic varobj, this value cannot reliably be used to form an -+expression. Also, a dynamic varobj will not report the access -+qualifying pseudo-children, regardless of the language. -+ - @item numchild --Number of children this child has. -+Number of children this child has. For a dynamic varobj, this will be -+0. - - @item type - The type of the child. -@@ -23573,6 +24081,19 @@ Otherwise this result is not present. - If the variable object is frozen, this variable will be present with a value of 1. - @end table - -+The result may have its own attributes: -+ -+@table @samp -+@item displayhint -+A dynamic varobj can supply a display hint to the front end. The -+comes directly from the Python pretty-printer object's -+@code{display_hint} method. @xref{Pretty Printing}. -+ -+@item has_more -+This is an integer attribute which is nonzero if there are children -+remaining after the end of the selected range. -+@end table -+ - @subsubheading Example - - @smallexample -@@ -23649,6 +24170,9 @@ result can be used only for UI presentation. Typical use of - the @code{-var-info-path-expression} command is creating a - watchpoint from a variable object. - -+This command is currently not valid for children of a dynamic varobj, -+and will give an error when invoked on one. -+ - For example, suppose @code{C} is a C@t{++} class, derived from class - @code{Base}, and that the @code{Base} class has a member called - @code{m_size}. Assume a variable @code{c} is has the type of -@@ -23754,6 +24278,68 @@ With the @samp{*} parameter, if a variable object is bound to a - currently running thread, it will not be updated, without any - diagnostic. - -+If @code{-var-set-update-range} was previously used on a varobj, then -+only the selected range of children will be reported. -+ -+@code{-var-update} reports all the changed varobjs in a tuple named -+@samp{changelist}. -+ -+Each item in the change list is itself a tuple holding: -+ -+@table @samp -+@item name -+The name of the varobj. -+ -+@item value -+If values were requested for this update, then this field will be -+present and will hold the value of the varobj. -+ -+@item in_scope -+This is a string, either @samp{false} if the varobj is not in scope, -+or @samp{true} if it is in scope. -+ -+@item type_changed -+This is only present if the varobj is still valid. If the type -+changed, then this will be the string @samp{true}; otherwise it will -+be @samp{false}. -+ -+@item new_type -+If the varobj's type changed, then this field will be present and will -+hold the new type. -+ -+@item new_num_children -+For a dynamic varobj, if the number of children changed, or if the -+type changed, this will be the new number of children. -+ -+The @samp{numchild} field in other varobj responses is generally not -+valid for a dynamic varobj -- it will show the number of children that -+@value{GDBN} knows about, but because dynamic varobjs lazily -+instantiate their children, this will not reflect the number of -+children which may be available. -+ -+The @samp{new_num_children} attribute only reports changes to the -+number of children known by @value{GDBN}. This is the only way to -+detect whether an update has removed children (which necessarily can -+only happen at the end of the update range). -+ -+@item displayhint -+The display hint, if any. -+ -+@item has_more -+This is an integer value, which will be 1 if there are more children -+available outside the varobj's update range. -+ -+@item dynamic -+This attribute will be present and have the value @samp{1} if the -+varobj is a dynamic varobj. If the varobj is not a dynamic varobj, -+then this attribute will not be present. -+ -+@item new_children -+If new children were added to a dynamic varobj within the selected -+update range (as set by @code{-var-set-update-range}), then they will -+be listed in this attribute. -+@end table -+ - @subsubheading Example - - @smallexample -@@ -23821,6 +24407,32 @@ Unfreezing a variable does not update it, only subsequent - (gdb) - @end smallexample - -+@subheading The @code{-var-set-update-range} command -+@findex -var-set-update-range -+@anchor{-var-set-update-range} -+ -+@subsubheading Synopsis -+ -+@smallexample -+ -var-set-update-range @var{name} @var{from} @var{to} -+@end smallexample -+ -+Set the range of children to be returned by future invocations of -+@code{-var-update}. -+ -+@var{from} and @var{to} indicate the range of children to report. If -+@var{from} or @var{to} is less than zero, the range is reset and all -+children will be reported. Otherwise, children starting at @var{from} -+(zero-based) and ending just before @var{to} will be reported. -+ -+@subsubheading Example -+ -+@smallexample -+(gdb) -+-var-set-update-range V 1 2 -+^done -+@end smallexample -+ - @subheading The @code{-var-set-visualizer} command - @findex -var-set-visualizer - @anchor{-var-set-visualizer} diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo -index e706caa..6b055d3 100644 +index c2be3f7..a7811ab 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo -@@ -2106,6 +2106,18 @@ time, and so we attempt to handle symbols incrementally. For instance, +@@ -2114,6 +2114,18 @@ time, and so we attempt to handle symbols incrementally. For instance, we create @dfn{partial symbol tables} consisting of only selected symbols, and only expand them to full symbol tables when necessary. @@ -4708,7 +4421,7 @@ index e706caa..6b055d3 100644 @section Symbol Reading @cindex symbol reading -@@ -2198,6 +2210,7 @@ symtab. Upon return, @code{pst->readin} should have been set to 1, and +@@ -2206,6 +2218,7 @@ symtab. Upon return, @code{pst->readin} should have been set to 1, and zero if there were no symbols in that part of the symbol file. @end table @@ -4716,7 +4429,7 @@ index e706caa..6b055d3 100644 @section Partial Symbol Tables @value{GDBN} has three types of symbol tables: -@@ -2293,6 +2306,7 @@ and all the psymbols themselves are allocated in a pair of large arrays +@@ -2301,6 +2314,7 @@ and all the psymbols themselves are allocated in a pair of large arrays on an obstack, so there is little to be gained by trying to free them unless you want to do a lot more work. @@ -4724,7 +4437,7 @@ index e706caa..6b055d3 100644 @section Types @unnumberedsubsec Fundamental Types (e.g., @code{FT_VOID}, @code{FT_BOOLEAN}). -@@ -2315,6 +2329,7 @@ types map to one @code{TYPE_CODE_*} type, and are distinguished by +@@ -2323,6 +2337,7 @@ types map to one @code{TYPE_CODE_*} type, and are distinguished by other members of the type struct, such as whether the type is signed or unsigned, and how many bits it uses. @@ -4732,7 +4445,7 @@ index e706caa..6b055d3 100644 @unnumberedsubsec Builtin Types (e.g., @code{builtin_type_void}, @code{builtin_type_char}). These are instances of type structs that roughly correspond to -@@ -2329,6 +2344,7 @@ only one instance exists, while @file{c-lang.c} builds as many +@@ -2337,6 +2352,7 @@ only one instance exists, while @file{c-lang.c} builds as many @code{TYPE_CODE_INT} types as needed, with each one associated with some particular objfile. @@ -4740,7 +4453,7 @@ index e706caa..6b055d3 100644 @section Object File Formats @cindex object file formats -@@ -2414,6 +2430,7 @@ SOM, which is a cross-language ABI). +@@ -2422,6 +2438,7 @@ SOM, which is a cross-language ABI). The SOM reader is in @file{somread.c}. @@ -4748,7 +4461,7 @@ index e706caa..6b055d3 100644 @section Debugging File Formats This section describes characteristics of debugging information that -@@ -2485,6 +2502,7 @@ DWARF 3 is an improved version of DWARF 2. +@@ -2493,6 +2510,7 @@ DWARF 3 is an improved version of DWARF 2. @cindex SOM debugging info Like COFF, the SOM definition includes debugging information. @@ -4756,7 +4469,7 @@ index e706caa..6b055d3 100644 @section Adding a New Symbol Reader to @value{GDBN} @cindex adding debugging info reader -@@ -2507,6 +2525,7 @@ will only ever be implemented by one object file format may be called +@@ -2515,6 +2533,7 @@ will only ever be implemented by one object file format may be called directly. This interface should be described in a file @file{bfd/lib@var{xyz}.h}, which is included by @value{GDBN}. @@ -4764,7 +4477,7 @@ index e706caa..6b055d3 100644 @section Memory Management for Symbol Files Most memory associated with a loaded symbol file is stored on -@@ -2518,10 +2537,45 @@ released when the objfile is unloaded or reloaded. Therefore one +@@ -2526,10 +2545,45 @@ released when the objfile is unloaded or reloaded. Therefore one objfile must not reference symbol or type data from another objfile; they could be unloaded at different times. @@ -4831,7 +4544,7 @@ index 4984f31..fcf1b5d 100644 This observer is used for internal testing. Do not use. See testsuite/gdb.gdb/observer.exp. diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c -index f9ca067..979b649 100644 +index 668c434..c29c3a5 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -38,6 +38,7 @@ @@ -4842,24 +4555,7 @@ index f9ca067..979b649 100644 struct comp_unit; -@@ -379,8 +380,15 @@ execute_stack_op (gdb_byte *exp, ULONGEST len, int addr_size, - dwarf_expr_eval (ctx, exp, len); - result = dwarf_expr_fetch (ctx, 0); - -- if (ctx->in_reg) -+ if (ctx->location == DWARF_VALUE_REGISTER) - result = read_reg (this_frame, result); -+ else if (ctx->location != DWARF_VALUE_MEMORY) -+ { -+ /* This is actually invalid DWARF, but if we ever do run across -+ it somehow, we might as well support it. So, instead, report -+ it as unimplemented. */ -+ error (_("Not implemented: computing unwound register using explicit value operator")); -+ } - - do_cleanups (old_chain); - -@@ -1566,6 +1574,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc) +@@ -1574,6 +1575,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc) CORE_ADDR offset; CORE_ADDR seek_pc; @@ -4875,152 +4571,10 @@ index f9ca067..979b649 100644 if (fde_table == NULL) continue; diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c -index 6401e72..0644b46 100644 +index 46bc9d7..e675575 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c -@@ -125,8 +125,7 @@ dwarf_expr_fetch (struct dwarf_expr_context *ctx, int n) - - /* Add a new piece to CTX's piece list. */ - static void --add_piece (struct dwarf_expr_context *ctx, -- int in_reg, CORE_ADDR value, ULONGEST size) -+add_piece (struct dwarf_expr_context *ctx, ULONGEST size) - { - struct dwarf_expr_piece *p; - -@@ -141,9 +140,15 @@ add_piece (struct dwarf_expr_context *ctx, - * sizeof (struct dwarf_expr_piece)); - - p = &ctx->pieces[ctx->num_pieces - 1]; -- p->in_reg = in_reg; -- p->value = value; -+ p->location = ctx->location; - p->size = size; -+ if (p->location == DWARF_VALUE_LITERAL) -+ { -+ p->v.literal.data = ctx->data; -+ p->v.literal.length = ctx->len; -+ } -+ else -+ p->v.value = dwarf_expr_fetch (ctx, 0); - } - - /* Evaluate the expression at ADDR (LEN bytes long) using the context -@@ -287,6 +292,23 @@ signed_address_type (struct gdbarch *gdbarch, int addr_size) - } - } - -+ -+/* Check that the current operator is either at the end of an -+ expression, or that it is followed by a composition operator. */ -+ -+static void -+require_composition (gdb_byte *op_ptr, gdb_byte *op_end, const char *op_name) -+{ -+ /* It seems like DW_OP_GNU_uninit should be handled here. However, -+ it doesn't seem to make sense for DW_OP_*_value, and it was not -+ checked at the other place that this function is called. */ -+ if (op_ptr != op_end && *op_ptr != DW_OP_piece && *op_ptr != DW_OP_bit_piece) -+ error (_("DWARF-2 expression error: `%s' operations must be " -+ "used either alone or in conjuction with DW_OP_piece " -+ "or DW_OP_bit_piece."), -+ op_name); -+} -+ - /* The engine for the expression evaluator. Using the context in CTX, - evaluate the expression between OP_PTR and OP_END. */ - -@@ -295,8 +317,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, - gdb_byte *op_ptr, gdb_byte *op_end) - { - enum bfd_endian byte_order = gdbarch_byte_order (ctx->gdbarch); -- -- ctx->in_reg = 0; -+ ctx->location = DWARF_VALUE_MEMORY; - ctx->initialized = 1; /* Default is initialized. */ - - if (ctx->recursion_depth > ctx->max_recursion_depth) -@@ -436,20 +457,36 @@ execute_stack_op (struct dwarf_expr_context *ctx, - "used either alone or in conjuction with DW_OP_piece.")); - - result = op - DW_OP_reg0; -- ctx->in_reg = 1; -- -+ ctx->location = DWARF_VALUE_REGISTER; - break; - - case DW_OP_regx: - op_ptr = read_uleb128 (op_ptr, op_end, ®); -- if (op_ptr != op_end && *op_ptr != DW_OP_piece) -- error (_("DWARF-2 expression error: DW_OP_reg operations must be " -- "used either alone or in conjuction with DW_OP_piece.")); -+ require_composition (op_ptr, op_end, "DW_OP_regx"); - - result = reg; -- ctx->in_reg = 1; -+ ctx->location = DWARF_VALUE_REGISTER; - break; - -+ case DW_OP_implicit_value: -+ { -+ ULONGEST len; -+ op_ptr = read_uleb128 (op_ptr, op_end, &len); -+ if (op_ptr + len > op_end) -+ error (_("DW_OP_implicit_value: too few bytes available.")); -+ ctx->len = len; -+ ctx->data = op_ptr; -+ ctx->location = DWARF_VALUE_LITERAL; -+ op_ptr += len; -+ require_composition (op_ptr, op_end, "DW_OP_implicit_value"); -+ } -+ goto no_push; -+ -+ case DW_OP_stack_value: -+ ctx->location = DWARF_VALUE_STACK; -+ require_composition (op_ptr, op_end, "DW_OP_stack_value"); -+ goto no_push; -+ - case DW_OP_breg0: - case DW_OP_breg1: - case DW_OP_breg2: -@@ -513,12 +550,15 @@ execute_stack_op (struct dwarf_expr_context *ctx, - specific this_base method. */ - (ctx->get_frame_base) (ctx->baton, &datastart, &datalen); - dwarf_expr_eval (ctx, datastart, datalen); -+ if (ctx->location == DWARF_VALUE_LITERAL -+ || ctx->location == DWARF_VALUE_STACK) -+ error (_("Not implemented: computing frame base using explicit value operator")); - result = dwarf_expr_fetch (ctx, 0); -- if (ctx->in_reg) -+ if (ctx->location == DWARF_VALUE_REGISTER) - result = (ctx->read_reg) (ctx->baton, result); - result = result + offset; - ctx->stack_len = before_stack_len; -- ctx->in_reg = 0; -+ ctx->location = DWARF_VALUE_MEMORY; - } - break; - case DW_OP_dup: -@@ -758,12 +798,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, - - /* Record the piece. */ - op_ptr = read_uleb128 (op_ptr, op_end, &size); -- addr_or_regnum = dwarf_expr_fetch (ctx, 0); -- add_piece (ctx, ctx->in_reg, addr_or_regnum, size); -+ add_piece (ctx, size); - -- /* Pop off the address/regnum, and clear the in_reg flag. */ -- dwarf_expr_pop (ctx); -- ctx->in_reg = 0; -+ /* Pop off the address/regnum, and reset the location -+ type. */ -+ if (ctx->location != DWARF_VALUE_LITERAL) -+ dwarf_expr_pop (ctx); -+ ctx->location = DWARF_VALUE_MEMORY; - } - goto no_push; - -@@ -775,6 +816,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, +@@ -848,6 +848,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, ctx->initialized = 0; goto no_push; @@ -5035,30 +4589,10 @@ index 6401e72..0644b46 100644 error (_("Unhandled dwarf expression opcode 0x%x"), op); } diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h -index 6b3a068..597c2de 100644 +index a9a8a05..d449012 100644 --- a/gdb/dwarf2expr.h +++ b/gdb/dwarf2expr.h -@@ -23,6 +23,19 @@ - #if !defined (DWARF2EXPR_H) - #define DWARF2EXPR_H - -+/* The location of a value. */ -+enum dwarf_value_location -+{ -+ /* The piece is in memory. */ -+ DWARF_VALUE_MEMORY, -+ /* The piece is in a register. */ -+ DWARF_VALUE_REGISTER, -+ /* The piece is on the stack. */ -+ DWARF_VALUE_STACK, -+ /* The piece is a literal. */ -+ DWARF_VALUE_LITERAL -+}; -+ - /* The expression evaluator works with a dwarf_expr_context, describing - its current state and its callbacks. */ - struct dwarf_expr_context -@@ -70,19 +83,23 @@ struct dwarf_expr_context +@@ -102,10 +102,10 @@ struct dwarf_expr_context The result must be live until the current expression evaluation is complete. */ unsigned char *(*get_subr) (void *baton, off_t offset, size_t *length); @@ -5070,85 +4604,8 @@ index 6b3a068..597c2de 100644 /* The current depth of dwarf expression recursion, via DW_OP_call*, DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum - depth we'll tolerate before raising an error. */ - int recursion_depth, max_recursion_depth; - -- /* Non-zero if the result is in a register. The register number -- will be on the expression stack. */ -- int in_reg; -+ /* Location of the value. */ -+ enum dwarf_value_location location; -+ -+ /* For VALUE_LITERAL, a the current literal value's length and -+ data. */ -+ ULONGEST len; -+ gdb_byte *data; - - /* Initialization status of variable: Non-zero if variable has been - initialized; zero otherwise. */ -@@ -93,9 +110,9 @@ struct dwarf_expr_context - - Each time DW_OP_piece is executed, we add a new element to the - end of this array, recording the current top of the stack, the -- current in_reg flag, and the size given as the operand to -- DW_OP_piece. We then pop the top value from the stack, clear the -- in_reg flag, and resume evaluation. -+ current location, and the size given as the operand to -+ DW_OP_piece. We then pop the top value from the stack, rest the -+ location, and resume evaluation. - - The Dwarf spec doesn't say whether DW_OP_piece pops the top value - from the stack. We do, ensuring that clients of this interface -@@ -106,12 +123,11 @@ struct dwarf_expr_context - - If an expression never uses DW_OP_piece, num_pieces will be zero. - (It would be nice to present these cases as expressions yielding -- a single piece, with in_reg clear, so that callers need not -- distinguish between the no-DW_OP_piece and one-DW_OP_piece cases. -- But expressions with no DW_OP_piece operations have no value to -- place in a piece's 'size' field; the size comes from the -- surrounding data. So the two cases need to be handled -- separately.) */ -+ a single piece, so that callers need not distinguish between the -+ no-DW_OP_piece and one-DW_OP_piece cases. But expressions with -+ no DW_OP_piece operations have no value to place in a piece's -+ 'size' field; the size comes from the surrounding data. So the -+ two cases need to be handled separately.) */ - int num_pieces; - struct dwarf_expr_piece *pieces; - }; -@@ -120,13 +136,22 @@ struct dwarf_expr_context - /* A piece of an object, as recorded by DW_OP_piece. */ - struct dwarf_expr_piece - { -- /* If IN_REG is zero, then the piece is in memory, and VALUE is its address. -- If IN_REG is non-zero, then the piece is in a register, and VALUE -- is the register number. */ -- int in_reg; -- -- /* This piece's address or register number. */ -- CORE_ADDR value; -+ enum dwarf_value_location location; -+ -+ union -+ { -+ /* This piece's address or register number. */ -+ CORE_ADDR value; -+ -+ struct -+ { -+ /* A pointer to the data making up this piece, for literal -+ pieces. */ -+ gdb_byte *data; -+ /* The length of the available data. */ -+ ULONGEST length; -+ } literal; -+ } v; - - /* The length of the piece, in bytes. */ - ULONGEST size; diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index c3f6d40..af816f4 100644 +index 3a81202..85f4487 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -116,6 +116,9 @@ struct dwarf_expr_baton @@ -5181,7 +4638,7 @@ index c3f6d40..af816f4 100644 + gdb_assert (symbaton != NULL); + *start = symbaton->data; + *length = symbaton->size; -+ } + } + else if (SYMBOL_COMPUTED_OPS (framefunc) == &dwarf2_missing_funcs) + { + struct dwarf2_locexpr_baton *symbaton; @@ -5190,7 +4647,7 @@ index c3f6d40..af816f4 100644 + gdb_assert (symbaton == NULL); + *start = NULL; + *length = 0; /* unused */ - } ++ } + else + internal_error (__FILE__, __LINE__, + _("Unsupported SYMBOL_COMPUTED_OPS %p for \"%s\""), @@ -5334,48 +4791,7 @@ index c3f6d40..af816f4 100644 struct piece_closure { /* The number of pieces used to describe this variable. */ -@@ -259,18 +396,18 @@ read_pieced_value (struct value *v) - memset (contents + offset, 0, p->size); - set_value_optimized_out (v, 1); - } -- else if (p->in_reg) -+ else if (p->location == DWARF_VALUE_REGISTER) - { - struct gdbarch *arch = get_frame_arch (frame); - gdb_byte regval[MAX_REGISTER_SIZE]; -- int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, p->value); -+ int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, p->v.value); - - get_frame_register (frame, gdb_regnum, regval); - memcpy (contents + offset, regval, p->size); - } - else - { -- read_memory (p->value, contents + offset, p->size); -+ read_memory (p->v.value, contents + offset, p->size); - } - offset += p->size; - } -@@ -295,15 +432,15 @@ write_pieced_value (struct value *to, struct value *from) - for (i = 0; i < c->n_pieces; i++) - { - struct dwarf_expr_piece *p = &c->pieces[i]; -- if (p->in_reg) -+ if (p->location == DWARF_VALUE_REGISTER) - { - struct gdbarch *arch = get_frame_arch (frame); -- int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, p->value); -+ int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, p->v.value); - put_frame_register (frame, gdb_regnum, contents + offset); - } - else - { -- write_memory (p->value, contents + offset, p->size); -+ write_memory (p->v.value, contents + offset, p->size); - } - offset += p->size; - } -@@ -343,9 +480,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -382,9 +519,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, struct dwarf2_per_cu_data *per_cu) { struct value *retval; @@ -5386,17 +4802,17 @@ index c3f6d40..af816f4 100644 if (size == 0) { -@@ -355,22 +491,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -394,22 +530,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, return retval; } - baton.frame = frame; - baton.objfile = dwarf2_per_cu_objfile (per_cu); -- -- ctx = new_dwarf_expr_context (); -- old_chain = make_cleanup_free_dwarf_expr_context (ctx); + ctx = dwarf_expr_prep_ctx (frame, data, size, per_cu); +- ctx = new_dwarf_expr_context (); +- old_chain = make_cleanup_free_dwarf_expr_context (ctx); +- - ctx->gdbarch = get_objfile_arch (baton.objfile); - ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); - ctx->baton = &baton; @@ -5410,110 +4826,19 @@ index c3f6d40..af816f4 100644 if (ctx->num_pieces > 0) { struct piece_closure *c; -@@ -382,22 +504,70 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, - c); - VALUE_FRAME_ID (retval) = frame_id; - } -- else if (ctx->in_reg) -- { -- struct gdbarch *arch = get_frame_arch (frame); -- CORE_ADDR dwarf_regnum = dwarf_expr_fetch (ctx, 0); -- int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, dwarf_regnum); -- retval = value_from_register (SYMBOL_TYPE (var), gdb_regnum, frame); -- } - else - { -- CORE_ADDR address = dwarf_expr_fetch (ctx, 0); -- -- retval = allocate_value (SYMBOL_TYPE (var)); -- VALUE_LVAL (retval) = lval_memory; -- set_value_lazy (retval, 1); -- set_value_stack (retval, 1); -- set_value_address (retval, address); -+ switch (ctx->location) -+ { -+ case DWARF_VALUE_REGISTER: -+ { -+ struct gdbarch *arch = get_frame_arch (frame); -+ CORE_ADDR dwarf_regnum = dwarf_expr_fetch (ctx, 0); -+ int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, dwarf_regnum); -+ retval = value_from_register (SYMBOL_TYPE (var), gdb_regnum, frame); -+ } -+ break; -+ -+ case DWARF_VALUE_MEMORY: -+ { -+ CORE_ADDR address = dwarf_expr_fetch (ctx, 0); -+ +@@ -439,6 +561,11 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, + CORE_ADDR address = dwarf_expr_fetch (ctx, 0); + int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0); + + /* object_address_set called here is required in ALLOCATE_VALUE's + CHECK_TYPEDEF for the object's possible + DW_OP_push_object_address. */ + object_address_set (address); + -+ retval = allocate_value (SYMBOL_TYPE (var)); -+ VALUE_LVAL (retval) = lval_memory; -+ set_value_lazy (retval, 1); -+ set_value_stack (retval, 1); -+ set_value_address (retval, address); -+ } -+ break; -+ -+ case DWARF_VALUE_STACK: -+ { -+ gdb_byte bytes[sizeof (ULONGEST)]; -+ ULONGEST value = (ULONGEST) dwarf_expr_fetch (ctx, 0); -+ bfd_byte *contents; -+ size_t n = ctx->addr_size; -+ -+ store_unsigned_integer (bytes, ctx->addr_size, -+ gdbarch_byte_order (ctx->gdbarch), -+ value); -+ retval = allocate_value (SYMBOL_TYPE (var)); -+ contents = value_contents_raw (retval); -+ if (n > TYPE_LENGTH (SYMBOL_TYPE (var))) -+ n = TYPE_LENGTH (SYMBOL_TYPE (var)); -+ memcpy (contents, bytes, n); -+ } -+ break; -+ -+ case DWARF_VALUE_LITERAL: -+ { -+ bfd_byte *contents; -+ size_t n = ctx->len; -+ -+ retval = allocate_value (SYMBOL_TYPE (var)); -+ contents = value_contents_raw (retval); -+ if (n > TYPE_LENGTH (SYMBOL_TYPE (var))) -+ n = TYPE_LENGTH (SYMBOL_TYPE (var)); -+ memcpy (contents, ctx->data, n); -+ } -+ break; -+ -+ default: -+ internal_error (__FILE__, __LINE__, _("invalid location type")); -+ } - } - - set_value_initialized (retval, ctx->initialized); -@@ -494,7 +664,7 @@ dwarf2_loc_desc_needs_frame (gdb_byte *data, unsigned short size, - - dwarf_expr_eval (ctx, data, size); - -- in_reg = ctx->in_reg; -+ in_reg = ctx->location == DWARF_VALUE_REGISTER; - - if (ctx->num_pieces > 0) - { -@@ -503,7 +673,7 @@ dwarf2_loc_desc_needs_frame (gdb_byte *data, unsigned short size, - /* If the location has several pieces, and any of them are in - registers, then we will need a frame to fetch them from. */ - for (i = 0; i < ctx->num_pieces; i++) -- if (ctx->pieces[i].in_reg) -+ if (ctx->pieces[i].location == DWARF_VALUE_REGISTER) - in_reg = 1; - } - -@@ -735,7 +905,7 @@ static int + retval = allocate_value (SYMBOL_TYPE (var)); + VALUE_LVAL (retval) = lval_memory; + set_value_lazy (retval, 1); +@@ -815,7 +942,7 @@ static int loclist_describe_location (struct symbol *symbol, struct ui_file *stream) { /* FIXME: Could print the entire list of locations. */ @@ -5522,7 +4847,7 @@ index c3f6d40..af816f4 100644 return 1; } -@@ -751,16 +921,56 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, +@@ -831,16 +958,56 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, data = find_location_expression (dlbaton, &size, ax->scope); if (data == NULL) @@ -5599,7 +4924,7 @@ index 0bfcfca..01018d6 100644 #endif /* dwarf2loc.h */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 7f04427..31504fe 100644 +index 4cce36b..d394887 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -48,6 +48,12 @@ @@ -5666,7 +4991,7 @@ index 7f04427..31504fe 100644 char *name; char *dirname; -@@ -691,6 +712,11 @@ struct field_info +@@ -689,6 +710,11 @@ struct field_info int nfnfields; }; @@ -5678,7 +5003,7 @@ index 7f04427..31504fe 100644 /* One item on the queue of compilation units to read in full symbols for. */ struct dwarf2_queue_item -@@ -802,7 +828,10 @@ static void scan_partial_symbols (struct partial_die_info *, +@@ -800,7 +826,10 @@ static void scan_partial_symbols (struct partial_die_info *, static void add_partial_symbol (struct partial_die_info *, struct dwarf2_cu *); @@ -5690,7 +5015,7 @@ index 7f04427..31504fe 100644 static void add_partial_namespace (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, -@@ -827,6 +856,10 @@ static void dwarf2_psymtab_to_symtab (struct partial_symtab *); +@@ -825,6 +854,10 @@ static void dwarf2_psymtab_to_symtab (struct partial_symtab *); static void psymtab_to_symtab_1 (struct partial_symtab *); @@ -5701,7 +5026,7 @@ index 7f04427..31504fe 100644 static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu); static void dwarf2_free_abbrev_table (void *); -@@ -947,8 +980,13 @@ static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *); +@@ -945,8 +978,13 @@ static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *); static struct type *read_type_die (struct die_info *, struct dwarf2_cu *); @@ -5715,7 +5040,7 @@ index 7f04427..31504fe 100644 static char *typename_concat (struct obstack *, const char *prefix, const char *suffix, -@@ -966,7 +1004,8 @@ static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *, +@@ -964,7 +1002,8 @@ static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *, struct dwarf2_cu *, struct partial_symtab *); static int dwarf2_get_pc_bounds (struct die_info *, @@ -5725,7 +5050,7 @@ index 7f04427..31504fe 100644 static void get_scope_pc_bounds (struct die_info *, CORE_ADDR *, CORE_ADDR *, -@@ -990,17 +1029,25 @@ static void dwarf2_attach_fn_fields_to_type (struct field_info *, +@@ -988,17 +1027,25 @@ static void dwarf2_attach_fn_fields_to_type (struct field_info *, static void process_structure_scope (struct die_info *, struct dwarf2_cu *); @@ -5754,7 +5079,7 @@ index 7f04427..31504fe 100644 static const char *namespace_name (struct die_info *die, int *is_anonymous, struct dwarf2_cu *); -@@ -1036,6 +1083,9 @@ static void process_die (struct die_info *, struct dwarf2_cu *); +@@ -1034,6 +1081,9 @@ static void process_die (struct die_info *, struct dwarf2_cu *); static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *); @@ -5764,7 +5089,7 @@ index 7f04427..31504fe 100644 static char *dwarf2_canonicalize_name (char *, struct dwarf2_cu *, struct obstack *); -@@ -1078,7 +1128,7 @@ static int is_ref_attr (struct attribute *); +@@ -1076,7 +1126,7 @@ static int is_ref_attr (struct attribute *); static unsigned int dwarf2_get_ref_die_offset (struct attribute *); @@ -5773,7 +5098,7 @@ index 7f04427..31504fe 100644 static struct die_info *follow_die_ref_or_sig (struct die_info *, struct attribute *, -@@ -1150,6 +1200,9 @@ static void age_cached_comp_units (void); +@@ -1148,6 +1198,9 @@ static void age_cached_comp_units (void); static void free_one_cached_comp_unit (void *); @@ -5783,7 +5108,7 @@ index 7f04427..31504fe 100644 static struct type *set_die_type (struct die_info *, struct type *, struct dwarf2_cu *); -@@ -1169,22 +1222,31 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); +@@ -1167,22 +1220,31 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu); @@ -5824,7 +5149,7 @@ index 7f04427..31504fe 100644 } /* When loading sections, we can either look for ".", or for -@@ -1277,10 +1339,13 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *ignore_ptr) +@@ -1275,10 +1337,13 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *ignore_ptr) } /* Decompress a section that was compressed using zlib. Store the @@ -5840,7 +5165,7 @@ index 7f04427..31504fe 100644 gdb_byte **outbuf, bfd_size_type *outsize) { bfd *abfd = objfile->obfd; -@@ -1297,6 +1362,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -1295,6 +1360,7 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, z_stream strm; int rc; int header_size = 12; @@ -5848,7 +5173,7 @@ index 7f04427..31504fe 100644 if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0 || bfd_bread (compressed_buffer, compressed_size, abfd) != compressed_size) -@@ -1326,8 +1392,13 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -1324,8 +1390,13 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, strm.avail_in = compressed_size - header_size; strm.next_in = (Bytef*) compressed_buffer + header_size; strm.avail_out = uncompressed_size; @@ -5864,7 +5189,7 @@ index 7f04427..31504fe 100644 rc = inflateInit (&strm); while (strm.avail_in > 0) { -@@ -1348,26 +1419,176 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, +@@ -1346,26 +1417,176 @@ zlib_decompress_section (struct objfile *objfile, asection *sectp, error (_("Dwarf Error: concluding DWARF uncompression in '%s': %d"), bfd_get_filename (abfd), rc); @@ -6046,7 +5371,7 @@ index 7f04427..31504fe 100644 if (info->asection == NULL || info->size == 0) return; -@@ -1380,7 +1601,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) +@@ -1378,7 +1599,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) /* Upon decompression, update the buffer and its size. */ if (strncmp (header, "ZLIB", sizeof (header)) == 0) { @@ -6055,7 +5380,7 @@ index 7f04427..31504fe 100644 &info->size); return; } -@@ -1403,7 +1624,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) +@@ -1401,7 +1622,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) if (retbuf != MAP_FAILED) { @@ -6064,7 +5389,7 @@ index 7f04427..31504fe 100644 info->buffer = retbuf + (sectp->filepos & (pagesize - 1)) ; return; } -@@ -1411,8 +1632,15 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) +@@ -1409,8 +1630,15 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) #endif /* If we get here, we are a normal, not-compressed section. */ @@ -6082,7 +5407,7 @@ index 7f04427..31504fe 100644 /* When debugging .o files, we may need to apply relocations; see http://sourceware.org/ml/gdb-patches/2002-04/msg00136.html . -@@ -1421,6 +1649,8 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) +@@ -1419,6 +1647,8 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) retbuf = symfile_relocate_debug_section (abfd, sectp, buf); if (retbuf != NULL) { @@ -6091,7 +5416,7 @@ index 7f04427..31504fe 100644 info->buffer = retbuf; return; } -@@ -1429,6 +1659,19 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) +@@ -1427,6 +1657,19 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) || bfd_bread (buf, info->size, abfd) != info->size) error (_("Dwarf Error: Can't read DWARF data from '%s'"), bfd_get_filename (abfd)); @@ -6111,7 +5436,7 @@ index 7f04427..31504fe 100644 } /* Fill in SECTP, BUFP and SIZEP with section info, given OBJFILE and -@@ -1812,6 +2055,37 @@ lookup_signatured_type (struct objfile *objfile, ULONGEST sig) +@@ -1810,6 +2053,37 @@ lookup_signatured_type (struct objfile *objfile, ULONGEST sig) return entry; } @@ -6149,7 +5474,7 @@ index 7f04427..31504fe 100644 /* Subroutine of process_type_comp_unit and dwarf2_build_psymtabs_hard to combine the common parts. Process a compilation unit for a psymtab. -@@ -2361,7 +2635,7 @@ partial_die_parent_scope (struct partial_die_info *pdi, +@@ -2359,7 +2633,7 @@ partial_die_parent_scope (struct partial_die_info *pdi, ignoring them. */ complaint (&symfile_complaints, _("unhandled containing DIE tag %d for DIE at %d"), @@ -6158,7 +5483,7 @@ index 7f04427..31504fe 100644 parent->scope = grandparent_scope; } -@@ -2376,12 +2650,22 @@ partial_die_full_name (struct partial_die_info *pdi, +@@ -2374,12 +2648,22 @@ partial_die_full_name (struct partial_die_info *pdi, struct dwarf2_cu *cu) { char *parent_scope; @@ -6185,7 +5510,7 @@ index 7f04427..31504fe 100644 } static void -@@ -2397,12 +2681,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2395,12 +2679,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -6201,7 +5526,7 @@ index 7f04427..31504fe 100644 if (actual_name == NULL) actual_name = pdi->name; -@@ -2493,6 +2774,12 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2491,6 +2772,12 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) &objfile->global_psymbols, 0, (CORE_ADDR) 0, cu->language, objfile); break; @@ -6214,7 +5539,7 @@ index 7f04427..31504fe 100644 case DW_TAG_class_type: case DW_TAG_interface_type: case DW_TAG_structure_type: -@@ -2534,22 +2821,6 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2532,22 +2819,6 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) break; } @@ -6237,7 +5562,7 @@ index 7f04427..31504fe 100644 if (built_actual_name) xfree (actual_name); } -@@ -2559,9 +2830,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2557,9 +2828,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) name listed in the die. */ static int @@ -6249,7 +5574,7 @@ index 7f04427..31504fe 100644 { case DW_TAG_namespace: case DW_TAG_typedef: -@@ -2571,7 +2842,23 @@ pdi_needs_namespace (enum dwarf_tag tag) +@@ -2569,7 +2840,23 @@ pdi_needs_namespace (enum dwarf_tag tag) case DW_TAG_union_type: case DW_TAG_enumeration_type: case DW_TAG_enumerator: @@ -6273,7 +5598,7 @@ index 7f04427..31504fe 100644 default: return 0; } -@@ -2604,12 +2891,12 @@ static void +@@ -2602,12 +2889,12 @@ static void add_partial_module (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, int need_pc, struct dwarf2_cu *cu) { @@ -6290,7 +5615,7 @@ index 7f04427..31504fe 100644 } /* Read a partial die corresponding to a subprogram and create a partial -@@ -2700,27 +2987,6 @@ guess_structure_name (struct partial_die_info *struct_pdi, +@@ -2698,27 +2985,6 @@ guess_structure_name (struct partial_die_info *struct_pdi, if (real_pdi->die_parent != NULL) return; @@ -6318,7 +5643,7 @@ index 7f04427..31504fe 100644 } } -@@ -3297,6 +3563,14 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -3295,6 +3561,14 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_imported_declaration: case DW_TAG_imported_module: processing_has_namespace_info = 1; @@ -6333,7 +5658,7 @@ index 7f04427..31504fe 100644 if (die->child != NULL && (die->tag == DW_TAG_imported_declaration || cu->language != language_fortran)) complaint (&symfile_complaints, _("Tag '%s' has unexpected children"), -@@ -3312,41 +3586,68 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -3310,41 +3584,68 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) /* Return the fully qualified name of DIE, based on its DW_AT_name. If scope qualifiers are appropriate they will be added. The result will be allocated on the objfile_obstack, or NULL if the DIE does @@ -6423,7 +5748,7 @@ index 7f04427..31504fe 100644 /* Read the import statement specified by the given die and record it. */ static void -@@ -3356,9 +3657,15 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) +@@ -3354,9 +3655,15 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) struct die_info *imported_die; const char *imported_name; const char *imported_name_prefix; @@ -6441,7 +5766,7 @@ index 7f04427..31504fe 100644 import_attr = dwarf2_attr (die, DW_AT_import, cu); if (import_attr == NULL) { -@@ -3406,17 +3713,27 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) +@@ -3404,17 +3711,27 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) return; } @@ -6475,7 +5800,7 @@ index 7f04427..31504fe 100644 canonical_name = alloca (strlen (imported_name_prefix) + 2 + strlen (imported_name) + 1); strcpy (canonical_name, imported_name_prefix); strcat (canonical_name, "::"); -@@ -3427,8 +3744,14 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) +@@ -3425,8 +3742,14 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) canonical_name = alloca (strlen (imported_name) + 1); strcpy (canonical_name, imported_name); } @@ -6492,7 +5817,7 @@ index 7f04427..31504fe 100644 } static void -@@ -3697,6 +4020,14 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) +@@ -3695,6 +4018,14 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr; attr = dwarf2_attr (die, DW_AT_abstract_origin, cu); @@ -6507,7 +5832,7 @@ index 7f04427..31504fe 100644 if (!attr) return; -@@ -3795,6 +4126,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3793,6 +4124,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) char *name; CORE_ADDR baseaddr; struct block *block; @@ -6515,7 +5840,7 @@ index 7f04427..31504fe 100644 int inlined_func = (die->tag == DW_TAG_inlined_subroutine); if (inlined_func) -@@ -3813,13 +4145,23 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3811,13 +4143,23 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -6542,7 +5867,7 @@ index 7f04427..31504fe 100644 lowpc += baseaddr; highpc += baseaddr; -@@ -3846,14 +4188,19 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3844,14 +4186,19 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) cu->list_in_scope = &local_symbols; @@ -6569,7 +5894,7 @@ index 7f04427..31504fe 100644 } inherit_abstract_dies (die, cu); -@@ -3869,6 +4216,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3867,6 +4214,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) determine_prefix (die, cu), processing_has_namespace_info); @@ -6583,7 +5908,7 @@ index 7f04427..31504fe 100644 /* If we have address ranges, record them. */ dwarf2_record_block_ranges (die, block, baseaddr, cu); -@@ -3905,7 +4259,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3903,7 +4257,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) as multiple lexical blocks? Handling children in a sane way would be nasty. Might be easier to properly extend generic blocks to describe ranges. */ @@ -6592,7 +5917,7 @@ index 7f04427..31504fe 100644 return; lowpc += baseaddr; highpc += baseaddr; -@@ -3922,7 +4276,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3920,7 +4274,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) } new = pop_context (); @@ -6601,7 +5926,7 @@ index 7f04427..31504fe 100644 { struct block *block = finish_block (0, &local_symbols, new->old_blocks, new->start_addr, -@@ -4077,7 +4431,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return, +@@ -4075,7 +4429,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return, discontinuous, i.e. derived from DW_AT_ranges information. */ static int dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, @@ -6611,7 +5936,7 @@ index 7f04427..31504fe 100644 { struct attribute *attr; CORE_ADDR low = 0; -@@ -4105,7 +4460,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, +@@ -4103,7 +4458,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, { /* Value of the DW_AT_ranges attribute is the offset in the .debug_ranges section. */ @@ -6620,7 +5945,7 @@ index 7f04427..31504fe 100644 return 0; /* Found discontinuous range of addresses. */ ret = -1; -@@ -4144,7 +4499,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die, +@@ -4142,7 +4497,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die, CORE_ADDR low, high; struct die_info *child = die->child; @@ -6629,7 +5954,7 @@ index 7f04427..31504fe 100644 { *lowpc = min (*lowpc, low); *highpc = max (*highpc, high); -@@ -4181,7 +4536,7 @@ get_scope_pc_bounds (struct die_info *die, +@@ -4179,7 +4534,7 @@ get_scope_pc_bounds (struct die_info *die, CORE_ADDR best_high = (CORE_ADDR) 0; CORE_ADDR current_low, current_high; @@ -6638,7 +5963,7 @@ index 7f04427..31504fe 100644 { best_low = current_low; best_high = current_high; -@@ -4663,7 +5018,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, +@@ -4661,7 +5016,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, /* The name is already allocated along with this objfile, so we don't need to duplicate it for the type. */ fnp->physname = physname ? physname : ""; @@ -6647,7 +5972,7 @@ index 7f04427..31504fe 100644 this_type = read_type_die (die, cu); if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC) { -@@ -4723,18 +5078,18 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, +@@ -4721,18 +5076,18 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, { /* Support the .debug_loc offsets */ if (attr_form_is_block (attr)) @@ -6673,7 +5998,7 @@ index 7f04427..31504fe 100644 } } -@@ -4847,7 +5202,7 @@ quirk_gcc_member_function_pointer (struct die_info *die, struct dwarf2_cu *cu) +@@ -4845,7 +5200,7 @@ quirk_gcc_member_function_pointer (struct die_info *die, struct dwarf2_cu *cu) return NULL; domain_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (pfn_type, 0)); @@ -6682,7 +6007,7 @@ index 7f04427..31504fe 100644 smash_to_method_type (type, domain_type, TYPE_TARGET_TYPE (pfn_type), TYPE_FIELDS (pfn_type), TYPE_NFIELDS (pfn_type), TYPE_VARARGS (pfn_type)); -@@ -4900,7 +5255,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4898,7 +5253,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -6691,7 +6016,7 @@ index 7f04427..31504fe 100644 INIT_CPLUS_SPECIFIC (type); name = dwarf2_name (die, cu); -@@ -4909,14 +5264,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4907,14 +5262,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) if (cu->language == language_cplus || cu->language == language_java) { @@ -6713,7 +6038,7 @@ index 7f04427..31504fe 100644 } } -@@ -5126,7 +5485,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5124,7 +5483,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -6722,7 +6047,7 @@ index 7f04427..31504fe 100644 TYPE_CODE (type) = TYPE_CODE_ENUM; name = dwarf2_full_name (die, cu); -@@ -5154,51 +5513,6 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5152,51 +5511,6 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -6774,7 +6099,7 @@ index 7f04427..31504fe 100644 /* Given a pointer to a die which begins an enumeration, process all the dies that define the members of the enumeration, and create the symbol for the enumeration type. -@@ -5276,6 +5590,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -5274,6 +5588,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) new_symbol (die, this_type, cu); } @@ -6804,7 +6129,7 @@ index 7f04427..31504fe 100644 /* Extract all information from a DW_TAG_array_type DIE and put it in the DIE's type field. For now, this only handles one dimensional arrays. */ -@@ -5289,7 +5626,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5287,7 +5624,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) struct type *element_type, *range_type, *index_type; struct type **range_types = NULL; struct attribute *attr; @@ -6813,7 +6138,7 @@ index 7f04427..31504fe 100644 struct cleanup *back_to; char *name; -@@ -5336,16 +5673,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5334,16 +5671,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) type = element_type; if (read_array_order (die, cu) == DW_ORD_col_major) @@ -6835,7 +6160,7 @@ index 7f04427..31504fe 100644 /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -5412,12 +5744,14 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5410,12 +5742,14 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, set_type, cu); } @@ -6852,7 +6177,7 @@ index 7f04427..31504fe 100644 struct attribute *attr; struct symbol *sym; CORE_ADDR base = (CORE_ADDR) 0; -@@ -5427,25 +5761,55 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) +@@ -5425,25 +5759,55 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) { /* Support the .debug_loc offsets */ if (attr_form_is_block (attr)) @@ -6915,7 +6240,7 @@ index 7f04427..31504fe 100644 attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu); if (attr) { -@@ -5463,8 +5827,25 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) +@@ -5461,8 +5825,25 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) SYMBOL_VALUE_ADDRESS (sym) = base + byte_offset; add_symbol_to_list (sym, &global_symbols); } @@ -6941,7 +6266,7 @@ index 7f04427..31504fe 100644 } } -@@ -5532,7 +5913,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -5530,7 +5911,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) if (is_anonymous) { const char *previous_prefix = determine_prefix (die, cu); @@ -6950,7 +6275,7 @@ index 7f04427..31504fe 100644 } } -@@ -5548,20 +5929,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -5546,20 +5927,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) } } @@ -7109,7 +6434,7 @@ index 7f04427..31504fe 100644 } /* Return the name of the namespace represented by DIE. Set -@@ -5726,29 +6242,113 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5724,29 +6240,113 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -7237,7 +6562,7 @@ index 7f04427..31504fe 100644 char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -5843,7 +6443,6 @@ static struct type * +@@ -5841,7 +6441,6 @@ static struct type * read_typedef (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; @@ -7245,7 +6570,7 @@ index 7f04427..31504fe 100644 const char *name = NULL; struct type *this_type; -@@ -5951,8 +6550,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5949,8 +6548,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type; struct type *range_type; struct attribute *attr; @@ -7255,7 +6580,7 @@ index 7f04427..31504fe 100644 char *name; base_type = die_type (die, cu); -@@ -5965,42 +6563,89 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5963,42 +6561,89 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) 0, NULL, cu->objfile); } @@ -7374,7 +6699,7 @@ index 7f04427..31504fe 100644 name = dwarf2_name (die, cu); if (name) -@@ -6471,6 +7116,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, +@@ -6469,6 +7114,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, && abbrev->tag != DW_TAG_lexical_block && abbrev->tag != DW_TAG_variable && abbrev->tag != DW_TAG_namespace @@ -7382,7 +6707,7 @@ index 7f04427..31504fe 100644 && abbrev->tag != DW_TAG_member) { /* Otherwise we skip to the next sibling, if any. */ -@@ -6691,9 +7337,6 @@ read_partial_die (struct partial_die_info *part_die, +@@ -6689,9 +7335,6 @@ read_partial_die (struct partial_die_info *part_die, if (part_die->dirname == NULL) part_die->dirname = DW_STRING (&attr); break; @@ -7392,7 +6717,7 @@ index 7f04427..31504fe 100644 case DW_AT_low_pc: has_low_pc_attr = 1; part_die->lowpc = DW_ADDR (&attr); -@@ -6925,7 +7568,8 @@ fixup_partial_die (struct partial_die_info *part_die, +@@ -6923,7 +7566,8 @@ fixup_partial_die (struct partial_die_info *part_die, /* If we found a reference attribute and the DIE has no name, try to find a name in the referred to DIE. */ @@ -7749,7 +7074,7 @@ index 7f04427..31504fe 100644 } /* Get name of a die, return NULL if not found. */ -@@ -10202,11 +11072,11 @@ dwarf2_get_ref_die_offset (struct attribute *attr) +@@ -10200,11 +11070,11 @@ dwarf2_get_ref_die_offset (struct attribute *attr) return 0; } @@ -7764,7 +7089,7 @@ index 7f04427..31504fe 100644 { if (attr->form == DW_FORM_sdata) return DW_SND (attr); -@@ -11011,8 +11881,6 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11009,8 +11879,6 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, { gdb_byte *mac_ptr, *mac_end; struct macro_source_file *current_file = 0; @@ -7773,7 +7098,7 @@ index 7f04427..31504fe 100644 if (dwarf2_per_objfile->macinfo.buffer == NULL) { -@@ -11020,29 +11888,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11018,29 +11886,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, return; } @@ -7808,7 +7133,7 @@ index 7f04427..31504fe 100644 } macinfo_type = read_1_byte (abfd, mac_ptr); -@@ -11053,92 +11911,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11051,92 +11909,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, /* A zero macinfo type indicates the end of the macro information. */ case 0: @@ -7902,7 +7227,7 @@ index 7f04427..31504fe 100644 case DW_MACINFO_define: case DW_MACINFO_undef: -@@ -11153,31 +11926,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11151,31 +11924,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, mac_ptr += bytes_read; if (! current_file) @@ -7945,7 +7270,7 @@ index 7f04427..31504fe 100644 } break; -@@ -11191,22 +11952,9 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11189,22 +11950,9 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read); mac_ptr += bytes_read; @@ -7971,7 +7296,7 @@ index 7f04427..31504fe 100644 } break; -@@ -11260,7 +12008,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11258,7 +12006,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, } break; } @@ -7980,7 +7305,7 @@ index 7f04427..31504fe 100644 } /* Check if the attribute's form is a DW_FORM_block* -@@ -11320,6 +12068,34 @@ attr_form_is_constant (struct attribute *attr) +@@ -11318,6 +12066,34 @@ attr_form_is_constant (struct attribute *attr) } } @@ -8015,7 +7340,7 @@ index 7f04427..31504fe 100644 static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu) -@@ -11349,35 +12125,25 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, +@@ -11347,35 +12123,25 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, SYMBOL_COMPUTED_OPS (sym) = &dwarf2_loclist_funcs; SYMBOL_LOCATION_BATON (sym) = baton; } @@ -8066,7 +7391,7 @@ index 7f04427..31504fe 100644 } } -@@ -11665,6 +12431,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) +@@ -11663,6 +12429,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) return ofs_lhs->offset == ofs_rhs->offset; } @@ -8098,7 +7423,7 @@ index 7f04427..31504fe 100644 /* Set the type associated with DIE to TYPE. Save it in CU's hash table if necessary. For convenience, return TYPE. */ -@@ -11673,6 +12464,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -11671,6 +12462,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { struct dwarf2_offset_and_type **slot, ofs; @@ -8107,7 +7432,7 @@ index 7f04427..31504fe 100644 if (cu->type_hash == NULL) { gdb_assert (cu->per_cu != NULL); -@@ -11815,23 +12608,13 @@ show_dwarf2_cmd (char *args, int from_tty) +@@ -11813,23 +12606,13 @@ show_dwarf2_cmd (char *args, int from_tty) cmd_show_list (show_dwarf2_cmdlist, from_tty, ""); } @@ -8135,8 +7460,8 @@ index 7f04427..31504fe 100644 } /* munmap debug sections for OBJFILE, if necessary. */ -@@ -11840,15 +12623,15 @@ static void - dwarf2_per_objfile_cleanup (struct objfile *objfile, void *d) +@@ -11838,15 +12621,15 @@ static void + dwarf2_per_objfile_free (struct objfile *objfile, void *d) { struct dwarf2_per_objfile *data = d; - munmap_section_buffer (&data->info); @@ -8160,13 +7485,13 @@ index 7f04427..31504fe 100644 } void _initialize_dwarf2_read (void); -@@ -11856,6 +12639,7 @@ void _initialize_dwarf2_read (void); +@@ -11854,6 +12637,7 @@ void _initialize_dwarf2_read (void); void _initialize_dwarf2_read (void) { + die_list = VEC_alloc (die_info_p, 32); dwarf2_objfile_data_key - = register_objfile_data_with_cleanup (dwarf2_per_objfile_cleanup); + = register_objfile_data_with_cleanup (NULL, dwarf2_per_objfile_free); diff --git a/gdb/elfread.c b/gdb/elfread.c index 6e79d4a..198bae3 100644 @@ -8515,7 +7840,7 @@ index 7e41d39..37ffe23 100644 default: val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); diff --git a/gdb/expression.h b/gdb/expression.h -index 12163e3..bf2b518 100644 +index effe1f0..3e083ca 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -88,6 +88,16 @@ enum exp_opcode @@ -8535,7 +7860,7 @@ index 12163e3..bf2b518 100644 /* end of C++. */ /* For Modula-2 integer division DIV */ -@@ -435,4 +445,5 @@ extern char *op_string (enum exp_opcode); +@@ -438,4 +448,5 @@ extern char *op_string (enum exp_opcode); extern void dump_raw_expression (struct expression *, struct ui_file *, char *); extern void dump_prefix_expression (struct expression *, struct ui_file *); @@ -9995,10 +9320,10 @@ index 8c027c9..d201f76 100644 else { diff --git a/gdb/frame.c b/gdb/frame.c -index 9ca69bf..1b4e67c 100644 +index 7932b48..4e7c434 100644 --- a/gdb/frame.c +++ b/gdb/frame.c -@@ -1157,6 +1157,14 @@ has_stack_frames (void) +@@ -1171,6 +1171,14 @@ has_stack_frames (void) if (ptid_equal (inferior_ptid, null_ptid)) return 0; @@ -11588,7 +10913,7 @@ index 0f9d44e..c910e88 100644 /* We didn't find it; print the raw data. */ if (vbit) diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c -index 991b27f..411b41b 100644 +index fe848ff..170e6cd 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -586,6 +586,8 @@ i386_linux_store_inferior_registers (struct target_ops *ops, @@ -11683,7 +11008,7 @@ index 991b27f..411b41b 100644 static void i386_linux_new_thread (ptid_t ptid) { -@@ -832,6 +877,8 @@ _initialize_i386_linux_nat (void) +@@ -837,6 +882,8 @@ _initialize_i386_linux_nat (void) i386_dr_low.set_addr = i386_linux_dr_set_addr; i386_dr_low.reset_addr = i386_linux_dr_reset_addr; i386_dr_low.get_status = i386_linux_dr_get_status; @@ -11929,7 +11254,7 @@ index 9e98290..fab1892 100644 proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); diff --git a/gdb/inferior.h b/gdb/inferior.h -index 7312e51..d4eae88 100644 +index f1b5d17..31add7d 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -272,6 +272,8 @@ extern void interrupt_target_command (char *args, int from_tty); @@ -11942,7 +11267,7 @@ index 7312e51..d4eae88 100644 extern void notice_new_inferior (ptid_t, int, int); diff --git a/gdb/infrun.c b/gdb/infrun.c -index c907635..bda8d84 100644 +index 1a83a25..2ee2164 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -45,6 +45,8 @@ @@ -11963,7 +11288,7 @@ index c907635..bda8d84 100644 static void stop_stepping (struct execution_control_state *ecs); static void prepare_to_wait (struct execution_control_state *ecs); -@@ -2633,6 +2637,10 @@ handle_inferior_event (struct execution_control_state *ecs) +@@ -2687,6 +2691,10 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid)); @@ -11974,7 +11299,7 @@ index c907635..bda8d84 100644 ecs->event_thread->stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid); ecs->random_signal = !bpstat_explains_signal (ecs->event_thread->stop_bpstat); -@@ -2670,6 +2678,10 @@ handle_inferior_event (struct execution_control_state *ecs) +@@ -2724,6 +2732,10 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid)); @@ -11985,7 +11310,7 @@ index c907635..bda8d84 100644 /* This causes the eventpoints and symbol table to be reset. Must do this now, before trying to determine whether to stop. */ -@@ -3411,23 +3423,33 @@ process_event_stop_test: +@@ -3468,23 +3480,33 @@ process_event_stop_test: ecs->event_thread->stepping_over_breakpoint = 1; @@ -12031,7 +11356,7 @@ index c907635..bda8d84 100644 keep_going (ecs); return; -@@ -3439,6 +3461,53 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n"); +@@ -3496,6 +3518,53 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n"); gdb_assert (ecs->event_thread->step_resume_breakpoint != NULL); delete_step_resume_breakpoint (ecs->event_thread); @@ -12085,7 +11410,7 @@ index c907635..bda8d84 100644 ecs->event_thread->stop_step = 1; print_stop_reason (END_STEPPING_RANGE, 0); stop_stepping (ecs); -@@ -4431,6 +4500,96 @@ insert_longjmp_resume_breakpoint (struct gdbarch *gdbarch, CORE_ADDR pc) +@@ -4500,6 +4569,96 @@ insert_longjmp_resume_breakpoint (struct gdbarch *gdbarch, CORE_ADDR pc) set_momentary_breakpoint_at_pc (gdbarch, pc, bp_longjmp_resume); } @@ -12182,7 +11507,7 @@ index c907635..bda8d84 100644 static void stop_stepping (struct execution_control_state *ecs) { -@@ -4499,6 +4658,8 @@ keep_going (struct execution_control_state *ecs) +@@ -4568,6 +4727,8 @@ keep_going (struct execution_control_state *ecs) } if (e.reason < 0) { @@ -12337,10 +11662,10 @@ index 3e943a1..3b8956c 100644 } return values; diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c -index 1308844..e6fad24 100644 +index 98f6347..0907f03 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c -@@ -1629,6 +1629,7 @@ resume_callback (struct lwp_info *lp, void *data) +@@ -1710,6 +1710,7 @@ resume_callback (struct lwp_info *lp, void *data) lp->stopped = 0; lp->step = 0; memset (&lp->siginfo, 0, sizeof (lp->siginfo)); @@ -12348,7 +11673,7 @@ index 1308844..e6fad24 100644 } else if (lp->stopped && debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "RC: Not resuming sibling %s (has pending)\n", -@@ -1766,6 +1767,7 @@ linux_nat_resume (struct target_ops *ops, +@@ -1847,6 +1848,7 @@ linux_nat_resume (struct target_ops *ops, linux_ops->to_resume (linux_ops, ptid, step, signo); memset (&lp->siginfo, 0, sizeof (lp->siginfo)); @@ -12356,7 +11681,7 @@ index 1308844..e6fad24 100644 if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, -@@ -2164,6 +2166,78 @@ maybe_clear_ignore_sigint (struct lwp_info *lp) +@@ -2286,6 +2288,78 @@ maybe_clear_ignore_sigint (struct lwp_info *lp) } } @@ -12435,7 +11760,7 @@ index 1308844..e6fad24 100644 /* Wait until LP is stopped. */ static int -@@ -2215,6 +2289,8 @@ stop_wait_callback (struct lwp_info *lp, void *data) +@@ -2337,6 +2411,8 @@ stop_wait_callback (struct lwp_info *lp, void *data) /* Save the trap's siginfo in case we need it later. */ save_siginfo (lp); @@ -12444,12 +11769,13 @@ index 1308844..e6fad24 100644 /* Now resume this LWP and get the SIGSTOP event. */ errno = 0; ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); -@@ -2579,9 +2655,13 @@ linux_nat_filter_event (int lwpid, int status, int options) +@@ -2701,10 +2777,14 @@ linux_nat_filter_event (int lwpid, int status, int options) add_thread (lp->ptid); } - /* Save the trap's siginfo in case we need it later. */ - if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP) + if (WIFSTOPPED (status) + && (WSTOPSIG (status) == SIGTRAP || WSTOPSIG (status) == TRAP_IS_SYSCALL)) - save_siginfo (lp); + { + /* Save the trap's siginfo in case we need it later. */ @@ -12458,9 +11784,9 @@ index 1308844..e6fad24 100644 + save_sigtrap (lp); + } - /* Handle GNU/Linux's extended waitstatus for trace events. */ - if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0) -@@ -4871,6 +4951,10 @@ linux_nat_add_target (struct target_ops *t) + /* Handle GNU/Linux's extended waitstatus for trace events. + It is necessary to check if WSTOPSIG is signaling that +@@ -4999,6 +5079,10 @@ linux_nat_add_target (struct target_ops *t) t->to_thread_alive = linux_nat_thread_alive; t->to_pid_to_str = linux_nat_pid_to_str; t->to_has_thread_control = tc_schedlock; @@ -12472,7 +11798,7 @@ index 1308844..e6fad24 100644 t->to_can_async_p = linux_nat_can_async_p; t->to_is_async_p = linux_nat_is_async_p; diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h -index d1ed6fc..faf68bb 100644 +index eae74f3..73204fc 100644 --- a/gdb/linux-nat.h +++ b/gdb/linux-nat.h @@ -62,6 +62,12 @@ struct lwp_info @@ -12694,222 +12020,10 @@ index aac82e9..626292c 100644 TYPE_CPLUS_SPECIFIC (t) = (struct cplus_struct_type *) &cplus_struct_default; return t; diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c -index 0cf03d9..93459dd 100644 +index 0baaa83..94ebfeb 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c -@@ -41,7 +41,7 @@ static void varobj_update_one (struct varobj *var, - enum print_values print_values, - int explicit); - --static int mi_print_value_p (struct type *type, enum print_values print_values); -+static int mi_print_value_p (struct varobj *var, enum print_values print_values); - - /* Print variable object VAR. The PRINT_VALUES parameter controls - if the value should be printed. The PRINT_EXPRESSION parameter -@@ -59,8 +59,12 @@ print_varobj (struct varobj *var, enum print_values print_values, - ui_out_field_string (uiout, "exp", varobj_get_expression (var)); - ui_out_field_int (uiout, "numchild", varobj_get_num_children (var)); - -- if (mi_print_value_p (varobj_get_gdb_type (var), print_values)) -- ui_out_field_string (uiout, "value", varobj_get_value (var)); -+ if (mi_print_value_p (var, print_values)) -+ { -+ char *val = varobj_get_value (var); -+ ui_out_field_string (uiout, "value", val); -+ xfree (val); -+ } - - type = varobj_get_type (var); - if (type != NULL) -@@ -75,6 +79,9 @@ print_varobj (struct varobj *var, enum print_values print_values, - - if (varobj_get_frozen (var)) - ui_out_field_int (uiout, "frozen", 1); -+ -+ if (varobj_pretty_printed_p (var)) -+ ui_out_field_int (uiout, "dynamic", 1); - } - - /* VAROBJ operations */ -@@ -138,6 +145,8 @@ mi_cmd_var_create (char *command, char **argv, int argc) - - print_varobj (var, PRINT_ALL_VALUES, 0 /* don't print expression */); - -+ ui_out_field_int (uiout, "has_more", varobj_has_more (var, 0)); -+ - do_cleanups (old_cleanups); - } - -@@ -223,6 +232,7 @@ mi_cmd_var_set_format (char *command, char **argv, int argc) - { - enum varobj_display_formats format; - struct varobj *var; -+ char *val; - - if (argc != 2) - error (_("mi_cmd_var_set_format: Usage: NAME FORMAT.")); -@@ -239,7 +249,9 @@ mi_cmd_var_set_format (char *command, char **argv, int argc) - ui_out_field_string (uiout, "format", varobj_format_string[(int) format]); - - /* Report the value in the new format */ -- ui_out_field_string (uiout, "value", varobj_get_value (var)); -+ val = varobj_get_value (var); -+ ui_out_field_string (uiout, "value", val); -+ xfree (val); - } - - void -@@ -337,11 +349,12 @@ Must be: 0 or \"%s\", 1 or \"%s\", 2 or \"%s\""), - } - - /* Return 1 if given the argument PRINT_VALUES we should display -- a value of type TYPE. */ -+ the varobj VAR. */ - - static int --mi_print_value_p (struct type *type, enum print_values print_values) -+mi_print_value_p (struct varobj *var, enum print_values print_values) - { -+ struct type *type; - - if (print_values == PRINT_NO_VALUES) - return 0; -@@ -349,6 +362,10 @@ mi_print_value_p (struct type *type, enum print_values print_values) - if (print_values == PRINT_ALL_VALUES) - return 1; - -+ if (varobj_pretty_printed_p (var)) -+ return 1; -+ -+ type = varobj_get_gdb_type (var); - if (type == NULL) - return 1; - else -@@ -369,24 +386,35 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) - struct varobj *var; - VEC(varobj_p) *children; - struct varobj *child; -- struct cleanup *cleanup_children; - int numchild; - enum print_values print_values; - int ix; -+ int from, to; - char *display_hint; - -- if (argc != 1 && argc != 2) -- error (_("mi_cmd_var_list_children: Usage: [PRINT_VALUES] NAME")); -+ if (argc < 1 || argc > 4) -+ error (_("mi_cmd_var_list_children: Usage: [PRINT_VALUES] NAME [FROM TO]")); - - /* Get varobj handle, if a valid var obj name was specified */ -- if (argc == 1) -+ if (argc == 1 || argc == 3) - var = varobj_get_handle (argv[0]); - else - var = varobj_get_handle (argv[1]); - -- children = varobj_list_children (var); -- ui_out_field_int (uiout, "numchild", VEC_length (varobj_p, children)); -- if (argc == 2) -+ if (argc > 2) -+ { -+ from = atoi (argv[argc - 2]); -+ to = atoi (argv[argc - 1]); -+ } -+ else -+ { -+ from = -1; -+ to = -1; -+ } -+ -+ children = varobj_list_children (var, &from, &to); -+ ui_out_field_int (uiout, "numchild", to - from); -+ if (argc == 2 || argc == 4) - print_values = mi_parse_values_option (argv[0]); - else - print_values = PRINT_NO_VALUES; -@@ -398,21 +426,28 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) - xfree (display_hint); - } - -- if (VEC_length (varobj_p, children) == 0) -- return; -- -- if (mi_version (uiout) == 1) -- cleanup_children = make_cleanup_ui_out_tuple_begin_end (uiout, "children"); -- else -- cleanup_children = make_cleanup_ui_out_list_begin_end (uiout, "children"); -- for (ix = 0; VEC_iterate (varobj_p, children, ix, child); ++ix) -+ if (from < to) - { -- struct cleanup *cleanup_child; -- cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, "child"); -- print_varobj (child, print_values, 1 /* print expression */); -- do_cleanups (cleanup_child); -+ struct cleanup *cleanup_children; -+ if (mi_version (uiout) == 1) -+ cleanup_children -+ = make_cleanup_ui_out_tuple_begin_end (uiout, "children"); -+ else -+ cleanup_children -+ = make_cleanup_ui_out_list_begin_end (uiout, "children"); -+ for (ix = from; -+ ix < to && VEC_iterate (varobj_p, children, ix, child); -+ ++ix) -+ { -+ struct cleanup *cleanup_child; -+ cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, "child"); -+ print_varobj (child, print_values, 1 /* print expression */); -+ do_cleanups (cleanup_child); -+ } -+ do_cleanups (cleanup_children); - } -- do_cleanups (cleanup_children); -+ -+ ui_out_field_int (uiout, "has_more", varobj_has_more (var, to)); - } - - void -@@ -538,16 +573,24 @@ mi_cmd_var_evaluate_expression (char *command, char **argv, int argc) - var = varobj_get_handle (argv[optind]); - - if (formatFound) -- ui_out_field_string (uiout, "value", varobj_get_formatted_value (var, format)); -+ { -+ char *val = varobj_get_formatted_value (var, format); -+ ui_out_field_string (uiout, "value", val); -+ xfree (val); -+ } - else -- ui_out_field_string (uiout, "value", varobj_get_value (var)); -+ { -+ char *val = varobj_get_value (var); -+ ui_out_field_string (uiout, "value", val); -+ xfree (val); -+ } - } - - void - mi_cmd_var_assign (char *command, char **argv, int argc) - { - struct varobj *var; -- char *expression; -+ char *expression, *val; - - if (argc != 2) - error (_("mi_cmd_var_assign: Usage: NAME EXPRESSION.")); -@@ -563,7 +606,9 @@ mi_cmd_var_assign (char *command, char **argv, int argc) - if (!varobj_set_value (var, expression)) - error (_("mi_cmd_var_assign: Could not assign expression to variable object")); - -- ui_out_field_string (uiout, "value", varobj_get_value (var)); -+ val = varobj_get_value (var); -+ ui_out_field_string (uiout, "value", val); -+ xfree (val); - } - - /* Type used for parameters passing to mi_cmd_var_update_iter. */ -@@ -644,7 +689,6 @@ mi_cmd_var_update (char *command, char **argv, int argc) +@@ -697,7 +697,6 @@ mi_cmd_var_update (char *command, char **argv, int argc) } else { @@ -12917,149 +12031,6 @@ index 0cf03d9..93459dd 100644 struct varobj *var = varobj_get_handle (name); varobj_update_one (var, print_values, 1 /* explicit */); -@@ -670,6 +714,7 @@ varobj_update_one (struct varobj *var, enum print_values print_values, - for (i = 0; VEC_iterate (varobj_update_result, changes, i, r); ++i) - { - char *display_hint; -+ int from, to; - - if (mi_version (uiout) > 1) - cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); -@@ -678,8 +723,12 @@ varobj_update_one (struct varobj *var, enum print_values print_values, - switch (r->status) - { - case VAROBJ_IN_SCOPE: -- if (mi_print_value_p (varobj_get_gdb_type (r->varobj), print_values)) -- ui_out_field_string (uiout, "value", varobj_get_value (r->varobj)); -+ if (mi_print_value_p (r->varobj, print_values)) -+ { -+ char *val = varobj_get_value (r->varobj); -+ ui_out_field_string (uiout, "value", val); -+ xfree (val); -+ } - ui_out_field_string (uiout, "in_scope", "true"); - break; - case VAROBJ_NOT_IN_SCOPE: -@@ -699,11 +748,11 @@ varobj_update_one (struct varobj *var, enum print_values print_values, - } - - if (r->type_changed) -- { -- ui_out_field_string (uiout, "new_type", varobj_get_type (r->varobj)); -- ui_out_field_int (uiout, "new_num_children", -- varobj_get_num_children (r->varobj)); -- } -+ ui_out_field_string (uiout, "new_type", varobj_get_type (r->varobj)); -+ -+ if (r->type_changed || r->children_changed) -+ ui_out_field_int (uiout, "new_num_children", -+ varobj_get_num_children (r->varobj)); - - display_hint = varobj_get_display_hint (var); - if (display_hint) -@@ -712,28 +761,59 @@ varobj_update_one (struct varobj *var, enum print_values print_values, - xfree (display_hint); - } - -- if (r->children_changed) -- { -- int ix; -- struct varobj *child; -- struct cleanup *cleanup = -- make_cleanup_ui_out_list_begin_end (uiout, "children"); -+ if (varobj_pretty_printed_p (var)) -+ ui_out_field_int (uiout, "dynamic", 1); - -- VEC (varobj_p)* children = varobj_list_children (r->varobj); -+ varobj_get_child_range (r->varobj, &from, &to); -+ ui_out_field_int (uiout, "has_more", -+ varobj_has_more (r->varobj, to)); - -- for (ix = 0; VEC_iterate (varobj_p, children, ix, child); ++ix) -+ if (r->new) -+ { -+ int j; -+ varobj_p child; -+ struct cleanup *cleanup; -+ -+ cleanup = make_cleanup_ui_out_list_begin_end (uiout, "new_children"); -+ for (j = 0; VEC_iterate (varobj_p, r->new, j, child); ++j) - { - struct cleanup *cleanup_child; - cleanup_child = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); -- print_varobj (child, print_values, 1 /* print expression */); -+ print_varobj (child, print_values, 1 /* print_expression */); - do_cleanups (cleanup_child); - } - - do_cleanups (cleanup); -+ VEC_free (varobj_p, r->new); -+ r->new = NULL; /* Paranoia. */ - } -- -+ - if (mi_version (uiout) > 1) - do_cleanups (cleanup); - } - VEC_free (varobj_update_result, changes); - } -+ -+void -+mi_cmd_enable_pretty_printing (char *command, char **argv, int argc) -+{ -+ if (argc != 0) -+ error (_("mi_cmd_enable_pretty_printing: no arguments allowed")); -+ varobj_enable_pretty_printing (); -+} -+ -+void -+mi_cmd_var_set_update_range (char *command, char **argv, int argc) -+{ -+ struct varobj *var; -+ int from, to; -+ -+ if (argc != 3) -+ error (_("mi_cmd_var_set_update_range: Usage: VAROBJ FROM TO")); -+ -+ var = varobj_get_handle (argv[0]); -+ from = atoi (argv[1]); -+ to = atoi (argv[2]); -+ -+ varobj_set_child_range (var, from, to); -+} -diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c -index dd3d803..8ba086c 100644 ---- a/gdb/mi/mi-cmds.c -+++ b/gdb/mi/mi-cmds.c -@@ -52,6 +52,7 @@ struct mi_cmd mi_cmds[] = - { "data-write-memory", { NULL, 0 }, mi_cmd_data_write_memory}, - { "data-write-register-values", { NULL, 0 }, mi_cmd_data_write_register_values}, - { "enable-timings", { NULL, 0 }, mi_cmd_enable_timings}, -+ { "enable-pretty-printing", { NULL, 0 }, mi_cmd_enable_pretty_printing}, - { "environment-cd", { NULL, 0 }, mi_cmd_env_cd}, - { "environment-directory", { NULL, 0 }, mi_cmd_env_dir}, - { "environment-path", { NULL, 0 }, mi_cmd_env_path}, -@@ -112,6 +113,7 @@ struct mi_cmd mi_cmds[] = - { "var-list-children", { NULL, 0 }, mi_cmd_var_list_children}, - { "var-set-format", { NULL, 0 }, mi_cmd_var_set_format}, - { "var-set-frozen", { NULL, 0 }, mi_cmd_var_set_frozen}, -+ { "var-set-update-range", { NULL, 0 }, mi_cmd_var_set_update_range }, - { "var-set-visualizer", { NULL, 0 }, mi_cmd_var_set_visualizer}, - { "var-show-attributes", { NULL, 0 }, mi_cmd_var_show_attributes}, - { "var-show-format", { NULL, 0 }, mi_cmd_var_show_format}, -diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h -index 85ad0c4..dfab411 100644 ---- a/gdb/mi/mi-cmds.h -+++ b/gdb/mi/mi-cmds.h -@@ -99,6 +99,8 @@ extern mi_cmd_argv_ftype mi_cmd_var_set_visualizer; - extern mi_cmd_argv_ftype mi_cmd_var_show_attributes; - extern mi_cmd_argv_ftype mi_cmd_var_show_format; - extern mi_cmd_argv_ftype mi_cmd_var_update; -+extern mi_cmd_argv_ftype mi_cmd_enable_pretty_printing; -+extern mi_cmd_argv_ftype mi_cmd_var_set_update_range; - - /* Description of a single command. */ - diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 857a5d5..6181002 100644 --- a/gdb/mi/mi-main.c @@ -13086,18 +12057,10 @@ index a84003f..924c1c5 100644 default_symfile_offsets, /* sym_offsets: dummy FIXME til implem sym reloc */ default_symfile_segments, /* sym_segments: Get segment information from diff --git a/gdb/objfiles.c b/gdb/objfiles.c -index 3fa68f6..10d2bd1 100644 +index 1f7489f..b9a7ed6 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c -@@ -50,7 +50,6 @@ - #include "addrmap.h" - #include "arch-utils.h" - #include "exec.h" --#include "observer.h" - - /* Prototypes for local functions */ - -@@ -458,12 +457,14 @@ free_objfile (struct objfile *objfile) +@@ -459,12 +459,14 @@ free_objfile (struct objfile *objfile) unlink_objfile (objfile); @@ -13114,7 +12077,7 @@ index 3fa68f6..10d2bd1 100644 /* Before the symbol table code was redone to make it easier to selectively load and remove information particular to a specific linkage unit, gdb used to do these things whenever the monolithic -@@ -730,6 +731,20 @@ have_partial_symbols (void) +@@ -731,6 +733,20 @@ have_partial_symbols (void) if (objfile_has_partial_symbols (ofp)) return 1; } @@ -13136,7 +12099,7 @@ index 3fa68f6..10d2bd1 100644 } diff --git a/gdb/objfiles.h b/gdb/objfiles.h -index 6abcb0f..2139590 100644 +index 62fa498..1fc9c6a 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -212,6 +212,11 @@ struct objfile @@ -13167,7 +12130,7 @@ index 6abcb0f..2139590 100644 /* The object file that the main symbol table was loaded from (e.g. the argument to the "symbol-file" or "file" command). */ -@@ -559,6 +573,13 @@ extern void gdb_bfd_unref (struct bfd *abfd); +@@ -568,6 +582,13 @@ extern void gdb_bfd_unref (struct bfd *abfd); ALL_OBJFILES (objfile) \ ALL_OBJFILE_PSYMTABS (objfile, p) @@ -18590,7 +17553,7 @@ index 0000000..830e586 + sal_object_getset /* tp_getset */ +}; diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c -index f23248c..b41d868 100644 +index 590d90a..f512248 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -27,6 +27,8 @@ @@ -18771,9 +17734,9 @@ index f23248c..b41d868 100644 +} + static void - clean_up_objfile_types (struct objfile *objfile, void *datum) + save_objfile_types (struct objfile *objfile, void *datum) { -@@ -543,12 +621,13 @@ clean_up_objfile_types (struct objfile *objfile, void *datum) +@@ -543,12 +621,13 @@ save_objfile_types (struct objfile *objfile, void *datum) { type_object *next = obj->next; @@ -18791,7 +17754,7 @@ index f23248c..b41d868 100644 obj = next; } -@@ -559,41 +638,25 @@ clean_up_objfile_types (struct objfile *objfile, void *datum) +@@ -559,41 +638,25 @@ save_objfile_types (struct objfile *objfile, void *datum) } static void @@ -18960,7 +17923,7 @@ index 49c0437..84a476e 100644 + return 1; +} diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c -index 3d88aa3..b993515 100644 +index 3d88aa3..9fa1c44 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -25,6 +25,7 @@ @@ -18982,7 +17945,27 @@ index 3d88aa3..b993515 100644 #define builtin_type_pybool \ language_bool_type (python_language, python_gdbarch) -@@ -891,7 +896,34 @@ convert_value_from_python (PyObject *obj) +@@ -324,7 +329,18 @@ valpy_getitem (PyObject *self, PyObject *key) + type. */ + struct value *idx = convert_value_from_python (key); + if (idx != NULL) +- res_val = value_subscript (tmp, value_as_long (idx)); ++ { ++ /* Check the value's type is something that can be accessed via ++ a subscript. */ ++ struct type *type; ++ tmp = coerce_ref (tmp); ++ type = check_typedef (value_type (tmp)); ++ if (TYPE_CODE (type) != TYPE_CODE_ARRAY ++ && TYPE_CODE (type) != TYPE_CODE_PTR) ++ error( _("Cannot subscript requested type")); ++ else ++ res_val = value_subscript (tmp, value_as_long (idx)); ++ } + } + } + +@@ -891,7 +907,34 @@ convert_value_from_python (PyObject *obj) { LONGEST l = PyLong_AsLongLong (obj); @@ -19018,7 +18001,7 @@ index 3d88aa3..b993515 100644 value = value_from_longest (builtin_type_pylong, l); } else if (PyFloat_Check (obj)) -@@ -950,6 +982,25 @@ gdbpy_history (PyObject *self, PyObject *args) +@@ -950,6 +993,25 @@ gdbpy_history (PyObject *self, PyObject *args) return value_to_value_object (res_val); } @@ -19044,7 +18027,7 @@ index 3d88aa3..b993515 100644 void gdbpy_initialize_values (void) { -@@ -960,6 +1011,8 @@ gdbpy_initialize_values (void) +@@ -960,6 +1022,8 @@ gdbpy_initialize_values (void) PyModule_AddObject (gdb_module, "Value", (PyObject *) &value_object_type); values_in_python = NULL; @@ -20968,7 +19951,7 @@ index 740d4e0..461ff95 100644 extern struct symtabs_and_lines diff --git a/gdb/target.c b/gdb/target.c -index a662eca..8e6af42 100644 +index e5d14fd..37fab72 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -124,6 +124,8 @@ static int debug_to_insert_watchpoint (CORE_ADDR, int, int); @@ -20988,7 +19971,7 @@ index a662eca..8e6af42 100644 INHERIT (to_stopped_data_address, t); INHERIT (to_have_steppable_watchpoint, t); INHERIT (to_have_continuable_watchpoint, t); -@@ -732,6 +735,9 @@ update_current_target (void) +@@ -733,6 +736,9 @@ update_current_target (void) de_fault (to_remove_watchpoint, (int (*) (CORE_ADDR, int, int)) return_minus_one); @@ -20998,7 +19981,7 @@ index a662eca..8e6af42 100644 de_fault (to_stopped_by_watchpoint, (int (*) (void)) return_zero); -@@ -3168,6 +3174,19 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type) +@@ -3173,6 +3179,19 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type) return retval; } @@ -21018,7 +20001,7 @@ index a662eca..8e6af42 100644 static void debug_to_terminal_init (void) { -@@ -3415,6 +3434,7 @@ setup_target_debug (void) +@@ -3420,6 +3439,7 @@ setup_target_debug (void) current_target.to_remove_hw_breakpoint = debug_to_remove_hw_breakpoint; current_target.to_insert_watchpoint = debug_to_insert_watchpoint; current_target.to_remove_watchpoint = debug_to_remove_watchpoint; @@ -21027,10 +20010,10 @@ index a662eca..8e6af42 100644 current_target.to_stopped_data_address = debug_to_stopped_data_address; current_target.to_watchpoint_addr_within_range = debug_to_watchpoint_addr_within_range; diff --git a/gdb/target.h b/gdb/target.h -index c210fea..065a7ea 100644 +index b1cb852..adff946 100644 --- a/gdb/target.h +++ b/gdb/target.h -@@ -379,6 +379,7 @@ struct target_ops +@@ -395,6 +395,7 @@ struct target_ops int (*to_remove_hw_breakpoint) (struct gdbarch *, struct bp_target_info *); int (*to_remove_watchpoint) (CORE_ADDR, int, int); int (*to_insert_watchpoint) (CORE_ADDR, int, int); @@ -21038,7 +20021,7 @@ index c210fea..065a7ea 100644 int (*to_stopped_by_watchpoint) (void); int to_have_steppable_watchpoint; int to_have_continuable_watchpoint; -@@ -1126,6 +1127,15 @@ extern char *normal_pid_to_str (ptid_t ptid); +@@ -1166,6 +1167,15 @@ extern char *normal_pid_to_str (ptid_t ptid); #define target_remove_watchpoint(addr, len, type) \ (*current_target.to_remove_watchpoint) (addr, len, type) @@ -21054,7 +20037,7 @@ index c210fea..065a7ea 100644 #define target_insert_hw_breakpoint(gdbarch, bp_tgt) \ (*current_target.to_insert_hw_breakpoint) (gdbarch, bp_tgt) -@@ -1163,6 +1173,20 @@ extern int target_search_memory (CORE_ADDR start_addr, +@@ -1203,6 +1213,20 @@ extern int target_search_memory (CORE_ADDR start_addr, ULONGEST pattern_len, CORE_ADDR *found_addrp); @@ -21075,7 +20058,7 @@ index c210fea..065a7ea 100644 /* Command logging facility. */ #define target_log_command(p) \ -@@ -1282,6 +1306,14 @@ extern struct target_ops *find_target_beneath (struct target_ops *); +@@ -1322,6 +1346,14 @@ extern struct target_ops *find_target_beneath (struct target_ops *); extern char *target_get_osdata (const char *type); @@ -26343,711 +25326,6 @@ index 0000000..ffca3ab + } + } +} -diff --git a/gdb/testsuite/gdb.mi/gdb701.exp b/gdb/testsuite/gdb.mi/gdb701.exp -index d4acdc2..244c731 100644 ---- a/gdb/testsuite/gdb.mi/gdb701.exp -+++ b/gdb/testsuite/gdb.mi/gdb701.exp -@@ -54,7 +54,7 @@ mi_gdb_test "-var-list-children fooPtr" \ - - foreach i [list x y z] { - mi_gdb_test "-var-list-children fooPtr.$i" \ -- "(&\".*\"\r\n)*\\^done,numchild=\"0\"" \ -+ "(&\".*\"\r\n)*\\^done,numchild=\"0\",has_more=\"0\"" \ - "list children of fooPtr.$i" - } - -diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp -index 619727d..8d06c0e 100644 ---- a/gdb/testsuite/gdb.mi/mi-break.exp -+++ b/gdb/testsuite/gdb.mi/mi-break.exp -@@ -175,7 +175,7 @@ proc test_error {} { - # containing function call, the internal breakpoint created to handle - # function call would be reported, messing up MI output. - mi_gdb_test "-var-create V * return_1()" \ -- "\\^done,name=\"V\",numchild=\"0\",value=\"1\",type=\"int\"" \ -+ "\\^done,name=\"V\",numchild=\"0\",value=\"1\",type=\"int\",has_more=\"0\"" \ - "create varobj for function call" - - mi_gdb_test "-var-update *" \ -diff --git a/gdb/testsuite/gdb.mi/mi-var-block.exp b/gdb/testsuite/gdb.mi/mi-var-block.exp -index 8806848..93ded26 100644 ---- a/gdb/testsuite/gdb.mi/mi-var-block.exp -+++ b/gdb/testsuite/gdb.mi/mi-var-block.exp -@@ -74,7 +74,7 @@ mi_step_to "do_block_tests" "" "var-cmd.c" \ - # Test: c_variable-3.4 - # Desc: check foo, cb changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"foo\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"cb\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"foo\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"cb\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: cb foo changed" - - # step to "foo = 321;" -diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp -index 1f4bdc6..eb6c456 100644 ---- a/gdb/testsuite/gdb.mi/mi-var-child.exp -+++ b/gdb/testsuite/gdb.mi/mi-var-child.exp -@@ -680,7 +680,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.2 - # Desc: check that integer changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.integer" - - # Step over: -@@ -693,7 +693,7 @@ mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} ".*${srcfi - # Test: c_variable-5.3 - # Desc: check that char_ptr changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.char_ptr" - - # Step over "struct_declarations.int_ptr_ptr = &foo;" -@@ -703,7 +703,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.4 - # Desc: check that int_ptr_ptr and children changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars int_ptr_ptr and children changed" - - # Step over "weird->long_array[0] = 1234;" -@@ -713,7 +713,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.5 - # Desc: check that long_array[0] changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.0 changed" - - # Step over "struct_declarations.long_array[1] = 2345;" -@@ -723,7 +723,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.6 - # Desc: check that long_array[1] changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.1 changed" - - # Step over "weird->long_array[2] = 3456;" -@@ -733,7 +733,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.7 - # Desc: check that long_array[2] changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.2 changed" - - # Step over: -@@ -752,7 +752,7 @@ mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} ".*${srcfi - # Test: c_variable-5.8 - # Desc: check that long_array[3-9] changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.3-9 changed" - - -@@ -763,7 +763,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.9 - # Desc: check that func_ptr changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.func_ptr changed" - - # Step over "struct_declarations.long_array[10] = 3456"; -@@ -771,7 +771,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - [expr $line_dct_nothing + 2] "step \$line_dct_nothing + 2" - - mi_gdb_test "-var-update --no-values *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.10\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.10\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.10 changed, don't print values." - - # Step over "struct_declarations.long_array[11] = 5678"; -@@ -780,7 +780,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - $line_dct_a0_0 "step \$line_dct_a0_0" - - mi_gdb_test "-var-update --all-values *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.11\",value=\"5678\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.11\",value=\"5678\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.11 changed, print values." - - mi_list_varobj_children {struct_declarations.long_array --all-values} { -@@ -1121,7 +1121,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.47 - # Desc: check that psnp->char_ptr (and [0].char_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->char_ptr (and 0.char_ptr) changed" - - # Step over "snp1.char_ptr = &c3;" -@@ -1131,7 +1131,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.48 - # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->next->char_ptr (and 1.char_ptr) changed" - - -@@ -1142,7 +1142,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.49 - # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed" - - -@@ -1153,7 +1153,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.50 - # Desc: check that psnp->long_ptr (and [0].long_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->long_ptr (and 0.long_ptr) changed" - - -@@ -1181,7 +1181,7 @@ mi_step_to do_children_tests {} ".*${srcfile}" \ - # Test: c_variable-5.52 - # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed" - - mi_prepare_inline_tests $srcfile -diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp -index ad2e55c..6efb333 100644 ---- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp -+++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp -@@ -146,7 +146,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" $line_dlt_linteger "step at do_local - # Test: c_variable-2.2 - # Desc: check whether only linteger changed values - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: linteger changed" - - # Step over "lpinteger = &linteger;" -@@ -155,7 +155,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 1] "step - # Test: c_variable-2.3 - # Desc: check whether only lpinteger changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lpinteger changed" - - # Step over "lcharacter = 'a';" -@@ -164,7 +164,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 2] "step - # Test: c_variable-2.4 - # Desc: check whether only lcharacter changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lcharacter changed" - - # Step over "lpcharacter = &lcharacter;" -@@ -173,7 +173,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 3] "step - # Test: c_variable-2.5 - # Desc: check whether only lpcharacter changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lpcharacter changed" - - -@@ -195,7 +195,7 @@ mi_execute_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \ - # Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer, - # lsimple.unsigned_character lsimple.integer lsimple.character changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lplong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lplong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: many changed" - - # Step over: -@@ -212,7 +212,7 @@ mi_execute_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \ - # Test: c_variable-2.7 - # Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"func\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"func\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: func and lpsimple changed" - - # Step over -@@ -234,7 +234,7 @@ mi_execute_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \ - # Note: this test also checks that lpsimple->integer and lsimple.integer have - # changed (they are the same) - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lsimple and others changed" - - -@@ -257,7 +257,7 @@ mi_gdb_test "-var-assign linteger 3333" \ - # change. - set lpchar_update "\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}," - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[($lpchar_update)?\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[($lpchar_update)?\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: linteger changed after assign" - - mi_gdb_test "-var-assign linteger 3333" \ -@@ -277,7 +277,7 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \ - "assign to lpinteger" - - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lpinteger changed after assign" - - mi_gdb_test "-var-update *" \ -@@ -377,7 +377,7 @@ mi_gdb_test "-var-update *" \ - "assign same value to func (update)" - - mi_gdb_test "-var-create array_ptr * array_ptr" \ -- "\\^done,name=\"array_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\"" \ -+ "\\^done,name=\"array_ptr\",numchild=\"1\",value=\"$hex\",type=\"int \\*\",has_more=\"0\"" \ - "create global variable array_ptr" - - mi_gdb_test "-var-assign array_ptr array2" \ -@@ -385,7 +385,7 @@ mi_gdb_test "-var-assign array_ptr array2" \ - "assign array to pointer" - - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"array_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"array_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "assign array to pointer (update)" - - mi_gdb_test "-var-assign array_ptr array2" \ -@@ -439,7 +439,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\ - # Test: c_variable-2.13 - # Desc: change subroutine1 local i - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"i\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: i changed" - - mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \ -@@ -448,7 +448,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\ - # Test: c_variable-2.14 - # Desc: change do_locals_tests local llong - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: llong changed" - - set line_dlt_call_subroutine1 [gdb_get_line_number "subroutine1 (linteger, &llong);"] -@@ -458,7 +458,7 @@ mi_next_to "do_locals_tests" "" "var-cmd.c" \ - # Test: c_variable-2.15 - # Desc: check for out of scope subroutine1 locals - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"l\",in_scope=\"false\"\,type_changed=\"false\"},\{name=\"i\",in_scope=\"false\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"l\",in_scope=\"false\"\,type_changed=\"false\",has_more=\"0\"},\{name=\"i\",in_scope=\"false\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: all now out of scope" - - # Done with locals/globals tests. Erase all variables -@@ -550,14 +550,14 @@ mi_gdb_test "-var-create selected_a @ a" \ - mi_continue_to incr_a - - mi_gdb_test "-var-update selected_a" \ -- "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"char\",new_num_children=\"0\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"char\",new_num_children=\"0\",has_more=\"0\"\}\\\]" \ - "update selected_a in incr_a" - - mi_next "step a line in incr_a" - mi_next "return from incr_a to do_special_tests" - - mi_gdb_test "-var-update selected_a" \ -- "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\",has_more=\"0\"\}\\\]" \ - "update selected_a in do_special_tests" - - mi_gdb_test "-file-exec-and-symbols ${binfile}" "\\^done" \ -@@ -596,7 +596,7 @@ mi_check_varobj_value F 7 "check F inside callee" - # A varobj we fail to read during -var-update should be considered - # out of scope. - mi_gdb_test "-var-create null_ptr * **0" \ -- {\^done,name="null_ptr",numchild="0",value=".*",type="int"} \ -+ {\^done,name="null_ptr",numchild="0",value=".*",type="int",has_more="0"} \ - "create null_ptr" - - # Allow this to succeed, if address zero is readable, although it -@@ -644,7 +644,7 @@ mi_check_varobj_value "L" "{...}" "in-and-out-of-scope: check initial value" - mi_runto main - - mi_gdb_test "-var-update L" \ -- {\^done,changelist=\[{name="L",in_scope="false",type_changed="false"}\]} \ -+ {\^done,changelist=\[{name="L",in_scope="false",type_changed="false",has_more="0"}\]} \ - "in-and-out-of-scope: out of scope now" - - mi_gdb_test "-var-update L" \ -@@ -654,7 +654,7 @@ mi_gdb_test "-var-update L" \ - mi_continue_to do_locals_tests - - mi_gdb_test "-var-update L" \ -- {\^done,changelist=\[{name="L",in_scope="true",type_changed="false"}\]} \ -+ {\^done,changelist=\[{name="L",in_scope="true",type_changed="false",has_more="0"}\]} \ - "in-and-out-of-scope: in scope now" - - mi_gdb_test "-var-update L" \ -diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp -index 4b02e50..faa9172 100644 ---- a/gdb/testsuite/gdb.mi/mi-var-display.exp -+++ b/gdb/testsuite/gdb.mi/mi-var-display.exp -@@ -558,7 +558,7 @@ mi_gdb_test "-var-info-num-children e" \ - # Test: c_variable-7.55 - # Desc: children of e - mi_gdb_test "-var-list-children e" \ -- "\\^done,numchild=\"0\"" \ -+ "\\^done,numchild=\"0\",has_more=\"0\"" \ - "get children of e" - - # Test: c_variable-7.60 -@@ -600,7 +600,7 @@ mi_gdb_test "-var-info-num-children anone" \ - # Test: c_variable-7.75 - # Desc: children of anone - mi_gdb_test "-var-list-children anone" \ -- "\\^done,numchild=\"0\"" \ -+ "\\^done,numchild=\"0\",has_more=\"0\"" \ - "get children of anone" - - -diff --git a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp -index 05d46fa..4b95674 100644 ---- a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp -+++ b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp -@@ -72,7 +72,7 @@ mi_runto main - - # Check local variable is "invalid". - mi_gdb_test "-var-update linteger" \ -- "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \ - "linteger not anymore in scope due to binary changes" - - mi_gdb_test "-var-info-type linteger" \ -@@ -97,7 +97,7 @@ mi_delete_breakpoints - mi_gdb_load ${binfile2} - # Check local variable are "invalid" - mi_gdb_test "-var-update linteger" \ -- "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \ - "linteger not valid anymore due to binary changes" - - mi_gdb_test "-var-info-type linteger" \ -@@ -106,7 +106,7 @@ mi_gdb_test "-var-info-type linteger" \ - - # Check global variable are still correct. - mi_gdb_test "-var-update global_simple" \ -- "\\^done,changelist=\\\[\{name=\"global_simple\",in_scope=\"invalid\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"global_simple\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \ - "global_simple not anymore in scope due to binary changes" - - mi_gdb_test "-var-info-type global_simple" \ -diff --git a/gdb/testsuite/gdb.mi/mi2-var-block.exp b/gdb/testsuite/gdb.mi/mi2-var-block.exp -index 6bcfea3..9b3d08f 100644 ---- a/gdb/testsuite/gdb.mi/mi2-var-block.exp -+++ b/gdb/testsuite/gdb.mi/mi2-var-block.exp -@@ -74,7 +74,7 @@ mi_step_to "do_block_tests" "" "var-cmd.c" \ - # Test: c_variable-3.4 - # Desc: check foo, cb changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"foo\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"cb\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"foo\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"cb\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: cb foo changed" - - # step to "foo = 321;" -diff --git a/gdb/testsuite/gdb.mi/mi2-var-child.exp b/gdb/testsuite/gdb.mi/mi2-var-child.exp -index 161b34f..0f9b4d4 100644 ---- a/gdb/testsuite/gdb.mi/mi2-var-child.exp -+++ b/gdb/testsuite/gdb.mi/mi2-var-child.exp -@@ -1,4 +1,4 @@ --# Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation -+# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2009 Free Software Foundation - - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License as published by -@@ -680,7 +680,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.2 - # Desc: check that integer changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.integer" - - # Step over: -@@ -693,7 +693,7 @@ mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd - # Test: c_variable-5.3 - # Desc: check that char_ptr changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.char_ptr" - - # Step over "struct_declarations.int_ptr_ptr = &foo;" -@@ -703,7 +703,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.4 - # Desc: check that int_ptr_ptr and children changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars int_ptr_ptr and children changed" - - # Step over "weird->long_array[0] = 1234;" -@@ -713,7 +713,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.5 - # Desc: check that long_array[0] changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.0 changed" - - # Step over "struct_declarations.long_array[1] = 2345;" -@@ -723,7 +723,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.6 - # Desc: check that long_array[1] changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.1 changed" - - # Step over "weird->long_array[2] = 3456;" -@@ -733,7 +733,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.7 - # Desc: check that long_array[2] changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.2 changed" - - # Step over: -@@ -752,7 +752,7 @@ mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd - # Test: c_variable-5.8 - # Desc: check that long_array[3-9] changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.long_array.3-9 changed" - - -@@ -764,7 +764,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.9 - # Desc: check that func_ptr changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars struct_declarations.func_ptr changed" - - # Delete all variables -@@ -1075,7 +1075,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.47 - # Desc: check that psnp->char_ptr (and [0].char_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->char_ptr (and 0.char_ptr) changed" - - # Step over "snp1.char_ptr = &c3;" -@@ -1085,7 +1085,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.48 - # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->next->char_ptr (and 1.char_ptr) changed" - - -@@ -1096,7 +1096,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.49 - # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed" - - -@@ -1107,7 +1107,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.50 - # Desc: check that psnp->long_ptr (and [0].long_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->long_ptr (and 0.long_ptr) changed" - - -@@ -1120,7 +1120,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Why does this have a FIXME? - setup_xfail *-*-* - mi_gdb_test "-var-update *" \ -- "FIXME\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "FIXME\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->next->long_ptr (and 1.long_ptr) changed" - clear_xfail *-*-* - -@@ -1135,7 +1135,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} \ - # Test: c_variable-5.52 - # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed" - - -diff --git a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp -index dda77bb..0e91634 100644 ---- a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp -+++ b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp -@@ -151,7 +151,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" $line_dlt_linteger "step at do_local - # Test: c_variable-2.2 - # Desc: check whether only linteger changed values - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: linteger changed" - - # Step over "lpinteger = &linteger;" -@@ -160,7 +160,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 1] "step - # Test: c_variable-2.3 - # Desc: check whether only lpinteger changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lpinteger changed" - - # Step over "lcharacter = 'a';" -@@ -169,7 +169,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 2] "step - # Test: c_variable-2.4 - # Desc: check whether only lcharacter changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lcharacter changed" - - # Step over "lpcharacter = &lcharacter;" -@@ -178,7 +178,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" [expr $line_dlt_linteger + 3] "step - # Test: c_variable-2.5 - # Desc: check whether only lpcharacter changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lpcharacter changed" - - -@@ -200,7 +200,7 @@ mi_execute_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \ - # Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer, - # lsimple.unsigned_character lsimple.integer lsimple.character changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lplong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lplong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: many changed" - - # Step over: -@@ -217,7 +217,7 @@ mi_execute_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \ - # Test: c_variable-2.7 - # Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"func\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"func\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: func and lpsimple changed" - - # Step over -@@ -239,7 +239,7 @@ mi_execute_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \ - # Note: this test also checks that lpsimple->integer and lsimple.integer have - # changed (they are the same) - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\},\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lsimple and others changed" - - -@@ -262,7 +262,7 @@ mi_gdb_test "-var-assign linteger 3333" \ - # change. - set lpchar_update "\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}," - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[($lpchar_update)?\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[($lpchar_update)?\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: linteger changed after assign" - - mi_gdb_test "-var-assign linteger 3333" \ -@@ -282,7 +282,7 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \ - "assign to lpinteger" - - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: lpinteger changed after assign" - - mi_gdb_test "-var-update *" \ -@@ -407,7 +407,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\ - # Test: c_variable-2.13 - # Desc: change subroutine1 local i - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"i\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: i changed" - - mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \ -@@ -416,7 +416,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\ - # Test: c_variable-2.14 - # Desc: change do_locals_tests local llong - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"llong\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: llong changed" - - set line_dlt_call_subroutine1 [gdb_get_line_number "subroutine1 (linteger, &llong);"] -@@ -426,7 +426,7 @@ mi_next_to "do_locals_tests" "" "var-cmd.c" \ - # Test: c_variable-2.15 - # Desc: check for out of scope subroutine1 locals - mi_gdb_test "-var-update *" \ -- "\\^done,changelist=\\\[\{name=\"l\",in_scope=\"false\"\,type_changed=\"false\"},\{name=\"i\",in_scope=\"false\",type_changed=\"false\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"l\",in_scope=\"false\"\,type_changed=\"false\",has_more=\"0\"},\{name=\"i\",in_scope=\"false\",type_changed=\"false\",has_more=\"0\"\}\\\]" \ - "update all vars: all now out of scope" - - # Done with locals/globals tests. Erase all variables -@@ -518,14 +518,14 @@ mi_gdb_test "-var-create selected_a @ a" \ - mi_continue_to incr_a - - mi_gdb_test "-var-update selected_a" \ -- "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"char\",new_num_children=\"0\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"char\",new_num_children=\"0\"\,has_more=\"0\"}\\\]" \ - "update selected_a in incr_a" - - mi_next "step a line in incr_a" - mi_next "return from incr_a to do_special_tests" - - mi_gdb_test "-var-update selected_a" \ -- "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\"\}\\\]" \ -+ "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",type_changed=\"true\",new_type=\"int\",new_num_children=\"0\",has_more=\"0\"\}\\\]" \ - "update selected_a in do_special_tests" - - mi_gdb_test "-file-exec-and-symbols ${binfile}" "\\^done" \ -diff --git a/gdb/testsuite/gdb.mi/mi2-var-display.exp b/gdb/testsuite/gdb.mi/mi2-var-display.exp -index d6ce673..17e208a 100644 ---- a/gdb/testsuite/gdb.mi/mi2-var-display.exp -+++ b/gdb/testsuite/gdb.mi/mi2-var-display.exp -@@ -557,7 +557,7 @@ mi_gdb_test "-var-info-num-children e" \ - # Test: c_variable-7.55 - # Desc: children of e - mi_gdb_test "-var-list-children e" \ -- "\\^done,numchild=\"0\"" \ -+ "\\^done,numchild=\"0\",has_more=\"0\"" \ - "get children of e" - - # Test: c_variable-7.60 -@@ -599,7 +599,7 @@ mi_gdb_test "-var-info-num-children anone" \ - # Test: c_variable-7.75 - # Desc: children of anone - mi_gdb_test "-var-list-children anone" \ -- "\\^done,numchild=\"0\"" \ -+ "\\^done,numchild=\"0\",has_more=\"0\"" \ - "get children of anone" - - diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c new file mode 100644 index 0000000..729f457 @@ -27754,283 +26032,11 @@ index 0000000..e9d18b7 +gdb_py_test_silent_cmd "python t0 = gdb.selected_thread ()" "test gdb.selected_thread" 1 +gdb_test "python print t0" "\\" "verify InferiorThread object" +gdb_test "python print 'result =', t0.num" " = \[0-9\]+" "test Inferior.num" -diff --git a/gdb/testsuite/gdb.python/py-mi.exp b/gdb/testsuite/gdb.python/py-mi.exp -index d3f44b2..afde8c4 100644 ---- a/gdb/testsuite/gdb.python/py-mi.exp -+++ b/gdb/testsuite/gdb.python/py-mi.exp -@@ -48,23 +48,53 @@ mi_gdb_test "python execfile ('${srcdir}/${subdir}/${testfile}.py')" "" - mi_continue_to_line [gdb_get_line_number {MI breakpoint here} ${testfile}.c] \ - "step to breakpoint" - --mi_create_floating_varobj container c "create container varobj" -+mi_create_dynamic_varobj container c \ -+ "create container varobj, no pretty-printing" -+ -+mi_list_varobj_children container { -+ { container.name name 1 string } -+ { container.len len 0 int } -+ { container.elements elements 1 "int ." } -+} "examine container children=0, no pretty-printing" -+ -+mi_delete_varobj container "delete varobj" -+ -+mi_gdb_test "-enable-pretty-printing" "" -+ -+mi_create_varobj_checked string string_1 \ -+ "struct string_repr" \ -+ "create string_1 varobj" -+ -+mi_gdb_test "-data-evaluate-expression \"string_1 = string_2\"" ".*" \ -+ "assign string_1 from string_2" -+ -+mi_gdb_test "-var-update string" \ -+ "\\^done,changelist=\\\[{name=\"string\",in_scope=\"true\",type_changed=\"false\",dynamic=\"1\",has_more=\"0\"}\\\]" \ -+ "update string varobj after assignment" -+ -+mi_create_dynamic_varobj container c \ -+ "create container varobj" - - mi_list_varobj_children container { - } "examine container children=0" - - mi_next "next over update 1" - --mi_varobj_update_dynamic container { -- { {container.\[0\]} {\[0\]} 0 int } --} "varobj update 1" -+mi_varobj_update_dynamic container "varobj update 1" { -+ type_changed false new_num_children 1 dynamic 1 has_more 0 -+} { -+} { -+ { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 } -+} - - mi_next "next over update 2" - --mi_varobj_update_dynamic container { -- { {container.\[0\]} {\[0\]} 0 int } -- { {container.\[1\]} {\[1\]} 0 int } --} "varobj update 2" -+mi_varobj_update_dynamic container "varobj update 2" { -+ type_changed false new_num_children 2 dynamic 1 has_more 0 -+} { -+} { -+ { name {container.\[1\]} exp {\[1\]} numchild 0 type int thread-id 1 } -+} - - mi_gdb_test "-var-set-visualizer container None" \ - "\\^done" \ -@@ -78,19 +108,111 @@ mi_gdb_test "-var-set-visualizer container gdb.default_visualizer" \ - "\\^done" \ - "choose default visualizer" - --mi_varobj_update_dynamic container { -- { {container.\[0\]} {\[0\]} 0 int } -- { {container.\[1\]} {\[1\]} 0 int } --} "varobj update after choosing default" -+mi_varobj_update_dynamic container "varobj update after choosing default" { -+ type_changed false new_num_children 2 dynamic 1 has_more 0 -+} { -+} { -+ { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 } -+ { name {container.\[1\]} exp {\[1\]} numchild 0 type int thread-id 1 } -+} - - mi_gdb_test "-var-set-visualizer container ContainerPrinter" \ - "\\^done" \ - "choose visualizer using expression" - --mi_varobj_update_dynamic container { -+mi_varobj_update_dynamic container \ -+ "varobj update after choosing via expression" { -+ type_changed false new_num_children 2 dynamic 1 has_more 0 -+ } { -+ } { -+ { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 } -+ { name {container.\[1\]} exp {\[1\]} numchild 0 type int thread-id 1 } -+ } -+ -+mi_list_varobj_children_range container 1 2 2 { -+ { {container.\[1\]} {\[1\]} 0 int } -+} "list varobj children after selecting child range" -+ -+mi_list_varobj_children_range container -1 -1 2 { -+ { {container.\[0\]} {\[0\]} 0 int } -+ { {container.\[1\]} {\[1\]} 0 int } -+} "list varobj children after resetting child range" -+ -+mi_next "next over update 3" -+ -+mi_gdb_test "-var-set-update-range container 0 1" \ -+ "\\^done" \ -+ "set update range" -+ -+# This should truncate the list. -+mi_list_varobj_children container { - { {container.\[0\]} {\[0\]} 0 int } -+} "list children after setting update range" -+ -+# This should return just the items in [1,2). -+mi_list_varobj_children_range container 1 2 2 { - { {container.\[1\]} {\[1\]} 0 int } --} "varobj update after choosing via expression" -+} "list selected children after setting range" -+ -+# This should not be affected by the previous list-children request. -+mi_list_varobj_children container { -+ { {container.\[0\]} {\[0\]} 0 int } -+} "list children after listing selected range" -+ -+mi_next "next over update 4" -+ -+ -+# Regression test: examine an object that has no children, then update -+# it to ensure that we don't print the children. -+mi_create_dynamic_varobj container2 c2 \ -+ "create second container varobj" -+ -+mi_gdb_test "-var-update container2" \ -+ "\\^done,changelist=.." \ -+ "update varobj, no children requested" -+ -+mi_next "next over update 5" -+ -+# Now container2 has an element -- and an update should mention that -+# it has_more. But, because we did not request children, we still -+# should not actually see them. -+mi_varobj_update_dynamic container2 \ -+ "update varobj 2, no children requested" { -+ type_changed false dynamic 1 has_more 1 -+ } {} {} -+ -+# This should only show the first child, because the update range has -+# been set. -+mi_varobj_update_dynamic container \ -+ "update after next with restricted range" { -+ type_changed false new_num_children 1 dynamic 1 has_more 1 -+ } { -+ { name {container.\[0\]} in_scope true type_changed false dynamic 1 has_more 0 } -+ } { -+ } -+ -+mi_continue_to_line \ -+ [gdb_get_line_number {MI outer breakpoint here} ${testfile}.c] \ -+ "step to outer breakpoint" -+ -+mi_create_dynamic_varobj outer outer \ -+ "create outer varobj" -+ -+mi_list_varobj_children outer { -+ { outer.s s 2 "struct substruct" } -+ { outer.x x 0 "int" } -+} "list children of outer" -+ -+mi_list_varobj_children outer.s { -+ { outer.s.a a 0 int } -+ { outer.s.b b 0 int } -+} "list children of outer.s" -+ -+mi_next "next over outer update" -+ -+mi_gdb_test "-var-update outer" \ -+ ".done,changelist=.{name=\"outer.s.a\",in_scope=\"true\",type_changed=\"false\",dynamic=\"1\",has_more=\"0\"}." \ -+ "update after updating element of outer" - - mi_continue_to_line \ - [gdb_get_line_number {Another MI breakpoint} ${testfile}.c] \ -diff --git a/gdb/testsuite/gdb.python/py-prettyprint.c b/gdb/testsuite/gdb.python/py-prettyprint.c -index 3cafc48..bf41ebc 100644 ---- a/gdb/testsuite/gdb.python/py-prettyprint.c -+++ b/gdb/testsuite/gdb.python/py-prettyprint.c -@@ -15,6 +15,8 @@ - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#include -+ - struct s - { - int a; -@@ -80,6 +82,29 @@ class Derived : public Vbase1, public Vbase2, public Vbase3 - - #endif - -+struct substruct { -+ int a; -+ int b; -+}; -+ -+struct outerstruct { -+ struct substruct s; -+ int x; -+}; -+ -+struct outerstruct -+substruct_test (void) -+{ -+ struct outerstruct outer; -+ outer.s.a = 0; -+ outer.s.b = 0; -+ outer.x = 0; -+ -+ outer.s.a = 3; /* MI outer breakpoint here */ -+ -+ return outer; -+} -+ - typedef struct string_repr - { - struct whybother -@@ -148,6 +173,14 @@ void do_nothing(void) - c = 23; /* Another MI breakpoint */ - } - -+struct nullstr -+{ -+ char *s; -+}; -+ -+struct string_repr string_1 = { { "one" } }; -+struct string_repr string_2 = { { "two" } }; -+ - int - main () - { -@@ -155,11 +188,15 @@ main () - struct ss ssa[2]; - string x = make_string ("this is x"); - zzz_type c = make_container ("container"); -+ zzz_type c2 = make_container ("container2"); - const struct string_repr cstring = { { "const string" } }; -+ /* Clearing by being `static' could invoke an other GDB C++ bug. */ -+ struct nullstr nullstr; - - init_ss(&ss, 1, 2); - init_ss(ssa+0, 3, 4); - init_ss(ssa+1, 5, 6); -+ memset (&nullstr, 0, sizeof nullstr); - - struct ns ns; - ns.null_str = "embedded\0null\0string"; -@@ -193,6 +230,13 @@ main () - add_item (&c, 72); - - #ifdef MI -+ add_item (&c, 1011); -+ c.elements[0] = 1023; -+ -+ add_item (&c2, 2222); -+ add_item (&c2, 3333); -+ -+ substruct_test (); - do_nothing (); - #endif - diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp -index d2db5bc..287a5d3 100644 +index d2db5bc..4de1620 100644 --- a/gdb/testsuite/gdb.python/py-prettyprint.exp +++ b/gdb/testsuite/gdb.python/py-prettyprint.exp -@@ -27,12 +27,9 @@ set binfile ${objdir}/${subdir}/${testfile} +@@ -27,12 +27,20 @@ set binfile ${objdir}/${subdir}/${testfile} # Start with a fresh gdb. gdb_exit gdb_start @@ -28043,10 +26049,33 @@ index d2db5bc..287a5d3 100644 +if ![python_supported] then { + unsupported "python support is disabled" + return -1 ++} ++ ++# Run a command in GDB, and report a failure if a Python exception is thrown. ++# If report_pass is true, report a pass if no exception is thrown. ++proc gdb_py_test_silent_cmd {cmd name report_pass} { ++ global gdb_prompt ++ ++ gdb_test_multiple $cmd $name { ++ -re "Traceback.*$gdb_prompt $" { fail $name } ++ -re "$gdb_prompt $" { if $report_pass { pass $name } } ++ } } proc run_lang_tests {lang} { -@@ -86,6 +83,8 @@ proc run_lang_tests {lang} { +@@ -79,6 +87,11 @@ proc run_lang_tests {lang} { + gdb_test "print derived" \ + " = \{.* = pp class name: Vbase1.* = \{.* = pp value variable is: 1,.*members of Vbase2:.*_vptr.Vbase2 = $hex.* = \{.*members of Vbase3.*members of Derived:.*value = 2.*" + gdb_test "print ns " "\"embedded\\\\000null\\\\000string\"" ++ gdb_py_test_silent_cmd "set print elements 3" "" 1 ++ gdb_test "print ns" "emb\.\.\.." ++ gdb_py_test_silent_cmd "set print elements 10" "" 1 ++ gdb_test "print ns" "embedded\\\\000n\.\.\.." ++ gdb_py_test_silent_cmd "set print elements 200" "" 1 + } + + gdb_test "print x" " = $hex \"this is x\"" +@@ -86,6 +99,8 @@ proc run_lang_tests {lang} { gdb_test "print c" " = container $hex \"container\" with 2 elements = {$nl *.0. = 23,$nl *.1. = 72$nl}" @@ -28055,71 +26084,6 @@ index d2db5bc..287a5d3 100644 gdb_test "continue" "Program exited normally\." } -diff --git a/gdb/testsuite/gdb.python/py-prettyprint.py b/gdb/testsuite/gdb.python/py-prettyprint.py -index bf009a1..2f070d8 100644 ---- a/gdb/testsuite/gdb.python/py-prettyprint.py -+++ b/gdb/testsuite/gdb.python/py-prettyprint.py -@@ -92,6 +92,13 @@ class pp_vbase1: - def to_string (self): - return "pp class name: " + self.val.type.tag - -+class pp_nullstr: -+ def __init__(self, val): -+ self.val = val -+ -+ def to_string(self): -+ return self.val['s'].string(gdb.parameter('target-charset')) -+ - class pp_ns: - "Print a std::basic_string of some kind" - -@@ -105,11 +112,24 @@ class pp_ns: - def display_hint (self): - return 'string' - -+class pp_outer: -+ "Print struct outer" -+ -+ def __init__ (self, val): -+ self.val = val -+ -+ def to_string (self): -+ return "x = %s" % self.val['x'] -+ -+ def children (self): -+ yield 's', self.val['s'] -+ yield 'x', self.val['x'] -+ - def lookup_function (val): - "Look-up and return a pretty-printer that can print val." - - # Get the type. -- type = val.type; -+ type = val.type - - # If it points to a reference, get the reference. - if type.code == gdb.TYPE_CODE_REF: -@@ -148,6 +168,9 @@ def register_pretty_printers (): - - pretty_printers_dict[re.compile ('^VirtualTest$')] = pp_multiple_virtual - pretty_printers_dict[re.compile ('^Vbase1$')] = pp_vbase1 -+ -+ pretty_printers_dict[re.compile ('^struct nullstr$')] = pp_nullstr -+ pretty_printers_dict[re.compile ('^nullstr$')] = pp_nullstr - - # Note that we purposely omit the typedef names here. - # Printer lookup is based on canonical name. -@@ -160,6 +183,10 @@ def register_pretty_printers (): - - pretty_printers_dict[re.compile ('^struct ns$')] = pp_ns - pretty_printers_dict[re.compile ('^ns$')] = pp_ns -+ -+ pretty_printers_dict[re.compile ('^struct outerstruct$')] = pp_outer -+ pretty_printers_dict[re.compile ('^outerstruct$')] = pp_outer -+ - pretty_printers_dict = {} - - register_pretty_printers () diff --git a/gdb/testsuite/gdb.python/py-template.exp b/gdb/testsuite/gdb.python/py-template.exp index cea6ae0..c9a63d4 100644 --- a/gdb/testsuite/gdb.python/py-template.exp @@ -28163,11 +26127,48 @@ index cea6ae0..c9a63d4 100644 proc test_template_arg {type} { global testfile srcdir subdir srcfile binfile if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ +diff --git a/gdb/testsuite/gdb.python/py-value.c b/gdb/testsuite/gdb.python/py-value.c +index f3d6284..023d830 100644 +--- a/gdb/testsuite/gdb.python/py-value.c ++++ b/gdb/testsuite/gdb.python/py-value.c +@@ -37,6 +37,13 @@ typedef struct s *PTR; + + enum e evalue = TWO; + ++#ifdef __cplusplus ++void ptr_ref(int*& rptr_int) ++{ ++ return; /* break to inspect pointer by reference. */ ++} ++#endif ++ + int + main (int argc, char *argv[]) + { +@@ -46,10 +53,18 @@ main (int argc, char *argv[]) + PTR x = &s; + char st[17] = "divide et impera"; + char nullst[17] = "divide\0et\0impera"; ++ int a[3] = {1,2,3}; ++ int *p = a; ++ int i = 2; ++ int *ptr_i = &i; + + s.a = 3; + s.b = 5; + u.a = 7; + ++#ifdef __cplusplus ++ ptr_ref(ptr_i); ++#endif ++ + return 0; /* break to inspect struct and union */ + } diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp -index 9b4190d..93cddc7 100644 +index 9b4190d..b9f2c3c 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp -@@ -292,21 +292,37 @@ proc test_value_after_death {} { +@@ -292,21 +292,106 @@ proc test_value_after_death {} { "print value's type" } @@ -28179,6 +26180,75 @@ index 9b4190d..93cddc7 100644 + gdb_test "python v = v.cast(v.type)" "" "cast value for cast test" + gdb_test "python print v" "5" "print value for cast test" +} ++ ++# Regression test for invalid subscript operations. The bug was that ++# the type of the value was not being checked before allowing a ++# subscript operation to proceed. ++ ++proc test_subscript_regression {lang} { ++ ++ global srcdir subdir srcfile binfile testfile hex ++ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug $lang"] != "" } { ++ untested "Couldn't compile ${srcfile} in $lang mode" ++ return -1 ++ } ++ ++ # Start with a fresh gdb. ++ gdb_exit ++ gdb_start ++ gdb_reinitialize_dir $srcdir/$subdir ++ gdb_load ${binfile} ++ ++ if ![runto_main ] then { ++ perror "couldn't run to breakpoint" ++ return ++ } ++ ++ if {$lang == "c++"} { ++ gdb_breakpoint [gdb_get_line_number "break to inspect pointer by reference"] ++ gdb_continue_to_breakpoint "break to inspect pointer by reference" ++ ++ gdb_py_test_silent_cmd "print rptr_int" \ ++ "Obtain address" 1 ++ gdb_py_test_silent_cmd "python rptr = gdb.history(0)" \ ++ "Obtains value from GDB" 1 ++ gdb_test "python print rptr\[0\]" "2" "Check pointer passed as reference" ++ } ++ ++ gdb_breakpoint [gdb_get_line_number "break to inspect struct and union"] ++ gdb_continue_to_breakpoint "break to inspect struct and union" ++ ++ gdb_py_test_silent_cmd "python intv = gdb.Value(1)" \ ++ "Create a value for subscript test" 1 ++ gdb_py_test_silent_cmd "python stringv = gdb.Value(\"foo\")" \ ++ "Create a value for subscript test" 1 ++ ++ # Try to access an int with a subscript. This should fail. ++ gdb_test "python print intv" "1" "Baseline print of a Python value" ++ gdb_test "python print intv\[0\]" "RuntimeError: Cannot subscript requested type.*" \ ++ "Attempt to access an integer with a subscript" ++ ++ # Try to access a string with a subscript. This should pass. ++ gdb_test "python print stringv" "foo." "Baseline print of a Python value" ++ gdb_test "python print stringv\[0\]" "f." "Attempt to access a string with a subscript" ++ ++ # Try to access an int array via a pointer with a subscript. This should pass. ++ gdb_py_test_silent_cmd "print p" "Build pointer to array" 1 ++ gdb_py_test_silent_cmd "python pointer = gdb.history(0)" "" 1 ++ gdb_test "python print pointer\[0\]" "1" "Access array via pointer with int subscript" ++ gdb_test "python print pointer\[intv\]" "2" "Access array via pointer with value subscript" ++ ++ # Try to access a single dimension array with a subscript to the ++ # result. This should fail. ++ gdb_test "python print pointer\[intv\]\[0\]" "RuntimeError: Cannot subscript requested type.*" \ ++ "Attempt to access an integer with a subscript" ++ ++ # Lastly, test subscript access to an array with multiple ++ # dimensions. This should pass. ++ gdb_py_test_silent_cmd "print {\"fu \",\"foo\",\"bar\"}" "Build array" 1 ++ gdb_py_test_silent_cmd "python marray = gdb.history(0)" "" 1 ++ gdb_test "python print marray\[1\]\[2\]" "o." "Test multiple subscript" ++} + # Start with a fresh gdb. @@ -28196,8 +26266,8 @@ index 9b4190d..93cddc7 100644 +if ![python_supported] then { + unsupported "python support is disabled" + return -1 - } - ++} ++ +set testfile "py-value" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} @@ -28205,18 +26275,24 @@ index 9b4190d..93cddc7 100644 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + untested "Couldn't compile ${srcfile}" + return -1 -+} -+ + } + +gdb_load ${binfile} + test_value_creation test_value_numeric_ops test_value_boolean -@@ -322,3 +338,4 @@ if ![runto_main] then { +@@ -322,3 +407,10 @@ if ![runto_main] then { test_value_in_inferior test_value_after_death +test_cast_regression ++ ++# The following test recompiles the binary to test either C or C++ ++# values. ++ ++test_subscript_regression "c++" ++test_subscript_regression "c" diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index 5223fc8..03e1eab 100644 --- a/gdb/testsuite/gdb.python/python.exp @@ -29310,169 +27386,6 @@ index 0c93a73..d0c3493 100644 global GDB -diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp -index e691232..167a02c 100644 ---- a/gdb/testsuite/lib/mi-support.exp -+++ b/gdb/testsuite/lib/mi-support.exp -@@ -1195,13 +1195,13 @@ proc mi_list_breakpoints { expected test } { - # Name cannot be "-". - proc mi_create_varobj { name expression testname } { - mi_gdb_test "-var-create $name * $expression" \ -- "\\^done,name=\"$name\",numchild=\"\[0-9\]+\",value=\".*\",type=.*" \ -+ "\\^done,name=\"$name\",numchild=\"\[0-9\]+\",value=\".*\",type=.*,has_more=\"0\"" \ - $testname - } - - proc mi_create_floating_varobj { name expression testname } { - mi_gdb_test "-var-create $name @ $expression" \ -- "\\^done,name=\"$name\",numchild=\"\[0-9\]+\",value=\".*\",type=.*" \ -+ "\\^done,name=\"$name\",numchild=\"\(-1\|\[0-9\]+\)\",value=\".*\",type=.*" \ - $testname - } - -@@ -1214,6 +1214,14 @@ proc mi_create_varobj_checked { name expression type testname } { - $testname - } - -+# Same as mi_create_floating_varobj, but assumes the test is creating -+# a dynamic varobj that has children, so the value must be "{...}". -+proc mi_create_dynamic_varobj {name expression testname} { -+ mi_gdb_test "-var-create $name @ $expression" \ -+ "\\^done,name=\"$name\",numchild=\"\(-1\|\[0-9\]+\)\",value=\"{\\.\\.\\.}\",type=.*" \ -+ $testname -+} -+ - # Deletes the specified NAME. - proc mi_delete_varobj { name testname } { - mi_gdb_test "-var-delete $name" \ -@@ -1229,7 +1237,7 @@ proc mi_varobj_update { name expected testname } { - set er "\\^done,changelist=\\\[" - set first 1 - foreach item $expected { -- set v "{name=\"$item\",in_scope=\"true\",type_changed=\"false\"}" -+ set v "{name=\"$item\",in_scope=\"true\",type_changed=\"false\",has_more=\".\"}" - if {$first == 1} { - set er "$er$v" - set first 0 -@@ -1244,22 +1252,70 @@ proc mi_varobj_update { name expected testname } { - } - - proc mi_varobj_update_with_type_change { name new_type new_children testname } { -- set v "{name=\"$name\",in_scope=\"true\",type_changed=\"true\",new_type=\"$new_type\",new_num_children=\"$new_children\"}" -+ set v "{name=\"$name\",in_scope=\"true\",type_changed=\"true\",new_type=\"$new_type\",new_num_children=\"$new_children\",has_more=\".\"}" - set er "\\^done,changelist=\\\[$v\\\]" - verbose -log "Expecting: $er" - mi_gdb_test "-var-update $name" $er $testname - } - --# Update a dynamic varobj named NAME. CHILDREN is a list of children, --# in the same form as mi_list_varobj_children. TESTNAME is the name --# of the test. --proc mi_varobj_update_dynamic {name children testname} { -- set children_exp_j [mi_child_regexp $children 0] -+# A helper that turns a key/value list into a regular expression -+# matching some MI output. -+proc mi_varobj_update_kv_helper {list} { -+ set first 1 -+ set rx "" -+ foreach {key value} $list { -+ if {!$first} { -+ append rx , -+ } -+ set first 0 -+ if {$key == "new_children"} { -+ append rx "$key=\\\[$value\\\]" -+ } else { -+ append rx "$key=\"$value\"" -+ } -+ } -+ return $rx -+} - -- set er "\\^done,changelist=\\\[" -+# A helper for mi_varobj_update_dynamic that computes a match -+# expression given a child list. -+proc mi_varobj_update_dynamic_helper {children} { -+ set crx "" - -- append er "{name=\"$name\",in_scope=\"true\",type_changed=\"false\"" -- append er ",children=\\\[$children_exp_j.*\\\]}\\\]" -+ set first 1 -+ foreach child $children { -+ if {!$first} { -+ append crx , -+ } -+ set first 0 -+ append crx "{" -+ append crx [mi_varobj_update_kv_helper $child] -+ append crx "}" -+ } -+ -+ return $crx -+} -+ -+# Update a dynamic varobj named NAME. CHILDREN is a list of children -+# that have been updated; NEW_CHILDREN is a list of children that were -+# added to the primary varobj. Each child is a list of key/value -+# pairs that are expected. SELF is a key/value list holding -+# information about the varobj itself. TESTNAME is the name of the -+# test. -+proc mi_varobj_update_dynamic {name testname self children new_children} { -+ if {[llength $new_children]} { -+ set newrx [mi_varobj_update_dynamic_helper $new_children] -+ lappend self new_children $newrx -+ } -+ set selfrx [mi_varobj_update_kv_helper $self] -+ set crx [mi_varobj_update_dynamic_helper $children] -+ -+ set er "\\^done,changelist=\\\[\{name=\"$name\",in_scope=\"true\"" -+ append er ",$selfrx\}" -+ if {"$crx" != ""} { -+ append er ",$crx" -+ } -+ append er "\\\]" - - verbose -log "Expecting: $er" - mi_gdb_test "-var-update $name" $er $testname -@@ -1329,14 +1385,13 @@ proc mi_child_regexp {children add_child} { - # have no value. - # - proc mi_list_varobj_children { varname children testname } { -- mi_list_varobj_children_range $varname [llength $children] $children \ -+ mi_list_varobj_children_range $varname "" "" [llength $children] $children \ - $testname - } - --# Like mi_list_varobj_children, but assumes that a subrange has been --# selected with -var-set-child-range. NUMCHILDREN is the total number --# of children. --proc mi_list_varobj_children_range {varname numchildren children testname} { -+# Like mi_list_varobj_children, but sets a subrange. NUMCHILDREN is -+# the total number of children. -+proc mi_list_varobj_children_range {varname from to numchildren children testname} { - set options "" - if {[llength $varname] == 2} { - set options [lindex $varname 1] -@@ -1352,9 +1407,18 @@ proc mi_list_varobj_children_range {varname numchildren children testname} { - set expected "\\^done,numchild=\"0\"" - } - -+ if {"$to" == ""} { -+ append expected ",has_more=\"0\"" -+ } elseif {$to >= 0 && $numchildren > $to} { -+ append expected ",has_more=\"1\"" -+ } else { -+ append expected ",has_more=\"0\"" -+ } -+ - verbose -log "Expecting: $expected" - -- mi_gdb_test "-var-list-children $options $varname" $expected $testname -+ mi_gdb_test "-var-list-children $options $varname $from $to" \ -+ $expected $testname - } - - # Verifies that variable object VARNAME has NUMBER children, diff --git a/gdb/testsuite/lib/python-support.exp b/gdb/testsuite/lib/python-support.exp new file mode 100644 index 0000000..b8e9836 @@ -29533,7 +27446,7 @@ index 0000000..b8e9836 + return 0 +} diff --git a/gdb/thread.c b/gdb/thread.c -index a7ac3c8..815c82d 100644 +index 55b4b96..e0ad2d3 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -61,7 +61,6 @@ static int thread_alive (struct thread_info *); @@ -30587,10 +28500,10 @@ index 51e6960..48b30e4 100644 /* User function handler. */ diff --git a/gdb/varobj.c b/gdb/varobj.c -index 603071f..f1ce89f 100644 +index 7235635..9848de0 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c -@@ -26,9 +26,12 @@ +@@ -26,6 +26,8 @@ #include "gdbcmd.h" #include "block.h" #include "valprint.h" @@ -30599,59 +28512,7 @@ index 603071f..f1ce89f 100644 #include "gdb_assert.h" #include "gdb_string.h" -+#include "gdb_regex.h" - - #include "varobj.h" - #include "vec.h" -@@ -59,6 +62,15 @@ char *varobj_format_string[] = - /* String representations of gdb's known languages */ - char *varobj_language_string[] = { "unknown", "C", "C++", "Java" }; - -+/* True if we want to allow Python-based pretty-printing. */ -+static int pretty_printing = 0; -+ -+void -+varobj_enable_pretty_printing (void) -+{ -+ pretty_printing = 1; -+} -+ - /* Data structures */ - - /* Every root variable has one of these structures saved in its -@@ -173,9 +185,31 @@ struct varobj - frozen. */ - int not_fetched; - -+ /* Sub-range of children which the MI consumer has requested. If -+ FROM < 0 or TO < 0, means that all children have been -+ requested. */ -+ int from; -+ int to; -+ -+ /* The pretty-printer constructor. If NULL, then the default -+ pretty-printer will be looked up. If None, then no -+ pretty-printer will be installed. */ -+ PyObject *constructor; -+ - /* The pretty-printer that has been constructed. If NULL, then a - new printer object is needed, and one will be constructed. */ - PyObject *pretty_printer; -+ -+ /* The iterator returned by the printer's 'children' method, or NULL -+ if not available. */ -+ PyObject *child_iter; -+ -+ /* We request one extra item from the iterator, so that we can -+ report to the caller whether there are more items than we have -+ already reported. However, we don't want to install this value -+ when we read it, because that will mess up future updates. So, -+ we stash it here instead. */ -+ PyObject *saved_item; - }; - - struct cpstack -@@ -221,6 +255,8 @@ static void free_variable (struct varobj *var); +@@ -253,6 +255,8 @@ static void free_variable (struct varobj *var); static struct cleanup *make_cleanup_free_variable (struct varobj *var); @@ -30660,16 +28521,7 @@ index 603071f..f1ce89f 100644 static struct type *get_type (struct varobj *var); static struct type *get_value_type (struct varobj *var); -@@ -236,8 +272,6 @@ static char *cppop (struct cpstack **pstack); - static int install_new_value (struct varobj *var, struct value *value, - int initial); - --static void install_default_visualizer (struct varobj *var); -- - /* Language-specific routines. */ - - static enum varobj_languages variable_language (struct varobj *var); -@@ -450,6 +484,8 @@ is_root_p (struct varobj *var) +@@ -480,6 +484,8 @@ is_root_p (struct varobj *var) struct cleanup * varobj_ensure_python_env (struct varobj *var) { @@ -30678,34 +28530,15 @@ index 603071f..f1ce89f 100644 return ensure_python_env (var->root->exp->gdbarch, var->root->exp->language_defn); } -@@ -621,9 +657,9 @@ varobj_create (char *objname, +@@ -651,6 +657,7 @@ varobj_create (char *objname, do_cleanups (old_chain); return NULL; } + make_cleanup_uninstall_variable (var); } -- install_default_visualizer (var); discard_cleanups (old_chain); - return var; - } -@@ -738,15 +774,8 @@ instantiate_pretty_printer (PyObject *constructor, struct value *value) - #if HAVE_PYTHON - PyObject *val_obj = NULL; - PyObject *printer; -- volatile struct gdb_exception except; - -- TRY_CATCH (except, RETURN_MASK_ALL) -- { -- value = value_copy (value); -- } -- GDB_PY_HANDLE_EXCEPTION (except); - val_obj = value_to_value_object (value); -- - if (! val_obj) - return NULL; - -@@ -799,7 +828,12 @@ varobj_get_display_hint (struct varobj *var) +@@ -821,7 +828,12 @@ varobj_get_display_hint (struct varobj *var) char *result = NULL; #if HAVE_PYTHON @@ -30719,784 +28552,7 @@ index 603071f..f1ce89f 100644 if (var->pretty_printer) result = gdbpy_get_display_hint (var->pretty_printer); -@@ -810,6 +844,17 @@ varobj_get_display_hint (struct varobj *var) - return result; - } - -+/* Return true if the varobj has items after TO, false otherwise. */ -+ -+int -+varobj_has_more (struct varobj *var, int to) -+{ -+ if (VEC_length (varobj_p, var->children) > to) -+ return 1; -+ return ((to == -1 || VEC_length (varobj_p, var->children) == to) -+ && var->saved_item != NULL); -+} -+ - /* If the variable object is bound to a specific thread, that - is its evaluation can always be done in context of a frame - inside that thread, returns GDB id of the thread -- which -@@ -842,22 +887,94 @@ varobj_get_frozen (struct varobj *var) - return var->frozen; - } - -+/* A helper function that restricts a range to what is actually -+ available in a VEC. This follows the usual rules for the meaning -+ of FROM and TO -- if either is negative, the entire range is -+ used. */ -+ -+static void -+restrict_range (VEC (varobj_p) *children, int *from, int *to) -+{ -+ if (*from < 0 || *to < 0) -+ { -+ *from = 0; -+ *to = VEC_length (varobj_p, children); -+ } -+ else -+ { -+ if (*from > VEC_length (varobj_p, children)) -+ *from = VEC_length (varobj_p, children); -+ if (*to > VEC_length (varobj_p, children)) -+ *to = VEC_length (varobj_p, children); -+ if (*from > *to) -+ *from = *to; -+ } -+} -+ -+/* A helper for update_dynamic_varobj_children that installs a new -+ child when needed. */ -+ -+static void -+install_dynamic_child (struct varobj *var, -+ VEC (varobj_p) **changed, -+ VEC (varobj_p) **new, -+ VEC (varobj_p) **unchanged, -+ int *cchanged, -+ int index, -+ const char *name, -+ struct value *value) -+{ -+ if (VEC_length (varobj_p, var->children) < index + 1) -+ { -+ /* There's no child yet. */ -+ struct varobj *child = varobj_add_child (var, name, value); -+ if (new) -+ VEC_safe_push (varobj_p, *new, child); -+ *cchanged = 1; -+ } -+ else -+ { -+ varobj_p existing = VEC_index (varobj_p, var->children, index); -+ if (install_new_value (existing, value, 0)) -+ { -+ if (changed) -+ VEC_safe_push (varobj_p, *changed, existing); -+ } -+ else if (unchanged) -+ VEC_safe_push (varobj_p, *unchanged, existing); -+ } -+} -+ -+#if HAVE_PYTHON -+ -+static int -+dynamic_varobj_has_child_method (struct varobj *var) -+{ -+ struct cleanup *back_to; -+ PyObject *printer = var->pretty_printer; -+ int result; -+ -+ back_to = varobj_ensure_python_env (var); -+ result = PyObject_HasAttr (printer, gdbpy_children_cst); -+ do_cleanups (back_to); -+ return result; -+} -+ -+#endif -+ - static int - update_dynamic_varobj_children (struct varobj *var, - VEC (varobj_p) **changed, -- VEC (varobj_p) **new_and_unchanged, -- int *cchanged) -- -+ VEC (varobj_p) **new, -+ VEC (varobj_p) **unchanged, -+ int *cchanged, -+ int update_children, -+ int to) - { - #if HAVE_PYTHON -- /* FIXME: we *might* want to provide this functionality as -- a standalone function, so that other interested parties -- than varobj code can benefit for this. */ - struct cleanup *back_to; - PyObject *children; -- PyObject *iterator; - int i; -- int children_changed = 0; - PyObject *printer = var->pretty_printer; - - back_to = varobj_ensure_python_env (var); -@@ -869,87 +986,103 @@ update_dynamic_varobj_children (struct varobj *var, - return 0; - } - -- children = PyObject_CallMethodObjArgs (printer, gdbpy_children_cst, -- NULL); -- -- if (!children) -+ if (update_children || !var->child_iter) - { -- gdbpy_print_stack (); -- error (_("Null value returned for children")); -- } -+ children = PyObject_CallMethodObjArgs (printer, gdbpy_children_cst, -+ NULL); -+ -+ if (!children) -+ { -+ gdbpy_print_stack (); -+ error (_("Null value returned for children")); -+ } - -- make_cleanup_py_decref (children); -+ make_cleanup_py_decref (children); - -- if (!PyIter_Check (children)) -- error (_("Returned value is not iterable")); -+ if (!PyIter_Check (children)) -+ error (_("Returned value is not iterable")); - -- iterator = PyObject_GetIter (children); -- if (!iterator) -- { -- gdbpy_print_stack (); -- error (_("Could not get children iterator")); -+ Py_XDECREF (var->child_iter); -+ var->child_iter = PyObject_GetIter (children); -+ if (!var->child_iter) -+ { -+ gdbpy_print_stack (); -+ error (_("Could not get children iterator")); -+ } -+ -+ Py_XDECREF (var->saved_item); -+ var->saved_item = NULL; -+ -+ i = 0; - } -- make_cleanup_py_decref (iterator); -+ else -+ i = VEC_length (varobj_p, var->children); - -- for (i = 0; ; ++i) -+ /* We ask for one extra child, so that MI can report whether there -+ are more children. */ -+ for (; to < 0 || i < to + 1; ++i) - { -- PyObject *item = PyIter_Next (iterator); -- PyObject *py_v; -- struct value *v; -- char *name; -- struct cleanup *inner; -- -+ PyObject *item; -+ -+ /* See if there was a leftover from last time. */ -+ if (var->saved_item) -+ { -+ item = var->saved_item; -+ var->saved_item = NULL; -+ } -+ else -+ item = PyIter_Next (var->child_iter); -+ - if (!item) - break; -- inner = make_cleanup_py_decref (item); - -- if (!PyArg_ParseTuple (item, "sO", &name, &py_v)) -- error (_("Invalid item from the child list")); -- -- v = convert_value_from_python (py_v); -+ /* We don't want to push the extra child on any report list. */ -+ if (to < 0 || i < to) -+ { -+ PyObject *py_v; -+ char *name; -+ struct value *v; -+ struct cleanup *inner; - -- /* TODO: This assume the name of the i-th child never changes. */ -+ inner = make_cleanup_py_decref (item); - -- /* Now see what to do here. */ -- if (VEC_length (varobj_p, var->children) < i + 1) -- { -- /* There's no child yet. */ -- struct varobj *child = varobj_add_child (var, name, v); -- if (new_and_unchanged) -- VEC_safe_push (varobj_p, *new_and_unchanged, child); -- children_changed = 1; -+ if (!PyArg_ParseTuple (item, "sO", &name, &py_v)) -+ error (_("Invalid item from the child list")); -+ -+ v = convert_value_from_python (py_v); -+ install_dynamic_child (var, changed, new, unchanged, -+ cchanged, i, name, v); -+ do_cleanups (inner); - } -- else -+ else - { -- varobj_p existing = VEC_index (varobj_p, var->children, i); -- if (install_new_value (existing, v, 0) && changed) -- { -- if (changed) -- VEC_safe_push (varobj_p, *changed, existing); -- } -- else -- { -- if (new_and_unchanged) -- VEC_safe_push (varobj_p, *new_and_unchanged, existing); -- } -- } -+ Py_XDECREF (var->saved_item); -+ var->saved_item = item; - -- do_cleanups (inner); -+ /* We want to truncate the child list just before this -+ element. */ -+ break; -+ } - } - - if (i < VEC_length (varobj_p, var->children)) - { -- int i; -- children_changed = 1; -- for (i = 0; i < VEC_length (varobj_p, var->children); ++i) -- varobj_delete (VEC_index (varobj_p, var->children, i), NULL, 0); -+ int j; -+ *cchanged = 1; -+ for (j = i; j < VEC_length (varobj_p, var->children); ++j) -+ varobj_delete (VEC_index (varobj_p, var->children, j), NULL, 0); -+ VEC_truncate (varobj_p, var->children, i); - } -- VEC_truncate (varobj_p, var->children, i); -+ -+ /* If there are fewer children than requested, note that the list of -+ children changed. */ -+ if (to >= 0 && VEC_length (varobj_p, var->children) < to) -+ *cchanged = 1; -+ - var->num_children = VEC_length (varobj_p, var->children); - - do_cleanups (back_to); - -- *cchanged = children_changed; - return 1; - #else - gdb_assert (0 && "should never be called if Python is not enabled"); -@@ -961,20 +1094,26 @@ varobj_get_num_children (struct varobj *var) - { - if (var->num_children == -1) - { -- int changed; -- if (!var->pretty_printer -- || !update_dynamic_varobj_children (var, NULL, NULL, &changed)) -+ if (var->pretty_printer) -+ { -+ int dummy; -+ -+ /* If we have a dynamic varobj, don't report -1 children. -+ So, try to fetch some children first. */ -+ update_dynamic_varobj_children (var, NULL, NULL, NULL, &dummy, 0, 0); -+ } -+ else - var->num_children = number_of_children (var); - } - -- return var->num_children; -+ return var->num_children >= 0 ? var->num_children : 0; - } - - /* Creates a list of the immediate children of a variable object; - the return code is the number of such children or -1 on error */ - - VEC (varobj_p)* --varobj_list_children (struct varobj *var) -+varobj_list_children (struct varobj *var, int *from, int *to) - { - struct varobj *child; - char *name; -@@ -982,12 +1121,16 @@ varobj_list_children (struct varobj *var) - - var->children_requested = 1; - -- if (var->pretty_printer -+ if (var->pretty_printer) -+ { - /* This, in theory, can result in the number of children changing without - frontend noticing. But well, calling -var-list-children on the same - varobj twice is not something a sane frontend would do. */ -- && update_dynamic_varobj_children (var, NULL, NULL, &children_changed)) -- return var->children; -+ update_dynamic_varobj_children (var, NULL, NULL, NULL, &children_changed, -+ 0, *to); -+ restrict_range (var->children, from, to); -+ return var->children; -+ } - - if (var->num_children == -1) - var->num_children = number_of_children (var); -@@ -1013,10 +1156,10 @@ varobj_list_children (struct varobj *var) - name = name_of_child (var, i); - existing = create_child (var, i, name); - VEC_replace (varobj_p, var->children, i, existing); -- install_default_visualizer (existing); - } - } - -+ restrict_range (var->children, from, to); - return var->children; - } - -@@ -1027,7 +1170,6 @@ varobj_add_child (struct varobj *var, const char *name, struct value *value) - VEC_length (varobj_p, var->children), - name, value); - VEC_safe_push (varobj_p, var->children, v); -- install_default_visualizer (v); - return v; - } - -@@ -1089,6 +1231,12 @@ varobj_get_attributes (struct varobj *var) - return attributes; - } - -+int -+varobj_pretty_printed_p (struct varobj *var) -+{ -+ return var->pretty_printer != NULL; -+} -+ - char * - varobj_get_formatted_value (struct varobj *var, - enum varobj_display_formats format) -@@ -1166,6 +1314,116 @@ varobj_set_value (struct varobj *var, char *expression) - return 1; - } - -+#if HAVE_PYTHON -+ -+/* A helper function to install a constructor function and visualizer -+ in a varobj. */ -+ -+static void -+install_visualizer (struct varobj *var, PyObject *constructor, -+ PyObject *visualizer) -+{ -+ Py_XDECREF (var->constructor); -+ var->constructor = constructor; -+ -+ Py_XDECREF (var->pretty_printer); -+ var->pretty_printer = visualizer; -+ -+ Py_XDECREF (var->child_iter); -+ var->child_iter = NULL; -+} -+ -+/* Install the default visualizer for VAR. */ -+ -+static void -+install_default_visualizer (struct varobj *var) -+{ -+ if (pretty_printing) -+ { -+ PyObject *pretty_printer = NULL; -+ -+ if (var->value) -+ { -+ pretty_printer = gdbpy_get_varobj_pretty_printer (var->value); -+ if (! pretty_printer) -+ { -+ gdbpy_print_stack (); -+ error (_("Cannot instantiate printer for default visualizer")); -+ } -+ } -+ -+ if (pretty_printer == Py_None) -+ { -+ Py_DECREF (pretty_printer); -+ pretty_printer = NULL; -+ } -+ -+ install_visualizer (var, NULL, pretty_printer); -+ } -+} -+ -+/* Instantiate and install a visualizer for VAR using CONSTRUCTOR to -+ make a new object. */ -+ -+static void -+construct_visualizer (struct varobj *var, PyObject *constructor) -+{ -+ PyObject *pretty_printer; -+ -+ Py_INCREF (constructor); -+ if (constructor == Py_None) -+ pretty_printer = NULL; -+ else -+ { -+ pretty_printer = instantiate_pretty_printer (constructor, var->value); -+ if (! pretty_printer) -+ { -+ gdbpy_print_stack (); -+ Py_DECREF (constructor); -+ constructor = Py_None; -+ Py_INCREF (constructor); -+ } -+ -+ if (pretty_printer == Py_None) -+ { -+ Py_DECREF (pretty_printer); -+ pretty_printer = NULL; -+ } -+ } -+ -+ install_visualizer (var, constructor, pretty_printer); -+} -+ -+#endif /* HAVE_PYTHON */ -+ -+/* A helper function for install_new_value. This creates and installs -+ a visualizer for VAR, if appropriate. */ -+ -+static void -+install_new_value_visualizer (struct varobj *var) -+{ -+#if HAVE_PYTHON -+ /* If the constructor is None, then we want the raw value. If VAR -+ does not have a value, just skip this. */ -+ if (var->constructor != Py_None && var->value) -+ { -+ struct cleanup *cleanup; -+ PyObject *pretty_printer = NULL; -+ -+ cleanup = varobj_ensure_python_env (var); -+ -+ if (!var->constructor) -+ install_default_visualizer (var); -+ else -+ construct_visualizer (var, var->constructor); -+ -+ do_cleanups (cleanup); -+ } -+#else -+ /* Do nothing. */ -+#endif -+} -+ - /* Assign a new value to a variable object. If INITIAL is non-zero, - this is the first assignement after the variable object was just - created, or changed type. In that case, just assign the value -@@ -1206,10 +1464,7 @@ install_new_value (struct varobj *var, struct value *value, int initial) - that in C++ a reference is not rebindable, it cannot - meaningfully change. So, get hold of the real value. */ - if (value) -- { -- value = coerce_ref (value); -- release_value (value); -- } -+ value = coerce_ref (value); - - if (var->type && TYPE_CODE (var->type) == TYPE_CODE_UNION) - /* For unions, we need to fetch the value implicitly because -@@ -1256,7 +1511,7 @@ install_new_value (struct varobj *var, struct value *value, int initial) - values. Don't get string rendering if the value is - lazy -- if it is, the code above has decided that the value - should not be fetched. */ -- if (value && !value_lazy (value)) -+ if (value && !value_lazy (value) && !var->pretty_printer) - print_value = value_get_print_value (value, var->format, var); - - /* If the type is changeable, compare the old and the new values. -@@ -1272,7 +1527,7 @@ install_new_value (struct varobj *var, struct value *value, int initial) - { - changed = 1; - } -- else -+ else if (! var->pretty_printer) - { - /* Try to compare the values. That requires that both - values are non-lazy. */ -@@ -1317,74 +1572,53 @@ install_new_value (struct varobj *var, struct value *value, int initial) - if (var->value != NULL && var->value != value) - value_free (var->value); - var->value = value; -- if (var->print_value) -- xfree (var->print_value); -- var->print_value = print_value; -+ if (value != NULL) -+ value_incref (value); - if (value && value_lazy (value) && intentionally_not_fetched) - var->not_fetched = 1; - else - var->not_fetched = 0; - var->updated = 0; - -+ install_new_value_visualizer (var); -+ -+ /* If we installed a pretty-printer, re-compare the printed version -+ to see if the variable changed. */ -+ if (var->pretty_printer) -+ { -+ xfree (print_value); -+ print_value = value_get_print_value (var->value, var->format, var); -+ if (!var->print_value || strcmp (var->print_value, print_value) != 0) -+ changed = 1; -+ } -+ if (var->print_value) -+ xfree (var->print_value); -+ var->print_value = print_value; -+ - gdb_assert (!var->value || value_type (var->value)); - - return changed; - } - --static void --install_visualizer (struct varobj *var, PyObject *visualizer) -+/* Return the requested range for a varobj. VAR is the varobj. FROM -+ and TO are out parameters; *FROM and *TO will be set to the -+ selected sub-range of VAR. If no range was selected using -+ -var-set-update-range, then both will be -1. */ -+void -+varobj_get_child_range (struct varobj *var, int *from, int *to) - { --#if HAVE_PYTHON -- /* If there are any children now, wipe them. */ -- varobj_delete (var, NULL, 1 /* children only */); -- var->num_children = -1; -- -- Py_XDECREF (var->pretty_printer); -- var->pretty_printer = visualizer; -- -- install_new_value (var, var->value, 1); -- -- /* If we removed the visualizer, and the user ever requested the -- object's children, then we must compute the list of children. -- Note that we needn't do this when installing a visualizer, -- because updating will recompute dynamic children. */ -- if (!visualizer && var->children_requested) -- varobj_list_children (var); --#else -- error (_("Python support required")); --#endif -+ *from = var->from; -+ *to = var->to; - } - --static void --install_default_visualizer (struct varobj *var) -+/* Set the selected sub-range of children of VAR to start at index -+ FROM and end at index TO. If either FROM or TO is less than zero, -+ this is interpreted as a request for all children. */ -+void -+varobj_set_child_range (struct varobj *var, int from, int to) - { --#if HAVE_PYTHON -- struct cleanup *cleanup; -- PyObject *pretty_printer = NULL; -- -- cleanup = varobj_ensure_python_env (var); -- -- if (var->value) -- { -- pretty_printer = gdbpy_get_varobj_pretty_printer (var->value); -- if (! pretty_printer) -- { -- gdbpy_print_stack (); -- error (_("Cannot instantiate printer for default visualizer")); -- } -- } -- -- if (pretty_printer == Py_None) -- { -- Py_DECREF (pretty_printer); -- pretty_printer = NULL; -- } -- -- install_visualizer (var, pretty_printer); -- do_cleanups (cleanup); --#else -- /* No error is right as this function is inserted just as a hook. */ --#endif -+ var->from = from; -+ var->to = to; - } - - void -@@ -1402,31 +1636,19 @@ varobj_set_visualizer (struct varobj *var, const char *visualizer) - make_cleanup_py_decref (globals); - - constructor = PyRun_String (visualizer, Py_eval_input, globals, globals); -- -- /* Do not instantiate NoneType. */ -- if (constructor == Py_None) -- { -- pretty_printer = Py_None; -- Py_INCREF (pretty_printer); -- } -- else -- pretty_printer = instantiate_pretty_printer (constructor, var->value); -- -- Py_XDECREF (constructor); - -- if (! pretty_printer) -+ if (! constructor) - { - gdbpy_print_stack (); - error (_("Could not evaluate visualizer expression: %s"), visualizer); - } - -- if (pretty_printer == Py_None) -- { -- Py_DECREF (pretty_printer); -- pretty_printer = NULL; -- } -+ construct_visualizer (var, constructor); -+ Py_XDECREF (constructor); - -- install_visualizer (var, pretty_printer); -+ /* If there are any children now, wipe them. */ -+ varobj_delete (var, NULL, 1 /* children only */); -+ var->num_children = -1; - - do_cleanups (back_to); - #else -@@ -1537,44 +1759,74 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit) - - /* We probably should not get children of a varobj that has a - pretty-printer, but for which -var-list-children was never -- invoked. Presumably, such varobj is not yet expanded in the -- UI, so we need not bother getting it. */ -+ invoked. */ - if (v->pretty_printer) - { -- VEC (varobj_p) *changed = 0, *new_and_unchanged = 0; -+ VEC (varobj_p) *changed = 0, *new = 0, *unchanged = 0; - int i, children_changed; - varobj_p tmp; - -- if (!v->children_requested) -- continue; -- - if (v->frozen) - continue; - -+ if (!v->children_requested) -+ { -+ int dummy; -+ -+ /* If we initially did not have potential children, but -+ now we do, consider the varobj as changed. -+ Otherwise, if children were never requested, consider -+ it as unchanged -- presumably, such varobj is not yet -+ expanded in the UI, so we need not bother getting -+ it. */ -+ if (!varobj_has_more (v, 0)) -+ { -+ update_dynamic_varobj_children (v, NULL, NULL, NULL, -+ &dummy, 0, 0); -+ if (varobj_has_more (v, 0)) -+ r.changed = 1; -+ } -+ -+ if (r.changed) -+ VEC_safe_push (varobj_update_result, result, &r); -+ -+ continue; -+ } -+ - /* If update_dynamic_varobj_children returns 0, then we have - a non-conforming pretty-printer, so we skip it. */ -- if (update_dynamic_varobj_children (v, &changed, &new_and_unchanged, -- &children_changed)) -+ if (update_dynamic_varobj_children (v, &changed, &new, &unchanged, -+ &children_changed, 1, v->to)) - { -- if (children_changed) -- r.children_changed = 1; -- for (i = 0; VEC_iterate (varobj_p, changed, i, tmp); ++i) -+ if (children_changed || new) - { -- varobj_update_result r = {tmp}; -- r.changed = 1; -- r.value_installed = 1; -- VEC_safe_push (varobj_update_result, stack, &r); -+ r.children_changed = 1; -+ r.new = new; - } -- for (i = 0; -- VEC_iterate (varobj_p, new_and_unchanged, i, tmp); -- ++i) -+ for (i = 0; VEC_iterate (varobj_p, changed, i, tmp); ++i) - { - varobj_update_result r = {tmp}; -+ r.changed = 1; - r.value_installed = 1; - VEC_safe_push (varobj_update_result, stack, &r); - } -+ for (i = 0; VEC_iterate (varobj_p, unchanged, i, tmp); ++i) -+ { -+ if (!tmp->frozen) -+ { -+ varobj_update_result r = {tmp}; -+ r.value_installed = 1; -+ VEC_safe_push (varobj_update_result, stack, &r); -+ } -+ } - if (r.changed || r.children_changed) - VEC_safe_push (varobj_update_result, result, &r); -+ -+ /* Free CHANGED and UNCHANGED, but not NEW, because NEW -+ has been put into the result vector. */ -+ VEC_free (varobj_p, changed); -+ VEC_free (varobj_p, unchanged); -+ - continue; - } - } -@@ -1862,7 +2114,12 @@ new_variable (void) - var->frozen = 0; - var->not_fetched = 0; - var->children_requested = 0; -+ var->from = -1; -+ var->to = -1; -+ var->constructor = 0; - var->pretty_printer = 0; -+ var->child_iter = 0; -+ var->saved_item = 0; - - return var; - } -@@ -1892,7 +2149,10 @@ free_variable (struct varobj *var) - if (var->pretty_printer) - { - struct cleanup *cleanup = varobj_ensure_python_env (var); -- Py_DECREF (var->pretty_printer); -+ Py_XDECREF (var->constructor); -+ Py_XDECREF (var->pretty_printer); -+ Py_XDECREF (var->child_iter); -+ Py_XDECREF (var->saved_item); - do_cleanups (cleanup); - } - #endif -@@ -1925,6 +2185,18 @@ make_cleanup_free_variable (struct varobj *var) +@@ -2186,6 +2198,18 @@ make_cleanup_free_variable (struct varobj *var) return make_cleanup (do_free_variable_cleanup, var); } @@ -31515,124 +28571,7 @@ index 603071f..f1ce89f 100644 /* This returns the type of the variable. It also skips past typedefs to return the real type of the variable. -@@ -2139,6 +2411,8 @@ value_of_root (struct varobj **var_handle, int *type_changed) - else - { - tmp_var->obj_name = xstrdup (var->obj_name); -+ tmp_var->from = var->from; -+ tmp_var->to = var->to; - varobj_delete (var, NULL, 0); - - install_variable (tmp_var); -@@ -2173,7 +2447,11 @@ static char * - my_value_of_variable (struct varobj *var, enum varobj_display_formats format) - { - if (var->root->is_valid) -- return (*var->root->lang->value_of_variable) (var, format); -+ { -+ if (var->pretty_printer) -+ return value_get_print_value (var->value, var->format, var); -+ return (*var->root->lang->value_of_variable) (var, format); -+ } - else - return NULL; - } -@@ -2196,43 +2474,51 @@ value_get_print_value (struct value *value, enum varobj_display_formats format, - struct cleanup *back_to = varobj_ensure_python_env (var); - PyObject *value_formatter = var->pretty_printer; - -- if (value_formatter && PyObject_HasAttr (value_formatter, -- gdbpy_to_string_cst)) -+ if (value_formatter) - { -- char *hint; -- struct value *replacement; -- int string_print = 0; -- PyObject *output = NULL; -+ /* First check to see if we have any children at all. If so, -+ we simply return {...}. */ -+ if (dynamic_varobj_has_child_method (var)) -+ return xstrdup ("{...}"); - -- hint = gdbpy_get_display_hint (value_formatter); -- if (hint) -+ if (PyObject_HasAttr (value_formatter, gdbpy_to_string_cst)) - { -- if (!strcmp (hint, "string")) -- string_print = 1; -- xfree (hint); -- } -+ char *hint; -+ struct value *replacement; -+ int string_print = 0; -+ PyObject *output = NULL; -+ -+ hint = gdbpy_get_display_hint (value_formatter); -+ if (hint) -+ { -+ if (!strcmp (hint, "string")) -+ string_print = 1; -+ xfree (hint); -+ } - -- output = apply_varobj_pretty_printer (value_formatter, -- &replacement); -- if (output) -- { -- PyObject *py_str = python_string_to_target_python_string (output); -- if (py_str) -- { -- char *s = PyString_AsString (py_str); -- len = PyString_Size (py_str); -- thevalue = xmemdup (s, len + 1, len + 1); -- Py_DECREF (py_str); -+ output = apply_varobj_pretty_printer (value_formatter, -+ &replacement); -+ if (output) -+ { -+ PyObject *py_str -+ = python_string_to_target_python_string (output); -+ if (py_str) -+ { -+ char *s = PyString_AsString (py_str); -+ len = PyString_Size (py_str); -+ thevalue = xmemdup (s, len + 1, len + 1); -+ Py_DECREF (py_str); -+ } -+ Py_DECREF (output); - } -- Py_DECREF (output); -- } -- if (thevalue && !string_print) -- { -- do_cleanups (back_to); -- return thevalue; -+ if (thevalue && !string_print) -+ { -+ do_cleanups (back_to); -+ return thevalue; -+ } -+ if (replacement) -+ value = replacement; - } -- if (replacement) -- value = replacement; - } - do_cleanups (back_to); - } -@@ -2961,10 +3247,7 @@ cplus_describe_child (struct varobj *parent, int index, - *cname = xstrdup (TYPE_FIELD_NAME (type, index)); - - if (cvalue && value) -- { -- *cvalue = value_cast (TYPE_FIELD_TYPE (type, index), value); -- release_value (*cvalue); -- } -+ *cvalue = value_cast (TYPE_FIELD_TYPE (type, index), value); - - if (ctype) - { -@@ -3170,6 +3453,19 @@ java_value_of_variable (struct varobj *var, enum varobj_display_formats format) +@@ -3442,6 +3466,19 @@ java_value_of_variable (struct varobj *var, enum varobj_display_formats format) return cplus_value_of_variable (var, format); } @@ -31652,7 +28591,7 @@ index 603071f..f1ce89f 100644 /* Iterate all the existing _root_ VAROBJs and call the FUNC callback for them with an arbitrary caller supplied DATA pointer. */ -@@ -3187,6 +3483,43 @@ all_root_varobjs (void (*func) (struct varobj *var, void *data), void *data) +@@ -3459,6 +3496,43 @@ all_root_varobjs (void (*func) (struct varobj *var, void *data), void *data) (*func) (var_root->rootvar, data); } } @@ -31696,66 +28635,6 @@ index 603071f..f1ce89f 100644 extern void _initialize_varobj (void); void -diff --git a/gdb/varobj.h b/gdb/varobj.h -index 7297243..f43c593 100644 ---- a/gdb/varobj.h -+++ b/gdb/varobj.h -@@ -78,6 +78,12 @@ typedef struct varobj_update_result_t - new value of varobj is already computed and installed, or has to - be yet installed. Don't use this outside varobj.c */ - int value_installed; -+ -+ /* This will be non-NULL when new children were added to the varobj. -+ It lists the new children (which must necessarily come at the end -+ of the child list) added during an update. The caller is -+ responsible for freeing this vector. */ -+ VEC (varobj_p) *new; - } varobj_update_result; - - DEF_VEC_O (varobj_update_result); -@@ -112,13 +118,24 @@ extern void varobj_set_frozen (struct varobj *var, int frozen); - - extern int varobj_get_frozen (struct varobj *var); - -+extern void varobj_get_child_range (struct varobj *var, int *from, int *to); -+ -+extern void varobj_set_child_range (struct varobj *var, int from, int to); -+ - extern char *varobj_get_display_hint (struct varobj *var); - - extern int varobj_get_num_children (struct varobj *var); - --/* Return the list of children of VAR. The returned vector -- should not be modified in any way. */ --extern VEC (varobj_p)* varobj_list_children (struct varobj *var); -+/* Return the list of children of VAR. The returned vector should not -+ be modified in any way. FROM and TO are in/out parameters -+ indicating the range of children to return. If either *FROM or *TO -+ is less than zero on entry, then all children will be returned. On -+ return, *FROM and *TO will be updated to indicate the real range -+ that was returned. The resulting VEC will contain at least the -+ children from *FROM to just before *TO; it might contain more -+ children, depending on whether any more were available. */ -+extern VEC (varobj_p)* varobj_list_children (struct varobj *var, -+ int *from, int *to); - - extern char *varobj_get_type (struct varobj *var); - -@@ -149,6 +166,13 @@ extern int varobj_editable_p (struct varobj *var); - - extern int varobj_floating_p (struct varobj *var); - --extern void varobj_set_visualizer (struct varobj *var, const char *visualizer); -+extern void -+varobj_set_visualizer (struct varobj *var, const char *visualizer); -+ -+extern void varobj_enable_pretty_printing (void); -+ -+extern int varobj_has_more (struct varobj *var, int to); -+ -+extern int varobj_pretty_printed_p (struct varobj *var); - - #endif /* VAROBJ_H */ diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index c56ab86..dacf913 100644 --- a/gdb/xcoffread.c diff --git a/gdb-bz515434-qsort_cmp.patch b/gdb-bz515434-qsort_cmp.patch deleted file mode 100644 index b1f4264..0000000 --- a/gdb-bz515434-qsort_cmp.patch +++ /dev/null @@ -1,229 +0,0 @@ -Index: objfiles.c -=================================================================== -RCS file: /cvs/src/src/gdb/objfiles.c,v -retrieving revision 1.93 -diff -p -u -r1.93 objfiles.c ---- ./gdb/objfiles.c 21 Aug 2009 17:57:17 -0000 1.93 -+++ ./gdb/objfiles.c 26 Aug 2009 07:07:04 -0000 -@@ -790,15 +790,9 @@ qsort_cmp (const void *a, const void *b) - const CORE_ADDR sect2_addr = obj_section_addr (sect2); - - if (sect1_addr < sect2_addr) -- { -- gdb_assert (obj_section_endaddr (sect1) <= sect2_addr); -- return -1; -- } -+ return -1; - else if (sect1_addr > sect2_addr) -- { -- gdb_assert (sect1_addr >= obj_section_endaddr (sect2)); -- return 1; -- } -+ return 1; - - return 0; - } -@@ -823,12 +817,133 @@ preferred_obj_section (struct obj_sectio - return b; - } - -+/* Return 1 if SECTION should be inserted into the section map. -+ We want to insert only non-overlay and non-TLS section. */ -+ -+static int -+insert_section_p (const struct bfd *abfd, -+ const struct bfd_section *section) -+{ -+ const bfd_vma lma = bfd_section_lma (abfd, section); -+ -+ if (lma != 0 && lma != bfd_section_vma (abfd, section) -+ && (bfd_get_file_flags (abfd) & BFD_IN_MEMORY) == 0) -+ /* This is an overlay section. IN_MEMORY check is needed to avoid -+ discarding sections from the "system supplied DSO" (aka vdso) -+ on Linux. */ -+ return 0; -+ if ((bfd_get_section_flags (abfd, section) & SEC_THREAD_LOCAL) != 0) -+ /* This is a TLS section. */ -+ return 0; -+ -+ return 1; -+} -+ -+/* Filter out overlapping sections where one section came from the real -+ objfile, and the other from a separate debuginfo file. -+ Return the size of table after redundant sections have been eliminated. */ -+ -+static int -+filter_debuginfo_sections (struct obj_section **map, int map_size) -+{ -+ int i, j; -+ -+ for (i = 0, j = 0; i < map_size - 1; i++) -+ { -+ struct obj_section *const sect1 = map[i]; -+ struct obj_section *const sect2 = map[i + 1]; -+ const struct objfile *const objfile1 = sect1->objfile; -+ const struct objfile *const objfile2 = sect2->objfile; -+ const CORE_ADDR sect1_addr = obj_section_addr (sect1); -+ const CORE_ADDR sect2_addr = obj_section_addr (sect2); -+ -+ if (sect1_addr == sect2_addr -+ && (objfile1->separate_debug_objfile == objfile2 -+ || objfile2->separate_debug_objfile == objfile1)) -+ { -+ map[j++] = preferred_obj_section (sect1, sect2); -+ ++i; -+ } -+ else -+ map[j++] = sect1; -+ } -+ -+ if (i < map_size) -+ map[j++] = map[i]; -+ -+ /* The map should not have shrunk to less than half the original size. */ -+ gdb_assert (map_size / 2 <= j); -+ -+ return j; -+} -+ -+/* Filter out overlapping sections, issuing a warning if any are found. -+ Overlapping sections could really be overlay sections which we didn't -+ classify as such in insert_section_p, or we could be dealing with a -+ corrupt binary. */ -+ -+static int -+filter_overlapping_sections (struct obj_section **map, int map_size) -+{ -+ int i, j; -+ -+ for (i = 0, j = 0; i < map_size - 1; ) -+ { -+ int k; -+ -+ map[j++] = map[i]; -+ for (k = i + 1; k < map_size; k++) -+ { -+ struct obj_section *const sect1 = map[i]; -+ struct obj_section *const sect2 = map[k]; -+ const CORE_ADDR sect1_addr = obj_section_addr (sect1); -+ const CORE_ADDR sect2_addr = obj_section_addr (sect2); -+ const CORE_ADDR sect1_endaddr = obj_section_endaddr (sect1); -+ -+ gdb_assert (sect1_addr <= sect2_addr); -+ -+ if (sect1_endaddr <= sect2_addr) -+ break; -+ else -+ { -+ /* We have an overlap. Report it. */ -+ -+ struct objfile *const objf1 = sect1->objfile; -+ struct objfile *const objf2 = sect2->objfile; -+ -+ const struct bfd *const abfd1 = objf1->obfd; -+ const struct bfd *const abfd2 = objf2->obfd; -+ -+ const struct bfd_section *const bfds1 = sect1->the_bfd_section; -+ const struct bfd_section *const bfds2 = sect2->the_bfd_section; -+ -+ const CORE_ADDR sect2_endaddr = obj_section_endaddr (sect2); -+ -+ struct gdbarch *const gdbarch = get_objfile_arch (objf1); -+ -+ warning (_("Unexpected overlap between " -+ "section `%s' from `%s' [%s, %s) and " -+ "section `%s' from `%s' [%s, %s)"), -+ bfd_section_name (abfd1, bfds1), objf1->name, -+ paddress (gdbarch, sect1_addr), -+ paddress (gdbarch, sect1_endaddr), -+ bfd_section_name (abfd2, bfds2), objf2->name, -+ paddress (gdbarch, sect2_addr), -+ paddress (gdbarch, sect2_endaddr)); -+ } -+ } -+ i = k; -+ } -+ return map_size; -+} -+ -+ - /* Update PMAP, PMAP_SIZE with non-TLS sections from all objfiles. */ - - static void - update_section_map (struct obj_section ***pmap, int *pmap_size) - { -- int map_size, i, j; -+ int alloc_size, map_size, i; - struct obj_section *s, **map; - struct objfile *objfile; - -@@ -837,55 +952,27 @@ update_section_map (struct obj_section * - map = *pmap; - xfree (map); - --#define insert_p(objf, sec) \ -- ((bfd_get_section_flags ((objf)->obfd, (sec)->the_bfd_section) \ -- & SEC_THREAD_LOCAL) == 0) -- -- map_size = 0; -+ alloc_size = 0; - ALL_OBJSECTIONS (objfile, s) -- if (insert_p (objfile, s)) -- map_size += 1; -+ if (insert_section_p (objfile->obfd, s->the_bfd_section)) -+ alloc_size += 1; - -- map = xmalloc (map_size * sizeof (*map)); -+ map = xmalloc (alloc_size * sizeof (*map)); - - i = 0; - ALL_OBJSECTIONS (objfile, s) -- if (insert_p (objfile, s)) -+ if (insert_section_p (objfile->obfd, s->the_bfd_section)) - map[i++] = s; - --#undef insert_p -- -- qsort (map, map_size, sizeof (*map), qsort_cmp); -- -- /* With separate debuginfo files, we may have up to two (almost) -- identical copies of some obj_sections in the map. -- Filter out duplicates. */ -- for (i = 0, j = 0; i < map_size; ++i) -- { -- struct obj_section *sect1 = map[i]; -- struct obj_section *sect2 = (i + 1 < map_size) ? map[i + 1] : NULL; -- -- if (sect2 == NULL -- || obj_section_addr (sect1) != obj_section_addr (sect2)) -- map[j++] = sect1; -- else -- { -- map[j++] = preferred_obj_section (sect1, sect2); -- ++i; -- } -- } -- -- if (j < map_size) -- { -- /* Some duplicates were eliminated. -- The new size shouldn't be less than half of the original. */ -- gdb_assert (map_size / 2 <= j); -- map_size = j; -- -- map = xrealloc (map, map_size * sizeof (*map)); /* Trim excess space. */ -- } -+ qsort (map, alloc_size, sizeof (*map), qsort_cmp); -+ map_size = filter_debuginfo_sections(map, alloc_size); -+ map_size = filter_overlapping_sections(map, map_size); -+ -+ if (map_size < alloc_size) -+ /* Some sections were eliminated. Trim excess space. */ -+ map = xrealloc (map, map_size * sizeof (*map)); - else -- gdb_assert (j == map_size); -+ gdb_assert (alloc_size == map_size); - - *pmap = map; - *pmap_size = map_size; diff --git a/gdb.spec b/gdb.spec index bcd7b31..45e28f9 100644 --- a/gdb.spec +++ b/gdb.spec @@ -10,7 +10,7 @@ Name: gdb%{?_with_debug:-debug} # Set version to contents of gdb/version.in. # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch). -Version: 6.8.50.20090910 +Version: 6.8.91.20090917 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. @@ -18,7 +18,7 @@ Release: 1%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ Group: Development/Debuggers -Source: ftp://sourceware.org/pub/gdb/snapshots/current/gdb-%{version}.tar.bz2 +Source: ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{version}.tar.bz2 Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) URL: http://gnu.org/software/gdb/ @@ -149,9 +149,6 @@ Patch163: gdb-6.3-inheritancetest-20050726.patch # Add readnever option Patch164: gdb-6.3-readnever-20050907.patch -# Fix frame pointer for ia64 sigtramp frame -Patch166: gdb-6.3-ia64-sigtramp-fp-20050926.patch - # Fix ia64 gdb problem with user-specified SIGILL handling Patch169: gdb-6.3-ia64-sigill-20051115.patch @@ -360,9 +357,6 @@ Patch360: gdb-6.8-bz457187-largefile-test.patch # Fix compatibility of --with-system-readline and readline-6.0+. Patch375: gdb-readline-6.0.patch -# Temporarily disable assertion checks crashing in qsort_cmp (BZ 515434). -Patch378: gdb-bz515434-qsort_cmp.patch - BuildRequires: ncurses-devel texinfo gettext flex bison expat-devel Requires: readline BuildRequires: readline-devel @@ -479,7 +473,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch162 -p1 %patch163 -p1 %patch164 -p1 -%patch166 -p1 %patch169 -p1 %patch170 -p1 %patch176 -p1 @@ -551,7 +544,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch352 -p1 %patch360 -p1 %patch375 -p1 -%patch378 -p1 %patch124 -p1 find -name "*.orig" | xargs rm -f @@ -811,6 +803,7 @@ fi %{python_sitelib}/gdb %endif # 0%{!?_without_python:1} %endif # 0%{!?_with_upstream:1} +%{_datadir}/gdb %{_infodir}/annotate.info* %{_infodir}/gdb.info* %{_infodir}/gdbint.info* @@ -825,6 +818,11 @@ fi %endif %changelog +* Thu Sep 17 2009 Jan Kratochvil - 6.8.91.20090917-1 +- Upgrade to the FSF GDB gdb-7.0 branch and snapshot: 6.8.91.20090917 +- archer-jankratochvil-fedora12 commit: 16f3f01cc2cbc15283462eaabdfcde92cf42cdc6 +- Drop the qsort_cmp workaround as resolved in FSF GDB now (BZ 515434). + * Thu Sep 10 2009 Jan Kratochvil - 6.8.50.20090910-1 - Upgrade to the FSF GDB gdb-6.8.50 snapshot: 6.8.50.20090910 - archer-jankratochvil-fedora12 commit: 941eb487a42933e442cb4d11344cda96ecb8a04d diff --git a/sources b/sources index 991dfb0..bdf9cb0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -476e005b8bb33c5c3b3f0b7bd93988bc gdb-6.8.50.20090910.tar.bz2 +eaed9150b219c8ee56bb676e32a9d2a5 gdb-6.8.91.20090917.tar.bz2