From 806f8c893c8bfcce9672ad50f4cb226cc8c10b59 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 10 Sep 2009 21:37:41 +0000 Subject: [PATCH] - Upgrade to the FSF GDB gdb-6.8.50 snapshot: 6.8.50.20090910 - archer-jankratochvil-fedora12 commit: 941eb487a42933e442cb4d11344cda96ecb8a04d - [next-over-throw] Fix exceptions thrown during next (Tom Tromey). - [bp_location-accel] Do not (much) slow down on 500+ breakpoints (me). --- .cvsignore | 2 +- gdb-6.3-large-core-20051206.patch | 116 +- gdb-6.3-pie-20050110.patch | 136 +- gdb-6.3-test-pie-20050107.patch | 72 +- gdb-6.6-buildid-locate-rpm.patch | 747 ++- gdb-6.6-buildid-locate.patch | 104 +- gdb-6.8-bz254229-gcore-prpsinfo.patch | 58 +- gdb-6.8-bz457187-largefile.patch | 331 +- ....8-bz466901-backtrace-full-prelinked.patch | 18 +- gdb-6.8-inlining-addon.patch | 118 +- gdb-6.8.50.20090818-upstream.patch | 237 - gdb-archer.patch | 5180 ++++++++++------- gdb-bz520129-drow-bitfields.patch | 245 - gdb-readline-6.0.patch | 24 +- gdb.spec | 20 +- sources | 2 +- 16 files changed, 4138 insertions(+), 3272 deletions(-) delete mode 100644 gdb-6.8.50.20090818-upstream.patch delete mode 100644 gdb-bz520129-drow-bitfields.patch diff --git a/.cvsignore b/.cvsignore index c88f61b..6f53a4b 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gdb-6.8.50.20090818.tar.bz2 +gdb-6.8.50.20090910.tar.bz2 diff --git a/gdb-6.3-large-core-20051206.patch b/gdb-6.3-large-core-20051206.patch index 9b44d5b..2876b75 100644 --- a/gdb-6.3-large-core-20051206.patch +++ b/gdb-6.3-large-core-20051206.patch @@ -25,10 +25,10 @@ Port to GDB-6.7. -Index: gdb-6.8.50.20090803/gdb/symfile-mem.c +Index: gdb-6.8.50.20090909/gdb/symfile-mem.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/symfile-mem.c 2009-08-03 16:03:00.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/symfile-mem.c 2009-08-03 16:03:17.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/symfile-mem.c 2009-07-02 19:21:06.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/symfile-mem.c 2009-09-09 19:06:57.000000000 +0200 @@ -56,6 +56,14 @@ #include "elf/common.h" @@ -53,10 +53,10 @@ Index: gdb-6.8.50.20090803/gdb/symfile-mem.c if (nbfd == NULL) error (_("Failed to read a valid object file image from memory.")); -Index: gdb-6.8.50.20090803/gdb/target.c +Index: gdb-6.8.50.20090909/gdb/target.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/target.c 2009-08-03 16:03:00.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/target.c 2009-08-03 16:03:17.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/target.c 2009-09-09 19:05:56.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/target.c 2009-09-09 19:08:11.000000000 +0200 @@ -59,7 +59,7 @@ static int nosymbol (char *, CORE_ADDR * static void tcomplain (void) ATTR_NORETURN; @@ -66,7 +66,7 @@ Index: gdb-6.8.50.20090803/gdb/target.c static int return_zero (void); -@@ -452,7 +452,7 @@ target_terminal_inferior (void) +@@ -492,7 +492,7 @@ target_terminal_inferior (void) (*current_target.to_terminal_inferior) (); } @@ -75,7 +75,7 @@ Index: gdb-6.8.50.20090803/gdb/target.c nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write, struct target_ops *t) { -@@ -670,7 +670,7 @@ update_current_target (void) +@@ -711,7 +711,7 @@ update_current_target (void) (void (*) (struct regcache *)) noprocess); de_fault (deprecated_xfer_memory, @@ -84,7 +84,7 @@ Index: gdb-6.8.50.20090803/gdb/target.c nomemory); de_fault (to_files_info, (void (*) (struct target_ops *)) -@@ -1381,7 +1381,7 @@ target_xfer_partial (struct target_ops * +@@ -1443,7 +1443,7 @@ target_xfer_partial (struct target_ops * it makes no progress, and then return how much was transferred). */ int @@ -93,7 +93,16 @@ Index: gdb-6.8.50.20090803/gdb/target.c { /* Dispatch to the topmost target, not the flattened current_target. Memory accesses check target->to_has_(all_)memory, and the -@@ -1394,7 +1394,7 @@ target_read_memory (CORE_ADDR memaddr, g +@@ -1459,7 +1459,7 @@ target_read_memory (CORE_ADDR memaddr, g + the target's stack. This may trigger different cache behavior. */ + + int +-target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len) ++target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len) + { + /* Dispatch to the topmost target, not the flattened current_target. + Memory accesses check target->to_has_(all_)memory, and the +@@ -1473,7 +1473,7 @@ target_read_stack (CORE_ADDR memaddr, gd } int @@ -102,7 +111,7 @@ Index: gdb-6.8.50.20090803/gdb/target.c { /* Dispatch to the topmost target, not the flattened current_target. Memory accesses check target->to_has_(all_)memory, and the -@@ -2861,8 +2861,8 @@ debug_to_prepare_to_store (struct regcac +@@ -2964,8 +2964,8 @@ debug_to_prepare_to_store (struct regcac fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n"); } @@ -113,7 +122,7 @@ Index: gdb-6.8.50.20090803/gdb/target.c int write, struct mem_attrib *attrib, struct target_ops *target) { -@@ -2872,8 +2872,8 @@ deprecated_debug_xfer_memory (CORE_ADDR +@@ -2975,8 +2975,8 @@ deprecated_debug_xfer_memory (CORE_ADDR attrib, target); fprintf_unfiltered (gdb_stdlog, @@ -124,11 +133,11 @@ Index: gdb-6.8.50.20090803/gdb/target.c write ? "write" : "read", retval); if (retval > 0) -Index: gdb-6.8.50.20090803/gdb/target.h +Index: gdb-6.8.50.20090909/gdb/target.h =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/target.h 2009-08-03 16:03:00.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/target.h 2009-08-03 16:03:17.000000000 +0200 -@@ -363,10 +363,10 @@ struct target_ops +--- gdb-6.8.50.20090909.orig/gdb/target.h 2009-09-09 19:05:56.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/target.h 2009-09-09 19:07:36.000000000 +0200 +@@ -366,10 +366,10 @@ struct target_ops NOTE: cagney/2004-10-01: This has been entirely superseeded by to_xfer_partial and inferior inheritance. */ @@ -143,53 +152,58 @@ Index: gdb-6.8.50.20090803/gdb/target.h void (*to_files_info) (struct target_ops *); int (*to_insert_breakpoint) (struct gdbarch *, struct bp_target_info *); -@@ -675,10 +675,10 @@ extern DCACHE *target_dcache; +@@ -680,12 +680,12 @@ extern void target_dcache_invalidate (vo extern int target_read_string (CORE_ADDR, char **, int, int *); -extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len); +extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len); +-extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len); ++extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len); + extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, - int len); + LONGEST len); /* Fetches the target's memory map. If one is found it is sorted and returned, after some consistency checking. Otherwise, NULL -Index: gdb-6.8.50.20090803/gdb/dcache.c +Index: gdb-6.8.50.20090909/gdb/dcache.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/dcache.c 2009-08-03 16:03:00.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/dcache.c 2009-08-03 16:03:17.000000000 +0200 -@@ -524,9 +524,9 @@ dcache_free (DCACHE *dcache) +--- gdb-6.8.50.20090909.orig/gdb/dcache.c 2009-08-31 22:18:45.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/dcache.c 2009-09-09 19:09:21.000000000 +0200 +@@ -390,10 +390,10 @@ dcache_free (DCACHE *dcache) - This routine is indended to be called by remote_xfer_ functions. */ + The meaning of the result is the same as for target_write. */ -int +LONGEST - dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr, + dcache_xfer_memory (struct target_ops *ops, DCACHE *dcache, + CORE_ADDR memaddr, gdb_byte *myaddr, - int len, int should_write) + LONGEST len, int should_write) { int i; - int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr); -Index: gdb-6.8.50.20090803/gdb/dcache.h + int res; +Index: gdb-6.8.50.20090909/gdb/dcache.h =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/dcache.h 2009-08-03 16:03:00.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/dcache.h 2009-08-03 16:03:17.000000000 +0200 -@@ -35,7 +35,7 @@ void dcache_free (DCACHE *); +--- gdb-6.8.50.20090909.orig/gdb/dcache.h 2009-08-31 22:18:45.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/dcache.h 2009-09-09 19:08:54.000000000 +0200 +@@ -35,8 +35,8 @@ void dcache_free (DCACHE *); /* Simple to call from _xfer_memory */ --int dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my, -- int len, int should_write); -+LONGEST dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my, -+ LONGEST len, int should_write); +-int dcache_xfer_memory (struct target_ops *ops, DCACHE *cache, CORE_ADDR mem, +- gdb_byte *my, int len, int should_write); ++LONGEST dcache_xfer_memory (struct target_ops *ops, DCACHE *cache, CORE_ADDR mem, ++ gdb_byte *my, LONGEST len, int should_write); - #endif /* DCACHE_H */ -Index: gdb-6.8.50.20090803/gdb/exec.c + void dcache_update (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr, + int len); +Index: gdb-6.8.50.20090909/gdb/exec.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/exec.c 2009-08-03 16:03:00.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/exec.c 2009-08-03 16:03:17.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/exec.c 2009-07-02 19:21:06.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/exec.c 2009-09-09 19:06:57.000000000 +0200 @@ -560,7 +560,7 @@ map_vmap (bfd *abfd, bfd *arch) } @@ -199,11 +213,11 @@ Index: gdb-6.8.50.20090803/gdb/exec.c section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len, struct target_section *sections, -Index: gdb-6.8.50.20090803/gdb/linux-nat.c +Index: gdb-6.8.50.20090909/gdb/linux-nat.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/linux-nat.c 2009-08-03 16:03:00.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/linux-nat.c 2009-08-03 16:03:17.000000000 +0200 -@@ -4516,7 +4516,7 @@ linux_xfer_partial (struct target_ops *o +--- gdb-6.8.50.20090909.orig/gdb/linux-nat.c 2009-09-09 19:06:46.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/linux-nat.c 2009-09-09 19:06:57.000000000 +0200 +@@ -4622,7 +4622,7 @@ linux_xfer_partial (struct target_ops *o #endif if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL) { /* This region contains ia64 rse registers, we have to re-read. */ @@ -212,10 +226,10 @@ Index: gdb-6.8.50.20090803/gdb/linux-nat.c /* Re-read register stack area. */ xxfer = super_xfer_partial (ops, object, annex, -Index: gdb-6.8.50.20090803/gdb/remote.c +Index: gdb-6.8.50.20090909/gdb/remote.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/remote.c 2009-08-03 16:03:00.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/remote.c 2009-08-03 16:03:17.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/remote.c 2009-08-18 18:17:16.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/remote.c 2009-09-09 19:06:57.000000000 +0200 @@ -25,6 +25,7 @@ #include "gdb_string.h" #include @@ -224,7 +238,7 @@ Index: gdb-6.8.50.20090803/gdb/remote.c #include "inferior.h" #include "bfd.h" #include "symfile.h" -@@ -5785,12 +5786,19 @@ handle_notification (char *buf, size_t l +@@ -5764,12 +5765,19 @@ handle_notification (char *buf, size_t l if SHOULD_WRITE is nonzero. Returns length of data written or read; 0 for error. TARGET is unused. */ @@ -246,7 +260,7 @@ Index: gdb-6.8.50.20090803/gdb/remote.c set_general_thread (inferior_ptid); -@@ -5799,7 +5807,7 @@ remote_xfer_memory (CORE_ADDR mem_addr, +@@ -5778,7 +5786,7 @@ remote_xfer_memory (CORE_ADDR mem_addr, else res = remote_read_bytes (mem_addr, buffer, mem_len); @@ -255,10 +269,10 @@ Index: gdb-6.8.50.20090803/gdb/remote.c } /* Sends a packet with content determined by the printf format string -Index: gdb-6.8.50.20090803/gdb/remote-sim.c +Index: gdb-6.8.50.20090909/gdb/remote-sim.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/remote-sim.c 2009-08-03 16:03:00.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/remote-sim.c 2009-08-03 16:03:17.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/remote-sim.c 2009-07-02 19:21:06.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/remote-sim.c 2009-09-09 19:06:57.000000000 +0200 @@ -752,11 +752,14 @@ gdbsim_prepare_to_store (struct regcache Returns the number of bytes transferred. */ @@ -276,10 +290,10 @@ Index: gdb-6.8.50.20090803/gdb/remote-sim.c /* If no program is running yet, then ignore the simulator for memory. Pass the request down to the next target, hopefully an exec file. */ -Index: gdb-6.8.50.20090803/gdb/exec.h +Index: gdb-6.8.50.20090909/gdb/exec.h =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/exec.h 2009-06-12 20:38:36.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/exec.h 2009-08-03 16:03:57.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/exec.h 2009-06-12 20:38:36.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/exec.h 2009-09-09 19:06:57.000000000 +0200 @@ -56,7 +56,7 @@ extern int resize_section_table (struct One, and only one, of readbuf or writebuf must be non-NULL. */ diff --git a/gdb-6.3-pie-20050110.patch b/gdb-6.3-pie-20050110.patch index 62e8f25..f6621b2 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.20090811/gdb/amd64-tdep.c +Index: gdb-6.8.50.20090909/gdb/amd64-tdep.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/amd64-tdep.c 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/amd64-tdep.c 2009-08-12 06:18:15.000000000 +0200 +--- 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 @@ -36,6 +36,7 @@ #include "regcache.h" #include "regset.h" @@ -138,10 +138,10 @@ Index: gdb-6.8.50.20090811/gdb/amd64-tdep.c return pc; } -Index: gdb-6.8.50.20090811/gdb/auxv.c +Index: gdb-6.8.50.20090909/gdb/auxv.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/auxv.c 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/auxv.c 2009-08-12 06:18:15.000000000 +0200 +--- 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 @@ -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.20090811/gdb/auxv.c break; } -Index: gdb-6.8.50.20090811/gdb/auxv.h +Index: gdb-6.8.50.20090909/gdb/auxv.h =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/auxv.h 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/auxv.h 2009-08-12 06:18:15.000000000 +0200 +--- 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 @@ -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.20090811/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.20090811/gdb/dwarf2read.c +Index: gdb-6.8.50.20090909/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/dwarf2read.c 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/dwarf2read.c 2009-08-12 06:18:15.000000000 +0200 -@@ -1653,7 +1653,7 @@ dwarf2_build_psymtabs (struct objfile *o +--- 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 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.20090811/gdb/dwarf2read.c || (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)) { -Index: gdb-6.8.50.20090811/gdb/elfread.c +Index: gdb-6.8.50.20090909/gdb/elfread.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/elfread.c 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/elfread.c 2009-08-12 06:18:15.000000000 +0200 +--- 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 @@ -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.20090811/gdb/elfread.c { init_psymbol_list (objfile, 0); mainline = 0; -Index: gdb-6.8.50.20090811/gdb/infrun.c +Index: gdb-6.8.50.20090909/gdb/infrun.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/infrun.c 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/infrun.c 2009-08-12 06:18:15.000000000 +0200 -@@ -3531,6 +3531,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( +--- 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 ( #endif target_terminal_inferior (); @@ -292,10 +292,10 @@ Index: gdb-6.8.50.20090811/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.20090811/gdb/objfiles.c +Index: gdb-6.8.50.20090909/gdb/objfiles.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/objfiles.c 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/objfiles.c 2009-08-12 06:18:15.000000000 +0200 +--- 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" @@ -334,10 +334,10 @@ Index: gdb-6.8.50.20090811/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.20090811/gdb/solib-svr4.c +Index: gdb-6.8.50.20090909/gdb/solib-svr4.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/solib-svr4.c 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/solib-svr4.c 2009-08-12 06:36:58.000000000 +0200 +--- 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 @@ -47,6 +47,7 @@ #include "exec.h" #include "auxv.h" @@ -1000,11 +1000,11 @@ Index: gdb-6.8.50.20090811/gdb/solib-svr4.c + add_info ("linkmap", info_linkmap_command, + "Display the inferior's linkmap."); } -Index: gdb-6.8.50.20090811/gdb/solib.c +Index: gdb-6.8.50.20090909/gdb/solib.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/solib.c 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/solib.c 2009-08-12 06:18:15.000000000 +0200 -@@ -81,6 +81,8 @@ set_solib_ops (struct gdbarch *gdbarch, +--- 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 +@@ -82,6 +82,8 @@ set_solib_ops (struct gdbarch *gdbarch, /* external data declarations */ @@ -1013,7 +1013,7 @@ Index: gdb-6.8.50.20090811/gdb/solib.c /* FIXME: gdbarch needs to control this variable, or else every configuration needs to call set_solib_ops. */ struct target_so_ops *current_target_so_ops; -@@ -104,6 +106,8 @@ The search path for loading non-absolute +@@ -105,6 +107,8 @@ The search path for loading non-absolute value); } @@ -1060,10 +1060,10 @@ Index: gdb-6.8.50.20090811/gdb/solib.c + else + so->objfile = symbol_file_add_from_bfd (so->abfd, flags, sap, OBJF_SHARED); + - p_refcount = xmalloc (sizeof (*p_refcount)); - *p_refcount = 2; /* Both solib and objfile refer to this abfd. */ - bfd_usrdata (so->abfd) = p_refcount; -@@ -600,6 +628,10 @@ update_solib_list (int from_tty, struct + free_section_addr_info (sap); + + return; +@@ -596,6 +624,10 @@ update_solib_list (int from_tty, struct } else { @@ -1074,7 +1074,7 @@ Index: gdb-6.8.50.20090811/gdb/solib.c if (! strcmp (gdb->so_original_name, i->so_original_name)) break; } -@@ -654,18 +686,7 @@ update_solib_list (int from_tty, struct +@@ -650,18 +682,7 @@ update_solib_list (int from_tty, struct /* Fill in the rest of each of the `struct so_list' nodes. */ for (i = inferior; i; i = i->next) { @@ -1094,7 +1094,7 @@ Index: gdb-6.8.50.20090811/gdb/solib.c /* Notify any observer that the shared object has been loaded now that we've added it to GDB's tables. */ -@@ -775,6 +796,32 @@ solib_add (char *pattern, int from_tty, +@@ -771,6 +792,32 @@ solib_add (char *pattern, int from_tty, } } @@ -1127,7 +1127,7 @@ Index: gdb-6.8.50.20090811/gdb/solib.c /* -@@ -1128,4 +1175,12 @@ This takes precedence over the environme +@@ -1189,4 +1236,12 @@ This takes precedence over the environme reload_shared_libraries, show_solib_search_path, &setlist, &showlist); @@ -1140,10 +1140,10 @@ Index: gdb-6.8.50.20090811/gdb/solib.c + NULL, NULL, + &setdebuglist, &showdebuglist); } -Index: gdb-6.8.50.20090811/gdb/solist.h +Index: gdb-6.8.50.20090909/gdb/solist.h =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/solist.h 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/solist.h 2009-08-12 06:18:15.000000000 +0200 +--- 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 @@ -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.20090811/gdb/solist.h +extern int debug_solib; + #endif -Index: gdb-6.8.50.20090811/gdb/symfile-mem.c +Index: gdb-6.8.50.20090909/gdb/symfile-mem.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/symfile-mem.c 2009-08-12 06:13:20.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/symfile-mem.c 2009-08-12 06:18:15.000000000 +0200 +--- 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 @@ -115,7 +115,7 @@ symbol_file_add_from_memory (struct bfd ++i; } @@ -1177,10 +1177,10 @@ Index: gdb-6.8.50.20090811/gdb/symfile-mem.c sai, OBJF_SHARED); /* This might change our ideas about frames already looked at. */ -Index: gdb-6.8.50.20090811/gdb/symfile.c +Index: gdb-6.8.50.20090909/gdb/symfile.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/symfile.c 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/symfile.c 2009-08-12 06:18:15.000000000 +0200 +--- 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 @@ -49,6 +49,7 @@ #include "readline/readline.h" #include "gdb_assert.h" @@ -1189,7 +1189,7 @@ Index: gdb-6.8.50.20090811/gdb/symfile.c #include "observer.h" #include "exec.h" #include "parser-defs.h" -@@ -786,7 +787,7 @@ syms_from_objfile (struct objfile *objfi +@@ -779,7 +780,7 @@ syms_from_objfile (struct objfile *objfi /* Now either addrs or offsets is non-zero. */ @@ -1198,7 +1198,7 @@ Index: gdb-6.8.50.20090811/gdb/symfile.c { /* We will modify the main symbol table, make sure that all its users will be cleaned up if an error occurs during symbol reading. */ -@@ -814,7 +815,7 @@ syms_from_objfile (struct objfile *objfi +@@ -807,7 +808,7 @@ syms_from_objfile (struct objfile *objfi We no longer warn if the lowest section is not a text segment (as happens for the PA64 port. */ @@ -1207,7 +1207,7 @@ Index: gdb-6.8.50.20090811/gdb/symfile.c { asection *lower_sect; asection *sect; -@@ -897,7 +898,7 @@ syms_from_objfile (struct objfile *objfi +@@ -890,7 +891,7 @@ syms_from_objfile (struct objfile *objfi init_objfile_sect_indices (objfile); } @@ -1216,7 +1216,7 @@ Index: gdb-6.8.50.20090811/gdb/symfile.c /* Discard cleanups as symbol reading was successful. */ -@@ -916,17 +917,22 @@ new_symfile_objfile (struct objfile *obj +@@ -909,17 +910,22 @@ new_symfile_objfile (struct objfile *obj /* If this is the main symbol file we have to clean up all users of the old main symbol file. Otherwise it is sufficient to fixup all the breakpoints that may have been redefined by this symbol file. */ @@ -1241,7 +1241,7 @@ Index: gdb-6.8.50.20090811/gdb/symfile.c /* We're done reading the symbol file; finish off complaints. */ clear_complaints (&symfile_complaints, 0, add_flags & SYMFILE_VERBOSE); -@@ -980,7 +986,7 @@ symbol_file_add_with_addrs_or_offsets (b +@@ -973,7 +979,7 @@ symbol_file_add_with_addrs_or_offsets (b /* Give user a chance to burp if we'd be interactively wiping out any existing symbols. */ @@ -1250,7 +1250,7 @@ Index: gdb-6.8.50.20090811/gdb/symfile.c && (have_full_symbols () || have_partial_symbols ()) && from_tty && (have_full_symbols () || have_partial_symbols ()) -@@ -1181,6 +1187,9 @@ symbol_file_clear (int from_tty) +@@ -1162,6 +1168,9 @@ symbol_file_clear (int from_tty) symfile_objfile->name) : !query (_("Discard symbol table? ")))) error (_("Not confirmed.")); @@ -1260,7 +1260,7 @@ Index: gdb-6.8.50.20090811/gdb/symfile.c free_all_objfiles (); -@@ -3385,6 +3394,8 @@ reread_symbols (void) +@@ -3369,6 +3378,8 @@ reread_symbols (void) /* Discard cleanups as symbol reading was successful. */ discard_cleanups (old_cleanups); @@ -1269,11 +1269,11 @@ Index: gdb-6.8.50.20090811/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.20090811/gdb/target.h +Index: gdb-6.8.50.20090909/gdb/target.h =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/target.h 2009-08-12 06:18:03.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/target.h 2009-08-12 06:18:15.000000000 +0200 -@@ -524,7 +524,7 @@ struct target_ops +--- 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 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.20090811/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.20090811/gdb/symfile.h +Index: gdb-6.8.50.20090909/gdb/symfile.h =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/symfile.h 2009-08-12 06:13:20.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/symfile.h 2009-08-12 06:18:15.000000000 +0200 +--- 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 @@ -229,7 +229,13 @@ enum symfile_add_flags SYMFILE_MAINLINE = 1 << 2, @@ -1301,11 +1301,11 @@ Index: gdb-6.8.50.20090811/gdb/symfile.h }; extern void syms_from_objfile (struct objfile *, -Index: gdb-6.8.50.20090811/gdb/infcmd.c +Index: gdb-6.8.50.20090909/gdb/infcmd.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/infcmd.c 2009-08-12 06:09:14.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/infcmd.c 2009-08-12 06:47:58.000000000 +0200 -@@ -2276,6 +2276,9 @@ attach_command_post_wait (char *args, in +--- 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 +@@ -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.20090811/gdb/infcmd.c /* Install inferior's terminal modes. */ target_terminal_inferior (); -Index: gdb-6.8.50.20090811/gdb/linux-tdep.c +Index: gdb-6.8.50.20090909/gdb/linux-tdep.c =================================================================== ---- gdb-6.8.50.20090811.orig/gdb/linux-tdep.c 2009-08-04 22:41:13.000000000 +0200 -+++ gdb-6.8.50.20090811/gdb/linux-tdep.c 2009-08-12 06:43:27.000000000 +0200 +--- 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 @@ -163,5 +163,7 @@ in this session.\n")); void _initialize_linux_tdep (void) diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index d9c5148..6ba24a0 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -1,7 +1,7 @@ -Index: gdb-6.8.50.20090802/gdb/testsuite/configure.ac +Index: gdb-6.8.50.20090909/gdb/testsuite/configure.ac =================================================================== ---- gdb-6.8.50.20090802.orig/gdb/testsuite/configure.ac 2009-07-31 17:38:16.000000000 +0200 -+++ gdb-6.8.50.20090802/gdb/testsuite/configure.ac 2009-08-03 11:10:45.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/testsuite/configure.ac 2009-07-31 17:38:16.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/configure.ac 2009-09-09 19:06:01.000000000 +0200 @@ -144,6 +144,6 @@ AC_OUTPUT([Makefile \ gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ gdb.fortran/Makefile gdb.server/Makefile \ @@ -10,31 +10,31 @@ Index: gdb-6.8.50.20090802/gdb/testsuite/configure.ac + gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \ gdb.python/Makefile gdb.reverse/Makefile \ gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile]) -Index: gdb-6.8.50.20090802/gdb/testsuite/configure +Index: gdb-6.8.50.20090909/gdb/testsuite/configure =================================================================== ---- gdb-6.8.50.20090802.orig/gdb/testsuite/configure 2009-07-31 17:38:16.000000000 +0200 -+++ gdb-6.8.50.20090802/gdb/testsuite/configure 2009-08-03 11:11:27.000000000 +0200 -@@ -3239,7 +3239,7 @@ done +--- gdb-6.8.50.20090909.orig/gdb/testsuite/configure 2009-08-22 18:56:43.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/configure 2009-09-09 19:06:27.000000000 +0200 +@@ -3515,7 +3515,7 @@ done -- ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" -+ ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" +-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" ++ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure - # tests run on this system so they can be shared between configure -@@ -3813,6 +3813,7 @@ do - "gdb.objc/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;; - "gdb.opt/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;; - "gdb.pascal/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;; -+ "gdb.pie/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;; - "gdb.python/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;; - "gdb.reverse/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;; - "gdb.threads/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;; -Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/attach.c +@@ -4231,6 +4231,7 @@ do + "gdb.objc/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;; + "gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;; + "gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;; ++ "gdb.pie/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;; + "gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;; + "gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;; + "gdb.threads/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;; +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/attach.c 2009-08-03 11:10:12.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c 2009-09-09 19:06:01.000000000 +0200 @@ -0,0 +1,20 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -56,10 +56,10 @@ Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/attach.c + } + return 0; +} -Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/attach2.c +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/attach2.c 2009-08-03 11:10:12.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c 2009-09-09 19:06:01.000000000 +0200 @@ -0,0 +1,24 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -85,10 +85,10 @@ Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/attach2.c + } + return (0); +} -Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/break.c +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/break.c 2009-08-03 11:10:12.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c 2009-09-09 19:06:01.000000000 +0200 @@ -0,0 +1,146 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -236,10 +236,10 @@ Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/break.c + } + return 0; +} -Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/break1.c +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/break1.c 2009-08-03 11:10:12.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c 2009-09-09 19:06:01.000000000 +0200 @@ -0,0 +1,44 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -285,10 +285,10 @@ Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/break1.c +void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ +void marker4 (d) long d; {} /* set breakpoint 13 here */ +#endif -Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/coremaker.c +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/coremaker.c 2009-08-03 11:10:12.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c 2009-09-09 19:06:01.000000000 +0200 @@ -0,0 +1,142 @@ +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 + Free Software Foundation, Inc. @@ -432,10 +432,10 @@ Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/coremaker.c + return 0; +} + -Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/attach.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/attach.exp 2009-08-03 11:10:12.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp 2009-09-09 19:06:01.000000000 +0200 @@ -0,0 +1,432 @@ +# Copyright 1997, 1999, 2002 Free Software Foundation, Inc. + @@ -869,10 +869,10 @@ Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/attach.exp +do_call_attach_tests + +return 0 -Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/break.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/break.exp 2009-08-03 11:10:12.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp 2009-09-09 19:06:01.000000000 +0200 @@ -0,0 +1,977 @@ +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2002, 2003, 2004 @@ -1851,10 +1851,10 @@ Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/break.exp + send_gdb "set args main\n" + gdb_expect -re ".*$gdb_prompt $" {} +} -Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/corefile.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/corefile.exp 2009-08-03 11:10:12.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp 2009-09-09 19:06:01.000000000 +0200 @@ -0,0 +1,243 @@ +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. @@ -2099,10 +2099,10 @@ Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/corefile.exp +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp (reinit)" + +gdb_test "core" "No core file now." -Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/Makefile.in +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090802/gdb/testsuite/gdb.pie/Makefile.in 2009-08-03 11:10:12.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in 2009-09-09 19:06:01.000000000 +0200 @@ -0,0 +1,19 @@ +VPATH = @srcdir@ +srcdir = @srcdir@ diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 3d7aaf1..32cbca3 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1,7 +1,7 @@ -Index: gdb-6.8.50.20090803/gdb/event-top.c +Index: gdb-6.8.50.20090909/gdb/event-top.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/event-top.c 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/event-top.c 2009-08-03 16:17:59.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/event-top.c 2009-09-09 20:05:48.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/event-top.c 2009-09-09 20:08:04.000000000 +0200 @@ -33,6 +33,7 @@ #include "cli/cli-script.h" /* for reset_command_nest_depth */ #include "main.h" @@ -28,11 +28,11 @@ Index: gdb-6.8.50.20090803/gdb/event-top.c /* Each interpreter has its own rules on displaying the command prompt. */ if (!current_interp_display_prompt_p ()) -Index: gdb-6.8.50.20090803/gdb/symfile.c +Index: gdb-6.8.50.20090909/gdb/symfile.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/symfile.c 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/symfile.c 2009-08-03 16:17:59.000000000 +0200 -@@ -56,6 +56,7 @@ +--- gdb-6.8.50.20090909.orig/gdb/symfile.c 2009-09-09 20:08:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/symfile.c 2009-09-09 20:08:04.000000000 +0200 +@@ -57,6 +57,7 @@ #include "solib.h" #include "remote.h" #include "libbfd.h" @@ -40,7 +40,7 @@ Index: gdb-6.8.50.20090803/gdb/symfile.c #include #include -@@ -64,6 +65,7 @@ +@@ -65,6 +66,7 @@ #include #include #include @@ -48,7 +48,7 @@ Index: gdb-6.8.50.20090803/gdb/symfile.c int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num); -@@ -1692,8 +1694,352 @@ build_id_to_filename (struct build_id *b +@@ -1673,8 +1675,352 @@ build_id_to_filename (struct build_id *b return retval; } @@ -402,7 +402,7 @@ Index: gdb-6.8.50.20090803/gdb/symfile.c avoidance. */ struct missing_filepair -@@ -1747,11 +2093,17 @@ missing_filepair_change (void) +@@ -1728,11 +2074,17 @@ missing_filepair_change (void) /* All their memory came just from missing_filepair_OBSTACK. */ missing_filepair_hash = NULL; } @@ -420,7 +420,7 @@ Index: gdb-6.8.50.20090803/gdb/symfile.c missing_filepair_change (); } -@@ -1818,14 +2170,33 @@ debug_print_missing (const char *binary, +@@ -1799,14 +2151,33 @@ debug_print_missing (const char *binary, *slot = missing_filepair; @@ -461,11 +461,11 @@ Index: gdb-6.8.50.20090803/gdb/symfile.c } static char * -Index: gdb-6.8.50.20090803/gdb/symfile.h +Index: gdb-6.8.50.20090909/gdb/symfile.h =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/symfile.h 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/symfile.h 2009-08-03 16:17:59.000000000 +0200 -@@ -394,6 +394,7 @@ extern struct build_id *build_id_addr_ge +--- gdb-6.8.50.20090909.orig/gdb/symfile.h 2009-09-09 20:08:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/symfile.h 2009-09-09 20:08:04.000000000 +0200 +@@ -387,6 +387,7 @@ extern struct build_id *build_id_addr_ge extern char *build_id_to_filename (struct build_id *build_id, char **link_return, int add_debug_suffix); extern void debug_print_missing (const char *binary, const char *debug); @@ -473,10 +473,10 @@ Index: gdb-6.8.50.20090803/gdb/symfile.h /* From dwarf2read.c */ -Index: gdb-6.8.50.20090803/gdb/testsuite/lib/gdb.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/testsuite/lib/gdb.exp 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/testsuite/lib/gdb.exp 2009-08-03 16:17:59.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/gdb.exp 2009-09-09 20:08:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp 2009-09-09 20:08:04.000000000 +0200 @@ -1248,7 +1248,7 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } @@ -486,10 +486,10 @@ Index: gdb-6.8.50.20090803/gdb/testsuite/lib/gdb.exp send_gdb "set build-id-verbose 0\n" gdb_expect 10 { -re "$gdb_prompt $" { -Index: gdb-6.8.50.20090803/gdb/testsuite/lib/mi-support.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/testsuite/lib/mi-support.exp 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/testsuite/lib/mi-support.exp 2009-08-03 16:17:59.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/mi-support.exp 2009-09-09 20:08:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp 2009-09-09 20:08:04.000000000 +0200 @@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } { } } @@ -499,10 +499,10 @@ Index: gdb-6.8.50.20090803/gdb/testsuite/lib/mi-support.exp send_gdb "190-gdb-set build-id-verbose 0\n" gdb_expect 10 { -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" { -Index: gdb-6.8.50.20090803/gdb/tui/tui-interp.c +Index: gdb-6.8.50.20090909/gdb/tui/tui-interp.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/tui/tui-interp.c 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/tui/tui-interp.c 2009-08-03 16:17:59.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/tui/tui-interp.c 2009-09-09 20:05:48.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/tui/tui-interp.c 2009-09-09 20:08:04.000000000 +0200 @@ -30,6 +30,7 @@ #include "tui/tui.h" #include "tui/tui-io.h" @@ -520,13 +520,13 @@ Index: gdb-6.8.50.20090803/gdb/tui/tui-interp.c /* Tell readline what the prompt to display is and what function it will need to call after a whole line is read. This also displays the first prompt. */ -Index: gdb-6.8.50.20090803/gdb/aclocal.m4 +Index: gdb-6.8.50.20090909/gdb/aclocal.m4 =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/aclocal.m4 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/aclocal.m4 2009-08-03 16:19:22.000000000 +0200 -@@ -11,6 +11,162 @@ - # even the implied warranty of MERCHANTABILITY or FITNESS FOR A - # PARTICULAR PURPOSE. +--- gdb-6.8.50.20090909.orig/gdb/aclocal.m4 2009-09-09 20:05:48.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/aclocal.m4 2009-09-09 20:09:32.000000000 +0200 +@@ -19,6 +19,162 @@ You have another version of autoconf. I + If you have problems, you may need to regenerate the build system entirely. + To do so, use the procedure documented by the package, typically `autoreconf'.])]) +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# @@ -684,14 +684,14 @@ Index: gdb-6.8.50.20090803/gdb/aclocal.m4 +fi[]dnl +])# PKG_CHECK_MODULES + - # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. + # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation -Index: gdb-6.8.50.20090803/gdb/config.in +Index: gdb-6.8.50.20090909/gdb/config.in =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/config.in 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/config.in 2009-08-03 16:17:59.000000000 +0200 -@@ -39,6 +39,9 @@ +--- gdb-6.8.50.20090909.orig/gdb/config.in 2009-09-09 20:08:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/config.in 2009-09-09 20:08:04.000000000 +0200 +@@ -42,6 +42,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC @@ -701,7 +701,7 @@ Index: gdb-6.8.50.20090803/gdb/config.in /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -218,6 +221,9 @@ +@@ -221,6 +224,9 @@ /* Define if Python 2.6 is being used. */ #undef HAVE_LIBPYTHON2_6 @@ -711,58 +711,58 @@ Index: gdb-6.8.50.20090803/gdb/config.in /* Define if libunwind library is being used. */ #undef HAVE_LIBUNWIND -Index: gdb-6.8.50.20090803/gdb/configure +Index: gdb-6.8.50.20090909/gdb/configure =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/configure 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/configure 2009-08-03 16:20:09.000000000 +0200 -@@ -314,7 +314,7 @@ ac_subdirs_all="$ac_subdirs_all doc test - ac_subdirs_all="$ac_subdirs_all gdbtk" - ac_subdirs_all="$ac_subdirs_all multi-ice" - ac_subdirs_all="$ac_subdirs_all gdbserver" --ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE DEBUGDIR GDB_DATADIR GDB_DATADIR_PATH pythondir subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE SYSTEM_GDBINIT WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags GDB_NM_FILE datarootdir docdir htmldir pdfdir LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS' -+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE DEBUGDIR GDB_DATADIR GDB_DATADIR_PATH pythondir PKG_CONFIG ac_pt_PKG_CONFIG RPM_CFLAGS RPM_LIBS subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE SYSTEM_GDBINIT WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags GDB_NM_FILE datarootdir docdir htmldir pdfdir LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS' - ac_subst_files='host_makefile_frag' - ac_pwd=`pwd` - -@@ -776,6 +776,18 @@ ac_env_CPP_set=${CPP+set} - ac_env_CPP_value=$CPP - ac_cv_env_CPP_set=${CPP+set} - ac_cv_env_CPP_value=$CPP -+ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} -+ac_env_PKG_CONFIG_value=$PKG_CONFIG -+ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} -+ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG -+ac_env_RPM_CFLAGS_set=${RPM_CFLAGS+set} -+ac_env_RPM_CFLAGS_value=$RPM_CFLAGS -+ac_cv_env_RPM_CFLAGS_set=${RPM_CFLAGS+set} -+ac_cv_env_RPM_CFLAGS_value=$RPM_CFLAGS -+ac_env_RPM_LIBS_set=${RPM_LIBS+set} -+ac_env_RPM_LIBS_value=$RPM_LIBS -+ac_cv_env_RPM_LIBS_set=${RPM_LIBS+set} -+ac_cv_env_RPM_LIBS_value=$RPM_LIBS - - # - # Report the --help message. -@@ -895,6 +907,8 @@ Optional Packages: +--- gdb-6.8.50.20090909.orig/gdb/configure 2009-09-09 20:08:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/configure 2009-09-09 20:09:35.000000000 +0200 +@@ -676,6 +676,9 @@ REPORT_BUGS_TO + PKGVERSION + TARGET_OBS + subdirs ++RPM_LIBS ++RPM_CFLAGS ++PKG_CONFIG + pythondir + GDB_DATADIR_PATH + GDB_DATADIR +@@ -886,6 +889,7 @@ with_separate_debug_dir + with_gdb_datadir + with_relocated_sources + with_pythondir ++with_rpm + enable_targets + enable_64_bit_bfd + enable_gdbcli +@@ -925,6 +929,9 @@ LDFLAGS + LIBS + CPPFLAGS + CPP ++PKG_CONFIG ++RPM_CFLAGS ++RPM_LIBS + YACC + YFLAGS + XMKMF' +@@ -1588,6 +1595,8 @@ Optional Packages: [DATADIR/gdb] --with-pythondir install Python data files in this path [DATADIR/gdb/python] -+ --with-rpm query rpm database for missing debuginfos -+ [yes/no,], [def.], [auto=librpm.so] ++ --with-rpm query rpm database for missing debuginfos (yes/no, ++ def. auto=librpm.so) --with-libunwind use libunwind frame unwinding support --with-curses use the curses library instead of the termcap library -@@ -932,6 +946,9 @@ Some influential environment variables: - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory +@@ -1621,6 +1630,9 @@ Some influential environment variables: + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor + PKG_CONFIG path to pkg-config utility + RPM_CFLAGS C compiler flags for RPM, overriding pkg-config + RPM_LIBS linker flags for RPM, overriding pkg-config - - Use these variables to override the choices made by `configure' or to help - it to find libraries and programs with nonstandard names/locations. -@@ -7290,6 +7307,559 @@ _ACEOF + YACC The `Yet Another C Compiler' implementation to use. Defaults to + the first program found out of: `bison -y', `byacc', `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. +@@ -6675,6 +6687,486 @@ _ACEOF fi @@ -783,13 +783,13 @@ Index: gdb-6.8.50.20090803/gdb/configure +# cannot find librpm use to the rpmless compilation (like `--without-rpm'). + + -+# Check whether --with-rpm or --without-rpm was given. -+if test "${with_rpm+set}" = set; then -+ withval="$with_rpm" -+ ++# Check whether --with-rpm was given. ++if test "${with_rpm+set}" = set; then : ++ withval=$with_rpm; +else + with_rpm="auto" -+fi; ++fi ++ + + + @@ -809,25 +809,18 @@ Index: gdb-6.8.50.20090803/gdb/configure + fi + LIBRPM_STRING='"'"$LIBRPM"'"' + -+ echo "$as_me:$LINENO: checking specific librpm version" >&5 -+echo $ECHO_N "checking specific librpm version... $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5 ++$as_echo_n "checking specific librpm version... " >&6; } + HAVE_DLOPEN_LIBRPM=false + save_LIBS="$LIBS" + LIBS="$LIBS -ldl" -+ if test "$cross_compiling" = yes; then -+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -+echo "$as_me: error: in \`$ac_pwd':" >&2;} -+{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -+See \`config.log' for more details." >&5 -+echo "$as_me: error: cannot run test program while cross compiling -+See \`config.log' for more details." >&2;} -+ { (exit 1); exit 1; }; }; } ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error "cannot run test program while cross compiling ++See \`config.log' for more details." "$LINENO" 5; } +else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include @@ -910,49 +903,32 @@ Index: gdb-6.8.50.20090803/gdb/configure + return 0; +} +_ACEOF -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then ++if ac_fn_c_try_run "$LINENO"; then : + + DLOPEN_LIBRPM="`cat conftest.out`" + if test "x$DLOPEN_LIBRPM" != "x"; then + HAVE_DLOPEN_LIBRPM=true -+ echo "$as_me:$LINENO: result: $DLOPEN_LIBRPM" >&5 -+echo "${ECHO_T}$DLOPEN_LIBRPM" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5 ++$as_echo "$DLOPEN_LIBRPM" >&6; } + fi + -+else -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi + -+fi -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi + rm -f conftest.out + + + + if $HAVE_DLOPEN_LIBRPM; then + -+ echo "$as_me:$LINENO: checking rpm library API compatibility" >&5 -+echo $ECHO_N "checking rpm library API compatibility... $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5 ++$as_echo_n "checking rpm library API compatibility... " >&6; } + # The compilation requires -Werror to verify anything. + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Duplicate here the declarations to verify they match "symfile.c". */ @@ -977,44 +953,20 @@ Index: gdb-6.8.50.20090803/gdb/configure + return 0; +} +_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then ++if ac_fn_c_try_compile "$LINENO"; then : + + LIBRPM_COMPAT=true -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + +else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ + + LIBRPM_COMPAT=false -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + +fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if ! $LIBRPM_COMPAT; then @@ -1030,18 +982,14 @@ Index: gdb-6.8.50.20090803/gdb/configure +_ACEOF + + -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_LIBRPM 1 -+_ACEOF ++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h + + else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + LIBS="$save_LIBS" + if $DLOPEN_REQUIRE; then -+ { { echo "$as_me:$LINENO: error: Specific name $LIBRPM was requested but it could not be opened." >&5 -+echo "$as_me: error: Specific name $LIBRPM was requested but it could not be opened." >&2;} -+ { (exit 1); exit 1; }; } ++ as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5 + fi + + @@ -1049,10 +997,10 @@ Index: gdb-6.8.50.20090803/gdb/configure + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : ++ $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) @@ -1064,37 +1012,38 @@ Index: gdb-6.8.50.20090803/gdb/configure +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done -+done ++ done ++IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG -+ +if test -n "$PKG_CONFIG"; then -+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -+echo "${ECHO_T}$PKG_CONFIG" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 ++$as_echo "$PKG_CONFIG" >&6; } +else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } +fi + ++ +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : ++ $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) @@ -1106,29 +1055,39 @@ Index: gdb-6.8.50.20090803/gdb/configure +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done -+done ++ done ++IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -+ +if test -n "$ac_pt_PKG_CONFIG"; then -+ echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 ++$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } +fi + -+ PKG_CONFIG=$ac_pt_PKG_CONFIG ++ if test "x$ac_pt_PKG_CONFIG" = x; then ++ PKG_CONFIG="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ PKG_CONFIG=$ac_pt_PKG_CONFIG ++ fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi @@ -1136,32 +1095,32 @@ Index: gdb-6.8.50.20090803/gdb/configure +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 -+ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 ++$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +fi + +pkg_failed=no -+echo "$as_me:$LINENO: checking for RPM" >&5 -+echo $ECHO_N "checking for RPM... $ECHO_C" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5 ++$as_echo_n "checking for RPM... " >&6; } + +if test -n "$RPM_CFLAGS"; then + pkg_cv_RPM_CFLAGS="$RPM_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ -+ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"rpm\"") >&5 ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5 + ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then + pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null` +else + pkg_failed=yes @@ -1173,11 +1132,11 @@ Index: gdb-6.8.50.20090803/gdb/configure + pkg_cv_RPM_LIBS="$RPM_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ -+ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"rpm\"") >&5 ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "rpm") 2>&5 + ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; then ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then + pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null` +else + pkg_failed=yes @@ -1203,31 +1162,27 @@ Index: gdb-6.8.50.20090803/gdb/configure + # Put the nasty error message in config.log where it belongs + echo "$RPM_PKG_ERRORS" >&5 + -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + HAVE_LIBRPM=false +elif test $pkg_failed = untried; then + HAVE_LIBRPM=false +else + RPM_CFLAGS=$pkg_cv_RPM_CFLAGS + RPM_LIBS=$pkg_cv_RPM_LIBS -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + HAVE_LIBRPM=true +fi + + if $HAVE_LIBRPM; then + -+ echo "$as_me:$LINENO: checking rpm library API compatibility" >&5 -+echo $ECHO_N "checking rpm library API compatibility... $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5 ++$as_echo_n "checking rpm library API compatibility... " >&6; } + # The compilation requires -Werror to verify anything. + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Duplicate here the declarations to verify they match "symfile.c". */ @@ -1252,44 +1207,20 @@ Index: gdb-6.8.50.20090803/gdb/configure + return 0; +} +_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then ++if ac_fn_c_try_compile "$LINENO"; then : + + LIBRPM_COMPAT=true -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + +else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ + + LIBRPM_COMPAT=false -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } + +fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + + if ! $LIBRPM_COMPAT; then @@ -1300,20 +1231,16 @@ Index: gdb-6.8.50.20090803/gdb/configure + + if $HAVE_LIBRPM; then + -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_LIBRPM 1 -+_ACEOF ++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h + + CFLAGS="$CFLAGS $RPM_CFLAGS" + LIBS="$LIBS $RPM_LIBS" + else + if $RPM_REQUIRE; then -+ { { echo "$as_me:$LINENO: error: $RPM_PKG_ERRORS" >&5 -+echo "$as_me: error: $RPM_PKG_ERRORS" >&2;} -+ { (exit 1); exit 1; }; } ++ as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5 + else -+ { echo "$as_me:$LINENO: WARNING: $RPM_PKG_ERRORS" >&5 -+echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5 ++$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;} + fi + fi + fi @@ -1322,22 +1249,287 @@ Index: gdb-6.8.50.20090803/gdb/configure -@@ -22513,6 +23083,10 @@ s,@DEBUGDIR@,$DEBUGDIR,;t t - s,@GDB_DATADIR@,$GDB_DATADIR,;t t - s,@GDB_DATADIR_PATH@,$GDB_DATADIR_PATH,;t t - s,@pythondir@,$pythondir,;t t -+s,@PKG_CONFIG@,$PKG_CONFIG,;t t -+s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t -+s,@RPM_CFLAGS@,$RPM_CFLAGS,;t t -+s,@RPM_LIBS@,$RPM_LIBS,;t t - s,@subdirs@,$subdirs,;t t - s,@TARGET_OBS@,$TARGET_OBS,;t t - s,@PKGVERSION@,$PKGVERSION,;t t -Index: gdb-6.8.50.20090803/gdb/configure.ac +@@ -9721,265 +10213,25 @@ $as_echo "#define STDC_HEADERS 1" >>conf + + fi + +- +- + for ac_header in sys/user32.h sys/procfs32.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +-else +- # Is the header compilable? +-echo "$as_me:$LINENO: checking $ac_header usability" >&5 +-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +-#include <$ac_header> +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_header_compiler=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_header_compiler=no +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +-echo "${ECHO_T}$ac_header_compiler" >&6 +- +-# Is the header present? +-echo "$as_me:$LINENO: checking $ac_header presence" >&5 +-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <$ac_header> +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- ac_header_preproc=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_preproc=no +-fi +-rm -f conftest.err conftest.$ac_ext +-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +-echo "${ECHO_T}$ac_header_preproc" >&6 +- +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in +- yes:no: ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} +- ac_header_preproc=yes +- ;; +- no:yes:* ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +- ( +- cat <<\_ASBOX +-## ------------------------------------------ ## +-## Report this to the AC_PACKAGE_NAME lists. ## +-## ------------------------------------------ ## +-_ASBOX +- ) | +- sed "s/^/$as_me: WARNING: /" >&2 +- ;; +-esac +-echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- eval "$as_ac_Header=\$ac_header_preproc" +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +- +-fi +-if test `eval echo '${'$as_ac_Header'}'` = yes; then ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF + + fi + + done + +-echo "$as_me:$LINENO: checking for struct elf_prstatus32.pr_reg" >&5 +-echo $ECHO_N "checking for struct elf_prstatus32.pr_reg... $ECHO_C" >&6 +-if test "${ac_cv_member_struct_elf_prstatus32_pr_reg+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include +- +-int +-main () +-{ +-static struct elf_prstatus32 ac_aggr; +-if (ac_aggr.pr_reg) +-return 0; +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_member_struct_elf_prstatus32_pr_reg=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include +- +-int +-main () +-{ +-static struct elf_prstatus32 ac_aggr; +-if (sizeof ac_aggr.pr_reg) +-return 0; +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_member_struct_elf_prstatus32_pr_reg=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_cv_member_struct_elf_prstatus32_pr_reg=no +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-echo "$as_me:$LINENO: result: $ac_cv_member_struct_elf_prstatus32_pr_reg" >&5 +-echo "${ECHO_T}$ac_cv_member_struct_elf_prstatus32_pr_reg" >&6 +-if test $ac_cv_member_struct_elf_prstatus32_pr_reg = yes; then ++ac_fn_c_check_member "$LINENO" "struct elf_prstatus32" "pr_reg" "ac_cv_member_struct_elf_prstatus32_pr_reg" "#include ++" ++if test "x$ac_cv_member_struct_elf_prstatus32_pr_reg" = x""yes; then : + +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_ELF_PRSTATUS32 1 +-_ACEOF ++$as_echo "#define HAVE_ELF_PRSTATUS32 1" >>confdefs.h + + fi + +Index: gdb-6.8.50.20090909/gdb/configure.ac =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/configure.ac 2009-08-03 16:17:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/configure.ac 2009-08-03 16:17:59.000000000 +0200 -@@ -153,6 +153,199 @@ else +--- gdb-6.8.50.20090909.orig/gdb/configure.ac 2009-09-09 20:08:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/configure.ac 2009-09-09 20:08:04.000000000 +0200 +@@ -151,6 +151,199 @@ else fi AC_SUBST(pythondir) @@ -1359,7 +1551,7 @@ Index: gdb-6.8.50.20090803/gdb/configure.ac + +AC_ARG_WITH([rpm], + [AS_HELP_STRING([--with-rpm], -+ [query rpm database for missing debuginfos [yes/no, def. auto=librpm.so]])], [], [with_rpm="auto"]) ++ [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"]) + +m4_pattern_allow([^AC_MSG_ERROR$]) +m4_pattern_allow([^AC_MSG_WARN$]) @@ -1537,3 +1729,22 @@ Index: gdb-6.8.50.20090803/gdb/configure.ac AC_CONFIG_SUBDIRS(doc testsuite) +Index: gdb-6.8.50.20090909/gdb/acinclude.m4 +=================================================================== +--- gdb-6.8.50.20090909.orig/gdb/acinclude.m4 2009-09-09 20:05:48.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/acinclude.m4 2009-09-09 20:08:04.000000000 +0200 +@@ -1,3 +1,5 @@ ++# serial 1 ++ + dnl written by Rob Savoye for Cygnus Support + dnl major rewriting for Tcl 7.5 by Don Libes + +@@ -79,8 +81,6 @@ AC_MSG_RESULT(yes) + # Foundation, Inc., 51 Franklin Street, Fifth Floor, + # Boston, MA 02110-1301, USA. + +-# serial 1 +- + # @defmac AC_PROG_CC_STDC + # @maindex PROG_CC_STDC + # @ovindex CC diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index bde8cde..996465d 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -1,7 +1,7 @@ -Index: gdb-6.8.50.20090818/gdb/corelow.c +Index: gdb-6.8.50.20090909/gdb/corelow.c =================================================================== ---- gdb-6.8.50.20090818.orig/gdb/corelow.c 2009-07-31 17:25:21.000000000 +0200 -+++ gdb-6.8.50.20090818/gdb/corelow.c 2009-08-18 21:07:23.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/corelow.c 2009-07-31 17:25:21.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/corelow.c 2009-09-09 19:09:35.000000000 +0200 @@ -45,6 +45,10 @@ #include "exceptions.h" #include "solib.h" @@ -89,11 +89,11 @@ Index: gdb-6.8.50.20090818/gdb/corelow.c + NULL, NULL, NULL, + &setlist, &showlist); } -Index: gdb-6.8.50.20090818/gdb/doc/gdb.texinfo +Index: gdb-6.8.50.20090909/gdb/doc/gdb.texinfo =================================================================== ---- gdb-6.8.50.20090818.orig/gdb/doc/gdb.texinfo 2009-08-18 21:07:05.000000000 +0200 -+++ gdb-6.8.50.20090818/gdb/doc/gdb.texinfo 2009-08-18 21:07:23.000000000 +0200 -@@ -13733,6 +13733,27 @@ information files. +--- gdb-6.8.50.20090909.orig/gdb/doc/gdb.texinfo 2009-09-09 19:09:31.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/doc/gdb.texinfo 2009-09-09 19:09:35.000000000 +0200 +@@ -13764,6 +13764,27 @@ information files. @end table @@ -121,10 +121,10 @@ Index: gdb-6.8.50.20090818/gdb/doc/gdb.texinfo @cindex @code{.gnu_debuglink} sections @cindex debug link sections A debug link is a special section of the executable file named -Index: gdb-6.8.50.20090818/gdb/solib-svr4.c +Index: gdb-6.8.50.20090909/gdb/solib-svr4.c =================================================================== ---- gdb-6.8.50.20090818.orig/gdb/solib-svr4.c 2009-08-18 21:07:04.000000000 +0200 -+++ gdb-6.8.50.20090818/gdb/solib-svr4.c 2009-08-18 21:07:23.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/solib-svr4.c 2009-09-09 19:05:56.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/solib-svr4.c 2009-09-09 19:09:35.000000000 +0200 @@ -1101,9 +1101,33 @@ svr4_current_sos (void) safe_strerror (errcode)); else @@ -162,10 +162,10 @@ Index: gdb-6.8.50.20090818/gdb/solib-svr4.c } xfree (buffer); -Index: gdb-6.8.50.20090818/gdb/symfile.c +Index: gdb-6.8.50.20090909/gdb/symfile.c =================================================================== ---- gdb-6.8.50.20090818.orig/gdb/symfile.c 2009-08-18 21:07:05.000000000 +0200 -+++ gdb-6.8.50.20090818/gdb/symfile.c 2009-08-18 21:08:31.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/symfile.c 2009-09-09 19:09:31.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/symfile.c 2009-09-09 19:09:55.000000000 +0200 @@ -56,6 +56,7 @@ #include "elf-bfd.h" #include "solib.h" @@ -174,7 +174,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c #include #include -@@ -1193,16 +1194,65 @@ symbol_file_clear (int from_tty) +@@ -1174,16 +1175,65 @@ symbol_file_clear (int from_tty) printf_unfiltered (_("No symbol file now.\n")); } @@ -242,7 +242,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c { struct build_id *retval; -@@ -1218,6 +1268,348 @@ build_id_bfd_get (bfd *abfd) +@@ -1199,6 +1249,348 @@ build_id_bfd_get (bfd *abfd) return retval; } @@ -591,7 +591,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c /* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */ static int -@@ -1235,7 +1627,7 @@ build_id_verify (const char *filename, s +@@ -1216,7 +1608,7 @@ build_id_verify (const char *filename, s if (abfd == NULL) return 0; @@ -600,7 +600,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c if (found == NULL) warning (_("File \"%s\" has no build-id, file skipped"), filename); -@@ -1254,8 +1646,9 @@ build_id_verify (const char *filename, s +@@ -1235,8 +1627,9 @@ build_id_verify (const char *filename, s return retval; } @@ -612,7 +612,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c { char *link, *s, *retval = NULL; gdb_byte *data = build_id->data; -@@ -1263,7 +1656,9 @@ build_id_to_debug_filename (struct build +@@ -1244,7 +1637,9 @@ build_id_to_debug_filename (struct build /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */ link = xmalloc (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1 @@ -623,7 +623,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c s = link + sprintf (link, "%s/.build-id/", debug_file_directory); if (size > 0) { -@@ -1274,12 +1669,14 @@ build_id_to_debug_filename (struct build +@@ -1255,12 +1650,14 @@ build_id_to_debug_filename (struct build *s++ = '/'; while (size-- > 0) s += sprintf (s, "%02x", (unsigned) *data++); @@ -640,7 +640,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c if (retval != NULL && !build_id_verify (retval, build_id)) { -@@ -1287,9 +1684,150 @@ build_id_to_debug_filename (struct build +@@ -1268,9 +1665,150 @@ build_id_to_debug_filename (struct build retval = NULL; } @@ -791,7 +791,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c static char * get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out) { -@@ -1372,32 +1910,36 @@ static char * +@@ -1353,32 +1891,36 @@ static char * find_separate_debug_file (struct objfile *objfile) { asection *sect; @@ -836,7 +836,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c } basename = get_debug_link_info (objfile, &crc32); -@@ -1405,7 +1947,7 @@ find_separate_debug_file (struct objfile +@@ -1386,7 +1928,7 @@ find_separate_debug_file (struct objfile if (basename == NULL) /* There's no separate debug info, hence there's no way we could load it => no warning. */ @@ -845,7 +845,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c dir = xstrdup (objfile->name); -@@ -1427,24 +1969,19 @@ find_separate_debug_file (struct objfile +@@ -1408,24 +1950,19 @@ find_separate_debug_file (struct objfile if (canon_name && strlen (canon_name) > i) i = strlen (canon_name); @@ -877,7 +877,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c /* Then try in the subdirectory named DEBUG_SUBDIRECTORY. */ strcpy (debugfile, dir); -@@ -1453,12 +1990,7 @@ find_separate_debug_file (struct objfile +@@ -1434,12 +1971,7 @@ find_separate_debug_file (struct objfile strcat (debugfile, basename); if (separate_debug_file_exists (debugfile, crc32, objfile->name)) @@ -891,7 +891,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c /* Then try in the global debugfile directory. */ strcpy (debugfile, debug_file_directory); -@@ -1467,12 +1999,7 @@ find_separate_debug_file (struct objfile +@@ -1448,12 +1980,7 @@ find_separate_debug_file (struct objfile strcat (debugfile, basename); if (separate_debug_file_exists (debugfile, crc32, objfile->name)) @@ -905,7 +905,7 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c /* If the file is in the sysroot, try using its base path in the global debugfile directory. */ -@@ -1486,20 +2013,18 @@ find_separate_debug_file (struct objfile +@@ -1467,20 +1994,18 @@ find_separate_debug_file (struct objfile strcat (debugfile, basename); if (separate_debug_file_exists (debugfile, crc32, objfile->name)) @@ -933,28 +933,28 @@ Index: gdb-6.8.50.20090818/gdb/symfile.c } -@@ -4255,4 +4780,16 @@ Show printing of symbol loading messages - NULL, - NULL, - &setprintlist, &showprintlist); -+ -+ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose, -+ _("\ -+Set debugging level of the build-id locator."), _("\ -+Show debugging level of the build-id locator."), _("\ -+Level 1 (default) enables printing the missing debug filenames,\n\ -+level 2 also prints the parsing of binaries to find the identificators."), -+ NULL, -+ show_build_id_verbose, -+ &setlist, &showlist); -+ -+ observer_attach_executable_changed (debug_print_executable_changed); +@@ -4231,4 +4756,16 @@ the global debug-file directory prepende + NULL, + show_debug_file_directory, + &setlist, &showlist); ++ ++ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose, ++ _("\ ++ Set debugging level of the build-id locator."), _("\ ++ Show debugging level of the build-id locator."), _("\ ++ Level 1 (default) enables printing the missing debug filenames,\n\ ++ level 2 also prints the parsing of binaries to find the identificators."), ++ NULL, ++ show_build_id_verbose, ++ &setlist, &showlist); ++ ++ observer_attach_executable_changed (debug_print_executable_changed); } -Index: gdb-6.8.50.20090818/gdb/symfile.h +Index: gdb-6.8.50.20090909/gdb/symfile.h =================================================================== ---- gdb-6.8.50.20090818.orig/gdb/symfile.h 2009-08-18 21:07:04.000000000 +0200 -+++ gdb-6.8.50.20090818/gdb/symfile.h 2009-08-18 21:07:23.000000000 +0200 -@@ -388,6 +388,13 @@ extern int symfile_map_offsets_to_segmen +--- gdb-6.8.50.20090909.orig/gdb/symfile.h 2009-09-09 19:05:56.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/symfile.h 2009-09-09 19:09:35.000000000 +0200 +@@ -381,6 +381,13 @@ extern int symfile_map_offsets_to_segmen struct symfile_segment_data *get_symfile_segment_data (bfd *abfd); void free_symfile_segment_data (struct symfile_segment_data *data); @@ -968,10 +968,10 @@ Index: gdb-6.8.50.20090818/gdb/symfile.h /* From dwarf2read.c */ extern int dwarf2_has_info (struct objfile *); -Index: gdb-6.8.50.20090818/gdb/testsuite/lib/gdb.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-6.8.50.20090818.orig/gdb/testsuite/lib/gdb.exp 2009-08-18 21:07:04.000000000 +0200 -+++ gdb-6.8.50.20090818/gdb/testsuite/lib/gdb.exp 2009-08-18 21:07:23.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/gdb.exp 2009-09-09 19:05:56.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/lib/gdb.exp 2009-09-09 19:09:35.000000000 +0200 @@ -1248,6 +1248,16 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } @@ -989,10 +989,10 @@ Index: gdb-6.8.50.20090818/gdb/testsuite/lib/gdb.exp return 0; } -Index: gdb-6.8.50.20090818/gdb/testsuite/lib/mi-support.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-6.8.50.20090818.orig/gdb/testsuite/lib/mi-support.exp 2009-08-18 21:07:04.000000000 +0200 -+++ gdb-6.8.50.20090818/gdb/testsuite/lib/mi-support.exp 2009-08-18 21:07:23.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/testsuite/lib/mi-support.exp 2009-09-09 19:05:56.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/lib/mi-support.exp 2009-09-09 19:09:35.000000000 +0200 @@ -221,6 +221,16 @@ proc default_mi_gdb_start { args } { } } diff --git a/gdb-6.8-bz254229-gcore-prpsinfo.patch b/gdb-6.8-bz254229-gcore-prpsinfo.patch index f22b052..82e64f9 100644 --- a/gdb-6.8-bz254229-gcore-prpsinfo.patch +++ b/gdb-6.8-bz254229-gcore-prpsinfo.patch @@ -1,8 +1,8 @@ -Index: gdb-6.8.50.20090803/bfd/elf-bfd.h +Index: gdb-6.8.50.20090910/bfd/elf-bfd.h =================================================================== ---- gdb-6.8.50.20090803.orig/bfd/elf-bfd.h 2009-07-23 15:00:20.000000000 +0200 -+++ gdb-6.8.50.20090803/bfd/elf-bfd.h 2009-08-03 17:21:25.000000000 +0200 -@@ -2115,7 +2115,7 @@ extern Elf_Internal_Phdr * _bfd_elf_find +--- gdb-6.8.50.20090910.orig/bfd/elf-bfd.h 2009-09-09 23:38:57.000000000 +0200 ++++ gdb-6.8.50.20090910/bfd/elf-bfd.h 2009-09-10 23:01:15.000000000 +0200 +@@ -2121,7 +2121,7 @@ extern Elf_Internal_Phdr * _bfd_elf_find extern char *elfcore_write_note (bfd *, char *, int *, const char *, int, const void *, int); extern char *elfcore_write_prpsinfo @@ -11,11 +11,11 @@ Index: gdb-6.8.50.20090803/bfd/elf-bfd.h extern char *elfcore_write_prstatus (bfd *, char *, int *, long, int, const void *); extern char * elfcore_write_pstatus -Index: gdb-6.8.50.20090803/bfd/elf.c +Index: gdb-6.8.50.20090910/bfd/elf.c =================================================================== ---- gdb-6.8.50.20090803.orig/bfd/elf.c 2009-07-23 15:00:20.000000000 +0200 -+++ gdb-6.8.50.20090803/bfd/elf.c 2009-08-03 17:23:13.000000000 +0200 -@@ -8381,6 +8381,7 @@ char * +--- gdb-6.8.50.20090910.orig/bfd/elf.c 2009-09-09 23:38:57.000000000 +0200 ++++ gdb-6.8.50.20090910/bfd/elf.c 2009-09-10 23:04:17.000000000 +0200 +@@ -8398,6 +8398,7 @@ char * elfcore_write_prpsinfo (bfd *abfd, char *buf, int *bufsiz, @@ -23,7 +23,7 @@ Index: gdb-6.8.50.20090803/bfd/elf.c const char *fname, const char *psargs) { -@@ -8407,9 +8408,15 @@ elfcore_write_prpsinfo (bfd *abfd, +@@ -8424,9 +8425,15 @@ elfcore_write_prpsinfo (bfd *abfd, int note_type = NT_PRPSINFO; #endif @@ -42,7 +42,7 @@ Index: gdb-6.8.50.20090803/bfd/elf.c return elfcore_write_note (abfd, buf, bufsiz, note_name, note_type, &data, sizeof (data)); } -@@ -8424,9 +8431,15 @@ elfcore_write_prpsinfo (bfd *abfd, +@@ -8441,9 +8448,15 @@ elfcore_write_prpsinfo (bfd *abfd, int note_type = NT_PRPSINFO; #endif @@ -61,10 +61,10 @@ Index: gdb-6.8.50.20090803/bfd/elf.c return elfcore_write_note (abfd, buf, bufsiz, note_name, note_type, &data, sizeof (data)); } -Index: gdb-6.8.50.20090803/gdb/amd64-linux-nat.c +Index: gdb-6.8.50.20090910/gdb/amd64-linux-nat.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/amd64-linux-nat.c 2009-08-03 17:19:57.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/amd64-linux-nat.c 2009-08-03 17:21:25.000000000 +0200 +--- gdb-6.8.50.20090910.orig/gdb/amd64-linux-nat.c 2009-09-10 23:01:07.000000000 +0200 ++++ gdb-6.8.50.20090910/gdb/amd64-linux-nat.c 2009-09-10 23:01:15.000000000 +0200 @@ -140,6 +140,7 @@ static int amd64_linux_gregset32_reg_off static char * @@ -98,10 +98,10 @@ Index: gdb-6.8.50.20090803/gdb/amd64-linux-nat.c } static void -Index: gdb-6.8.50.20090803/gdb/fbsd-nat.c +Index: gdb-6.8.50.20090910/gdb/fbsd-nat.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/fbsd-nat.c 2009-07-02 19:21:06.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/fbsd-nat.c 2009-08-03 17:21:25.000000000 +0200 +--- gdb-6.8.50.20090910.orig/gdb/fbsd-nat.c 2009-07-02 19:21:06.000000000 +0200 ++++ gdb-6.8.50.20090910/gdb/fbsd-nat.c 2009-09-10 23:01:15.000000000 +0200 @@ -211,6 +211,7 @@ fbsd_make_corefile_notes (bfd *obfd, int psargs = reconcat (psargs, psargs, " ", get_inferior_args (), NULL); @@ -110,10 +110,10 @@ Index: gdb-6.8.50.20090803/gdb/fbsd-nat.c fname, psargs); } -Index: gdb-6.8.50.20090803/gdb/linux-nat.c +Index: gdb-6.8.50.20090910/gdb/linux-nat.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/linux-nat.c 2009-08-03 17:19:56.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/linux-nat.c 2009-08-03 17:24:03.000000000 +0200 +--- gdb-6.8.50.20090910.orig/gdb/linux-nat.c 2009-09-10 23:01:06.000000000 +0200 ++++ gdb-6.8.50.20090910/gdb/linux-nat.c 2009-09-10 23:01:15.000000000 +0200 @@ -55,6 +55,7 @@ #include "xml-support.h" #include "terminal.h" @@ -131,7 +131,7 @@ Index: gdb-6.8.50.20090803/gdb/linux-nat.c char *(*linux_elfcore_write_prstatus) (bfd *, char *, int *, long, int, const void *) = elfcore_write_prstatus; static char * -@@ -3840,6 +3841,159 @@ linux_spu_make_corefile_notes (bfd *obfd +@@ -3946,6 +3947,159 @@ linux_spu_make_corefile_notes (bfd *obfd return args.note_data; } @@ -291,7 +291,7 @@ Index: gdb-6.8.50.20090803/gdb/linux-nat.c /* Fills the "to_make_corefile_note" target vector. Builds the note section for a corefile, and returns it in a malloc buffer. */ -@@ -3860,8 +4014,14 @@ linux_nat_make_corefile_notes (bfd *obfd +@@ -3966,8 +4120,14 @@ linux_nat_make_corefile_notes (bfd *obfd if (get_exec_file (0)) { @@ -306,7 +306,7 @@ Index: gdb-6.8.50.20090803/gdb/linux-nat.c if (get_inferior_args ()) { char *string_end; -@@ -3877,9 +4037,15 @@ linux_nat_make_corefile_notes (bfd *obfd +@@ -3983,9 +4143,15 @@ linux_nat_make_corefile_notes (bfd *obfd psargs_end - string_end); } } @@ -324,11 +324,11 @@ Index: gdb-6.8.50.20090803/gdb/linux-nat.c } /* Dump information for threads. */ -Index: gdb-6.8.50.20090803/gdb/linux-nat.h +Index: gdb-6.8.50.20090910/gdb/linux-nat.h =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/linux-nat.h 2009-08-03 17:19:56.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/linux-nat.h 2009-08-03 17:21:25.000000000 +0200 -@@ -148,7 +148,7 @@ struct siginfo *linux_nat_get_siginfo (p +--- gdb-6.8.50.20090910.orig/gdb/linux-nat.h 2009-09-10 23:01:06.000000000 +0200 ++++ gdb-6.8.50.20090910/gdb/linux-nat.h 2009-09-10 23:01:15.000000000 +0200 +@@ -154,7 +154,7 @@ struct siginfo *linux_nat_get_siginfo (p /* These functions make elfcore note sections. They may get overriden by code adjusting data for multi-target builds. */ extern char *(*linux_elfcore_write_prpsinfo) @@ -337,10 +337,10 @@ Index: gdb-6.8.50.20090803/gdb/linux-nat.h extern char *(*linux_elfcore_write_prstatus) (bfd *, char *, int *, long, int, const void *); extern char *(*linux_elfcore_write_prfpreg) -Index: gdb-6.8.50.20090803/gdb/procfs.c +Index: gdb-6.8.50.20090910/gdb/procfs.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/procfs.c 2009-08-01 02:02:04.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/procfs.c 2009-08-03 17:21:25.000000000 +0200 +--- gdb-6.8.50.20090910.orig/gdb/procfs.c 2009-08-01 02:02:04.000000000 +0200 ++++ gdb-6.8.50.20090910/gdb/procfs.c 2009-09-10 23:01:15.000000000 +0200 @@ -6147,6 +6147,7 @@ procfs_make_note_section (bfd *obfd, int note_data = (char *) elfcore_write_prpsinfo (obfd, note_data, diff --git a/gdb-6.8-bz457187-largefile.patch b/gdb-6.8-bz457187-largefile.patch index 8ffc120..199d7a2 100644 --- a/gdb-6.8-bz457187-largefile.patch +++ b/gdb-6.8-bz457187-largefile.patch @@ -5,33 +5,30 @@ gdb/ * config.in: Regenerate. * configure: Regenerate. -Index: gdb-6.8.50.20090803/gdb/configure.ac +Index: gdb-6.8.50.20090909/gdb/configure.ac =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/configure.ac 2009-08-04 06:32:39.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/configure.ac 2009-08-04 06:33:51.000000000 +0200 -@@ -30,6 +30,7 @@ AC_GNU_SOURCE - AC_AIX - AC_ISC_POSIX +--- gdb-6.8.50.20090909.orig/gdb/configure.ac 2009-09-09 20:08:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/configure.ac 2009-09-09 20:11:04.000000000 +0200 +@@ -28,6 +28,7 @@ AM_MAINTAINER_MODE + AC_PROG_CC + AC_USE_SYSTEM_EXTENSIONS gl_EARLY +AC_SYS_LARGEFILE AM_PROG_CC_STDC AC_CONFIG_AUX_DIR(..) -Index: gdb-6.8.50.20090803/gdb/config.in +Index: gdb-6.8.50.20090909/gdb/config.in =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/config.in 2009-08-04 06:32:39.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/config.in 2009-08-04 06:33:51.000000000 +0200 -@@ -744,6 +744,9 @@ - # undef _ALL_SOURCE +--- gdb-6.8.50.20090909.orig/gdb/config.in 2009-09-09 20:08:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/config.in 2009-09-09 20:11:33.000000000 +0200 +@@ -751,10 +751,16 @@ + # endif #endif +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + - /* Enable GNU extensions on systems that have them. */ - #ifndef _GNU_SOURCE - # undef _GNU_SOURCE -@@ -753,6 +756,9 @@ + /* Define to 1 so gets a definition of anon_hdl. Works around a problem on IRIX 5. */ #undef _KMEMUSER @@ -41,11 +38,19 @@ Index: gdb-6.8.50.20090803/gdb/config.in /* Define to 1 if on MINIX. */ #undef _MINIX -Index: gdb-6.8.50.20090803/gdb/configure +Index: gdb-6.8.50.20090909/gdb/configure =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/configure 2009-08-04 06:32:39.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/configure 2009-08-04 06:33:51.000000000 +0200 -@@ -874,6 +874,7 @@ Optional Features: +--- gdb-6.8.50.20090909.orig/gdb/configure 2009-09-09 20:10:45.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/configure 2009-09-09 20:11:07.000000000 +0200 +@@ -884,6 +884,7 @@ ac_subst_files='host_makefile_frag' + ac_user_opts=' + enable_option_checking + enable_maintainer_mode ++enable_largefile + enable_dependency_tracking + with_separate_debug_dir + with_gdb_datadir +@@ -1562,6 +1563,7 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer @@ -53,33 +58,29 @@ Index: gdb-6.8.50.20090803/gdb/configure --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-targets=TARGETS -@@ -3347,6 +3348,370 @@ _ACEOF +@@ -4100,6 +4102,204 @@ fi -+# Check whether --enable-largefile or --disable-largefile was given. -+if test "${enable_largefile+set}" = set; then -+ enableval="$enable_largefile" ++# Check whether --enable-largefile was given. ++if test "${enable_largefile+set}" = set; then : ++ enableval=$enable_largefile; ++fi + -+fi; +if test "$enable_largefile" != no; then + -+ echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 -+if test "${ac_cv_sys_largefile_CC+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 ++$as_echo_n "checking for special C compiler options needed for large files... " >&6; } ++if test "${ac_cv_sys_largefile_CC+set}" = set; then : ++ $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do -+ # IRIX 6.2 and later do not support large files by default, -+ # so use the C compiler's -n32 option if that helps. -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF ++ # IRIX 6.2 and later do not support large files by default, ++ # so use the C compiler's -n32 option if that helps. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. @@ -98,89 +99,34 @@ Index: gdb-6.8.50.20090803/gdb/configure + return 0; +} +_ACEOF -+ rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then ++ if ac_fn_c_try_compile "$LINENO"; then : + break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ +fi -+rm -f conftest.err conftest.$ac_objext -+ CC="$CC -n32" -+ rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then ++rm -f core conftest.err conftest.$ac_objext ++ CC="$CC -n32" ++ if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ +fi -+rm -f conftest.err conftest.$ac_objext ++rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi -+echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 ++$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + -+ echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 -+if test "${ac_cv_sys_file_offset_bits+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 ++$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } ++if test "${ac_cv_sys_file_offset_bits+set}" = set; then : ++ $as_echo_n "(cached) " >&6 +else + while :; do -+ ac_cv_sys_file_offset_bits=no -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. @@ -199,40 +145,11 @@ Index: gdb-6.8.50.20090803/gdb/configure + return 0; +} +_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_file_offset_bits=no; break +fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include @@ -252,60 +169,33 @@ Index: gdb-6.8.50.20090803/gdb/configure + return 0; +} +_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ +fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ac_cv_sys_file_offset_bits=unknown + break +done +fi -+echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 -+if test "$ac_cv_sys_file_offset_bits" != no; then -+ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 ++$as_echo "$ac_cv_sys_file_offset_bits" >&6; } ++case $ac_cv_sys_file_offset_bits in #( ++ no | unknown) ;; ++ *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF -+ -+fi -+rm -f conftest* -+ echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 -+if test "${ac_cv_sys_large_files+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 ++;; ++esac ++rm -rf conftest* ++ if test $ac_cv_sys_file_offset_bits = unknown; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 ++$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } ++if test "${ac_cv_sys_large_files+set}" = set; then : ++ $as_echo_n "(cached) " >&6 +else + while :; do -+ ac_cv_sys_large_files=no -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. @@ -324,40 +214,11 @@ Index: gdb-6.8.50.20090803/gdb/configure + return 0; +} +_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_large_files=no; break +fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include @@ -377,48 +238,26 @@ Index: gdb-6.8.50.20090803/gdb/configure + return 0; +} +_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then ++if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ +fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ac_cv_sys_large_files=unknown + break +done +fi -+echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -+echo "${ECHO_T}$ac_cv_sys_large_files" >&6 -+if test "$ac_cv_sys_large_files" != no; then -+ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 ++$as_echo "$ac_cv_sys_large_files" >&6; } ++case $ac_cv_sys_large_files in #( ++ no | unknown) ;; ++ *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF -+ -+fi -+rm -f conftest* ++;; ++esac ++rm -rf conftest* ++ fi +fi + diff --git a/gdb-6.8-bz466901-backtrace-full-prelinked.patch b/gdb-6.8-bz466901-backtrace-full-prelinked.patch index f0fca32..f9ec349 100644 --- a/gdb-6.8-bz466901-backtrace-full-prelinked.patch +++ b/gdb-6.8-bz466901-backtrace-full-prelinked.patch @@ -1,9 +1,9 @@ Fix resolving of variables at locations lists in prelinked libs (BZ 466901). -Index: gdb-6.8.50.20090803/gdb/dwarf2loc.c +Index: gdb-6.8.50.20090909/gdb/dwarf2loc.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/dwarf2loc.c 2009-08-04 06:29:47.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/dwarf2loc.c 2009-08-04 06:33:35.000000000 +0200 +--- gdb-6.8.50.20090909.orig/gdb/dwarf2loc.c 2009-09-09 20:08:03.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/dwarf2loc.c 2009-09-09 20:10:35.000000000 +0200 @@ -56,7 +56,9 @@ find_location_expression (struct dwarf2_ CORE_ADDR low, high; gdb_byte *loc_ptr, *buf_end; @@ -15,10 +15,10 @@ Index: gdb-6.8.50.20090803/gdb/dwarf2loc.c struct gdbarch *gdbarch = get_objfile_arch (objfile); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); unsigned int addr_size = dwarf2_per_cu_addr_size (baton->per_cu); -Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp 2009-08-04 06:33:35.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp 2009-09-09 20:10:35.000000000 +0200 @@ -0,0 +1,102 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -122,10 +122,10 @@ Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp + +# `abort' can get expressed as `*__GI_abort'. +gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\r\n\[\t \]+i = -?\[0-9\].*in main \\(.*" "Backtrace after abort()" -Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c 2009-08-04 06:33:35.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c 2009-09-09 20:10:35.000000000 +0200 @@ -0,0 +1,26 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -153,10 +153,10 @@ Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c + func (); + return 0; +} -Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S 2009-08-04 06:33:35.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S 2009-09-09 20:10:35.000000000 +0200 @@ -0,0 +1,328 @@ +/* This testcase is part of GDB, the GNU debugger. + diff --git a/gdb-6.8-inlining-addon.patch b/gdb-6.8-inlining-addon.patch index 72d2142..c8e6159 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.20090803/gdb/testsuite/gdb.opt/inline-bt.c +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-bt.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.opt/inline-bt.c 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-bt.c 2009-08-03 16:57:40.000000000 +0200 +--- 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 @@ -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.20090803/gdb/testsuite/gdb.opt/inline-bt.c inline int func1(void) { -Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-cmds.c +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-cmds.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.opt/inline-cmds.c 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-cmds.c 2009-08-03 16:57:40.000000000 +0200 +--- 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 @@ -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.20090803/gdb/testsuite/gdb.opt/inline-cmds.c inline int func1(void) { bar (); -Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-cmds.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-cmds.exp =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-08-03 16:57:40.000000000 +0200 +--- 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 @@ -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.20090803/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.20090803/gdb/testsuite/gdb.opt/inline-locals.c +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-locals.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.opt/inline-locals.c 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-locals.c 2009-08-03 16:57:40.000000000 +0200 +--- 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 @@ -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.20090803/gdb/testsuite/gdb.opt/inline-locals.c inline int func1(int arg1) { -Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-locals.exp +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-locals.exp =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.opt/inline-locals.exp 2009-06-30 17:50:27.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-locals.exp 2009-08-03 16:57:40.000000000 +0200 +--- 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 @@ -77,6 +77,9 @@ if { ! $no_frames } { # Make sure that locals on the stack are found. This is an array to @@ -155,10 +155,10 @@ Index: gdb-6.8.50.20090803/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.20090803/gdb/frame.c +Index: gdb-6.8.50.20090909/gdb/frame.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/frame.c 2009-08-03 15:56:08.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/frame.c 2009-08-03 16:57:40.000000000 +0200 +--- 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 static struct frame_info * skip_inlined_frames (struct frame_info *frame) @@ -195,19 +195,19 @@ Index: gdb-6.8.50.20090803/gdb/frame.c { sal->symtab = SYMBOL_SYMTAB (sym); sal->line = SYMBOL_LINE (sym); -Index: gdb-6.8.50.20090803/gdb/breakpoint.c +Index: gdb-6.8.50.20090909/gdb/breakpoint.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/breakpoint.c 2009-08-03 16:56:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/breakpoint.c 2009-08-03 17:19:24.000000000 +0200 -@@ -60,6 +60,7 @@ - #include "wrapper.h" +--- 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" + #include "jit.h" #include "parser-defs.h" +#include "inline-frame.h" /* readline include files */ #include "readline/readline.h" -@@ -3065,10 +3066,24 @@ bpstat_check_breakpoint_conditions (bpst +@@ -3217,10 +3218,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.20090803/gdb/breakpoint.c { int value_is_zero = 0; -@@ -3215,6 +3230,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p +@@ -3380,6 +3395,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.20090803/gdb/breakpoint.c } /* Print nothing for this entry if we dont stop or if we dont print. */ -@@ -5164,9 +5185,9 @@ set_momentary_breakpoint (struct gdbarch +@@ -5278,9 +5299,9 @@ set_momentary_breakpoint (struct gdbarch { struct breakpoint *b; @@ -262,10 +262,10 @@ Index: gdb-6.8.50.20090803/gdb/breakpoint.c b = set_raw_breakpoint (gdbarch, sal, type); b->enable_state = bp_enabled; -Index: gdb-6.8.50.20090803/gdb/inline-frame.c +Index: gdb-6.8.50.20090909/gdb/inline-frame.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/inline-frame.c 2009-06-28 02:20:22.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/inline-frame.c 2009-08-03 16:57:40.000000000 +0200 +--- 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 if (frame_block == NULL) return 0; @@ -342,10 +342,10 @@ Index: gdb-6.8.50.20090803/gdb/inline-frame.c /* Return the number of hidden functions inlined into the current frame. */ -Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-markers.c +Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.opt/inline-markers.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/testsuite/gdb.opt/inline-markers.c 2009-06-28 02:20:24.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-markers.c 2009-08-03 16:57:40.000000000 +0200 +--- 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 @@ -15,11 +15,6 @@ extern int x, y; @@ -358,11 +358,11 @@ Index: gdb-6.8.50.20090803/gdb/testsuite/gdb.opt/inline-markers.c void marker(void) { x += y; /* set breakpoint 2 here */ -Index: gdb-6.8.50.20090803/gdb/gdbthread.h +Index: gdb-6.8.50.20090909/gdb/gdbthread.h =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/gdbthread.h 2009-08-03 15:55:53.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/gdbthread.h 2009-08-03 16:57:40.000000000 +0200 -@@ -187,6 +187,12 @@ struct thread_info +--- 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 +@@ -191,6 +191,12 @@ struct thread_info /* Private data used by the target vector implementation. */ struct private_thread_info *private; @@ -375,11 +375,11 @@ Index: gdb-6.8.50.20090803/gdb/gdbthread.h }; /* Create an empty thread list, or empty the existing one. */ -Index: gdb-6.8.50.20090803/gdb/infcmd.c +Index: gdb-6.8.50.20090909/gdb/infcmd.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/infcmd.c 2009-07-02 23:57:27.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/infcmd.c 2009-08-03 17:17:24.000000000 +0200 -@@ -1408,11 +1408,11 @@ finish_command_continuation (void *arg) +--- 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 +@@ -1434,11 +1434,11 @@ finish_command_continuation (void *arg) struct type *value_type; value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (a->function)); @@ -393,9 +393,9 @@ Index: gdb-6.8.50.20090803/gdb/infcmd.c print_return_value (SYMBOL_TYPE (a->function), value_type); } -@@ -1514,6 +1514,16 @@ finish_forward (struct symbol *function, - - old_chain = make_cleanup_delete_breakpoint (breakpoint); +@@ -1546,6 +1546,16 @@ finish_forward (struct symbol *function, + tp->initiating_frame = get_frame_id (frame); + make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); + /* We should _always_ set CURRENT_PC_IS_NOTCURRENT here to always see the + calling line with the message `Value returned is ...'. Currently it is @@ -410,7 +410,7 @@ Index: gdb-6.8.50.20090803/gdb/infcmd.c tp->proceed_to_finish = 1; /* We want stop_registers, please... */ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); -@@ -1535,7 +1545,9 @@ finish_forward (struct symbol *function, +@@ -1567,7 +1577,9 @@ finish_forward (struct symbol *function, static void finish_command (char *arg, int from_tty) { @@ -421,7 +421,7 @@ Index: gdb-6.8.50.20090803/gdb/infcmd.c struct symbol *function; int async_exec = 0; -@@ -1566,45 +1578,63 @@ finish_command (char *arg, int from_tty) +@@ -1598,45 +1610,63 @@ finish_command (char *arg, int from_tty) if (!target_has_execution) error (_("The program is not running.")); @@ -502,7 +502,7 @@ Index: gdb-6.8.50.20090803/gdb/infcmd.c /* Print info on the selected frame, including level number but not source. */ -@@ -1618,10 +1648,14 @@ finish_command (char *arg, int from_tty) +@@ -1650,10 +1680,14 @@ finish_command (char *arg, int from_tty) print_stack_frame (get_selected_frame (NULL), 1, LOCATION); } @@ -518,22 +518,22 @@ Index: gdb-6.8.50.20090803/gdb/infcmd.c } -Index: gdb-6.8.50.20090803/gdb/target.c +Index: gdb-6.8.50.20090909/gdb/target.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/target.c 2009-08-03 16:04:15.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/target.c 2009-08-03 16:57:40.000000000 +0200 -@@ -2079,6 +2079,7 @@ target_resume (ptid_t ptid, int step, en +--- 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 { struct target_ops *t; + clear_inline_frame_state (ptid); - dcache_invalidate (target_dcache); + target_dcache_invalidate (); for (t = current_target.beneath; t != NULL; t = t->beneath) -Index: gdb-6.8.50.20090803/gdb/inline-frame.h +Index: gdb-6.8.50.20090909/gdb/inline-frame.h =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/inline-frame.h 2009-06-28 02:20:22.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/inline-frame.h 2009-08-03 16:57:40.000000000 +0200 +--- 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 @@ -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.20090803/gdb/inline-frame.h /* Return the number of hidden functions inlined into the current frame. */ -Index: gdb-6.8.50.20090803/gdb/dwarf2read.c +Index: gdb-6.8.50.20090909/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.50.20090803.orig/gdb/dwarf2read.c 2009-08-03 16:56:10.000000000 +0200 -+++ gdb-6.8.50.20090803/gdb/dwarf2read.c 2009-08-03 16:57:40.000000000 +0200 -@@ -4107,6 +4107,7 @@ read_func_scope (struct die_info *die, s +--- 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 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.20090803/gdb/dwarf2read.c if (inlined_func) { -@@ -4148,7 +4149,10 @@ read_func_scope (struct die_info *die, s +@@ -4171,7 +4172,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-6.8.50.20090818-upstream.patch b/gdb-6.8.50.20090818-upstream.patch deleted file mode 100644 index b9964ef..0000000 --- a/gdb-6.8.50.20090818-upstream.patch +++ /dev/null @@ -1,237 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2009-08/msg00310.html -http://sourceware.org/ml/gdb-cvs/2009-08/msg00092.html - -2009-08-19 Ulrich Weigand - - * value.c (enum internalvar_kind): Replace INTERNALVAR_SCALAR by - INTERNALVAR_INTEGER and INTERNALVAR_POINTER. - (union internalvar_data): Replace "scalar" member by "integer" - and "pointer". - (value_of_internalvar): Handle INTERNALVAR_INTEGER and - INTERNALVAR_POINTER instead of INTERNALVAR_SCALAR. - (get_internalvar_integer): Likewise. - (set_internalvar): Likewise. - (set_internalvar_integer): Likewise. - (preserve_one_internalvar): Likewise. - (value_from_pointer): Handle typedef'd pointer types. - -2009-08-19 Doug Evans - - * gdb.base/gdbvars.c: New file. - * gdb.base/gdbvars.exp: Test convenience vars with program variables. - ---- src/gdb/value.c 2009/08/13 18:39:20 1.92 -+++ src/gdb/value.c 2009/08/19 13:00:28 1.93 -@@ -920,8 +920,11 @@ - /* The internal variable holds a GDB internal convenience function. */ - INTERNALVAR_FUNCTION, - -- /* The variable holds a simple scalar value. */ -- INTERNALVAR_SCALAR, -+ /* The variable holds an integer value. */ -+ INTERNALVAR_INTEGER, -+ -+ /* The variable holds a pointer value. */ -+ INTERNALVAR_POINTER, - - /* The variable holds a GDB-provided string. */ - INTERNALVAR_STRING, -@@ -944,19 +947,22 @@ - int canonical; - } fn; - -- /* A scalar value used with INTERNALVAR_SCALAR. */ -+ /* An integer value used with INTERNALVAR_INTEGER. */ - struct - { - /* If type is non-NULL, it will be used as the type to generate - a value for this internal variable. If type is NULL, a default - integer type for the architecture is used. */ - struct type *type; -- union -- { -- LONGEST l; /* Used with TYPE_CODE_INT and NULL types. */ -- CORE_ADDR a; /* Used with TYPE_CODE_PTR types. */ -- } val; -- } scalar; -+ LONGEST val; -+ } integer; -+ -+ /* A pointer value used with INTERNALVAR_POINTER. */ -+ struct -+ { -+ struct type *type; -+ CORE_ADDR val; -+ } pointer; - - /* A string value used with INTERNALVAR_STRING. */ - char *string; -@@ -1082,16 +1088,16 @@ - val = allocate_value (builtin_type (gdbarch)->internal_fn); - break; - -- case INTERNALVAR_SCALAR: -- if (!var->u.scalar.type) -+ case INTERNALVAR_INTEGER: -+ if (!var->u.integer.type) - val = value_from_longest (builtin_type (gdbarch)->builtin_int, -- var->u.scalar.val.l); -- else if (TYPE_CODE (var->u.scalar.type) == TYPE_CODE_INT) -- val = value_from_longest (var->u.scalar.type, var->u.scalar.val.l); -- else if (TYPE_CODE (var->u.scalar.type) == TYPE_CODE_PTR) -- val = value_from_pointer (var->u.scalar.type, var->u.scalar.val.a); -+ var->u.integer.val); - else -- internal_error (__FILE__, __LINE__, "bad type"); -+ val = value_from_longest (var->u.integer.type, var->u.integer.val); -+ break; -+ -+ case INTERNALVAR_POINTER: -+ val = value_from_pointer (var->u.pointer.type, var->u.pointer.val); - break; - - case INTERNALVAR_STRING: -@@ -1145,14 +1151,9 @@ - { - switch (var->kind) - { -- case INTERNALVAR_SCALAR: -- if (var->u.scalar.type == NULL -- || TYPE_CODE (var->u.scalar.type) == TYPE_CODE_INT) -- { -- *result = var->u.scalar.val.l; -- return 1; -- } -- /* Fall through. */ -+ case INTERNALVAR_INTEGER: -+ *result = var->u.integer.val; -+ return 1; - - default: - return 0; -@@ -1224,15 +1225,15 @@ - break; - - case TYPE_CODE_INT: -- new_kind = INTERNALVAR_SCALAR; -- new_data.scalar.type = value_type (val); -- new_data.scalar.val.l = value_as_long (val); -+ new_kind = INTERNALVAR_INTEGER; -+ new_data.integer.type = value_type (val); -+ new_data.integer.val = value_as_long (val); - break; - - case TYPE_CODE_PTR: -- new_kind = INTERNALVAR_SCALAR; -- new_data.scalar.type = value_type (val); -- new_data.scalar.val.a = value_as_address (val); -+ new_kind = INTERNALVAR_POINTER; -+ new_data.pointer.type = value_type (val); -+ new_data.pointer.val = value_as_address (val); - break; - - default: -@@ -1269,9 +1270,9 @@ - /* Clean up old contents. */ - clear_internalvar (var); - -- var->kind = INTERNALVAR_SCALAR; -- var->u.scalar.type = NULL; -- var->u.scalar.val.l = l; -+ var->kind = INTERNALVAR_INTEGER; -+ var->u.integer.type = NULL; -+ var->u.integer.val = l; - } - - void -@@ -1426,10 +1427,16 @@ - { - switch (var->kind) - { -- case INTERNALVAR_SCALAR: -- if (var->u.scalar.type && TYPE_OBJFILE (var->u.scalar.type) == objfile) -- var->u.scalar.type -- = copy_type_recursive (objfile, var->u.scalar.type, copied_types); -+ case INTERNALVAR_INTEGER: -+ if (var->u.integer.type && TYPE_OBJFILE (var->u.integer.type) == objfile) -+ var->u.integer.type -+ = copy_type_recursive (objfile, var->u.integer.type, copied_types); -+ break; -+ -+ case INTERNALVAR_POINTER: -+ if (TYPE_OBJFILE (var->u.pointer.type) == objfile) -+ var->u.pointer.type -+ = copy_type_recursive (objfile, var->u.pointer.type, copied_types); - break; - - case INTERNALVAR_VALUE: -@@ -2164,7 +2171,7 @@ - value_from_pointer (struct type *type, CORE_ADDR addr) - { - struct value *val = allocate_value (type); -- store_typed_address (value_contents_raw (val), type, addr); -+ store_typed_address (value_contents_raw (val), check_typedef (type), addr); - return val; - } - ---- src/gdb/testsuite/gdb.base/gdbvars.c -+++ src/gdb/testsuite/gdb.base/gdbvars.c 2009-08-19 15:10:47.270783000 +0000 -@@ -0,0 +1,16 @@ -+/* Simple program to help exercise gdb's convenience variables. */ -+ -+typedef void *ptr; -+ -+ptr p = &p; -+ -+int -+main () -+{ -+#ifdef usestubs -+ set_debug_traps (); -+ breakpoint (); -+#endif -+ -+ return 0; -+} ---- src/gdb/testsuite/gdb.base/gdbvars.exp 2009/01/03 05:58:03 1.6 -+++ src/gdb/testsuite/gdb.base/gdbvars.exp 2009/08/19 13:00:29 1.7 -@@ -22,6 +22,15 @@ - set prms_id 0 - set bug_id 0 - -+set testfile "gdbvars" -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested gdbvars.exp -+ return -1 -+} -+ - proc test_convenience_variables {} { - global gdb_prompt - -@@ -101,13 +110,23 @@ - "Use value-history element in arithmetic expression" - } - -+proc test_with_program {} { -+ global hex -+ gdb_test "set \$prog_var = p" "" \ -+ "Set a new convenience variable to a program variable" -+ gdb_test "print /x \$prog_var" " = $hex" \ -+ "Print contents of new convenience variable of program variable" -+} -+ - # Start with a fresh gdb. - - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} - - send_gdb "set print sevenbit-strings\n" ; gdb_expect -re ".*$gdb_prompt $" - - test_value_history - test_convenience_variables -+test_with_program diff --git a/gdb-archer.patch b/gdb-archer.patch index d31855b..31e2d4b 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 a081d2f12945e9468edd5f4341d3e945bd0fefe9 +commit 941eb487a42933e442cb4d11344cda96ecb8a04d branch `archer' - the merge of branches: archer-tromey-call-frame-cfa @@ -14,10 +14,12 @@ archer-keiths-expr-cumulative archer-tromey-python archer-jankratochvil-fortran-module archer-jankratochvil-watchpoint +archer-jankratochvil-bp_location-accel +archer-pmuldoon-next-over-throw diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index 9c2b9c7..032b0cf 100644 +index 7f2fe58..ac3a4a0 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -166,6 +166,13 @@ INTL_CFLAGS = @INCINTL@ @@ -38,50 +40,50 @@ index 9c2b9c7..032b0cf 100644 # SUBDIR_PYTHON_OBS = \ python.o \ -+ python-block.o \ -+ python-breakpoint.o \ - python-cmd.o \ - python-frame.o \ - python-function.o \ -+ python-hooks.o \ -+ python-inferior.o \ -+ python-infthread.o \ - python-objfile.o \ -+ python-param.o \ - python-prettyprint.o \ -+ python-symbol.o \ -+ python-symtab.o \ - python-type.o \ - python-utils.o \ - python-value.o ++ py-block.o \ ++ py-breakpoint.o \ + py-cmd.o \ + py-frame.o \ + py-function.o \ ++ py-hooks.o \ ++ py-inferior.o \ ++ py-infthread.o \ + py-objfile.o \ ++ py-param.o \ + py-prettyprint.o \ ++ py-symbol.o \ ++ py-symtab.o \ + py-type.o \ + py-utils.o \ + py-value.o SUBDIR_PYTHON_SRCS = \ python/python.c \ -+ python/python-block.c \ -+ python/python-breakpoint.c \ - python/python-cmd.c \ - python/python-frame.c \ - python/python-function.c \ -+ python/python-hooks.c \ -+ python/python-inferior.c \ -+ python/python-infthread.c \ - python/python-objfile.c \ -+ python/python-param.c \ - python/python-prettyprint.c \ -+ python/python-symbol.c \ -+ python/python-symtab.c \ - python/python-type.c \ - python/python-utils.c \ - python/python-value.c -@@ -745,7 +768,7 @@ config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \ ++ python/py-block.c \ ++ python/py-breakpoint.c \ + python/py-cmd.c \ + python/py-frame.c \ + python/py-function.c \ ++ python/py-hooks.c \ ++ python/py-inferior.c \ ++ python/py-infthread.c \ + python/py-objfile.c \ ++ python/py-param.c \ + python/py-prettyprint.c \ ++ python/py-symbol.c \ ++ python/py-symtab.c \ + 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 \ 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 -+gdb_usleep.h python/python.h python/python-internal.h +-gdb_usleep.h jit.h ++gdb_usleep.h jit.h python/python.h python/python-internal.h # Header files that already have srcdir in them, or which are in objdir. -@@ -862,7 +885,7 @@ generated_files = config.h observer.h observer.inc ada-lex.c \ +@@ -864,7 +887,7 @@ generated_files = config.h observer.h observer.inc ada-lex.c \ $(COMPILE) $< $(POSTCOMPILE) @@ -90,7 +92,7 @@ index 9c2b9c7..032b0cf 100644 @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do .PHONY: all-tui all-tui: $(TUI)$(EXEEXT) -@@ -1218,6 +1241,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -1221,6 +1244,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -103,62 +105,62 @@ index 9c2b9c7..032b0cf 100644 config.status: $(srcdir)/configure configure.tgt configure.host $(SHELL) config.status --recheck -@@ -1917,6 +1946,14 @@ python.o: $(srcdir)/python/python.c +@@ -1920,6 +1949,14 @@ python.o: $(srcdir)/python/python.c $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python.c $(POSTCOMPILE) -+python-block.o: $(srcdir)/python/python-block.c -+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-block.c ++py-block.o: $(srcdir)/python/py-block.c ++ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-block.c + $(POSTCOMPILE) + -+python-breakpoint.o: $(srcdir)/python/python-breakpoint.c -+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-breakpoint.c ++py-breakpoint.o: $(srcdir)/python/py-breakpoint.c ++ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-breakpoint.c + $(POSTCOMPILE) + - python-cmd.o: $(srcdir)/python/python-cmd.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-cmd.c + py-cmd.o: $(srcdir)/python/py-cmd.c + $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-cmd.c $(POSTCOMPILE) -@@ -1929,14 +1966,38 @@ python-function.o: $(srcdir)/python/python-function.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-function.c +@@ -1932,14 +1969,38 @@ py-function.o: $(srcdir)/python/py-function.c + $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-function.c $(POSTCOMPILE) -+python-hooks.o: $(srcdir)/python/python-hooks.c -+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-hooks.c ++py-hooks.o: $(srcdir)/python/py-hooks.c ++ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-hooks.c + $(POSTCOMPILE) + -+python-inferior.o: $(srcdir)/python/python-inferior.c -+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-inferior.c ++py-inferior.o: $(srcdir)/python/py-inferior.c ++ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-inferior.c + $(POSTCOMPILE) + -+python-infthread.o: $(srcdir)/python/python-infthread.c -+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-infthread.c ++py-infthread.o: $(srcdir)/python/py-infthread.c ++ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-infthread.c + $(POSTCOMPILE) + - python-objfile.o: $(srcdir)/python/python-objfile.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-objfile.c + py-objfile.o: $(srcdir)/python/py-objfile.c + $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-objfile.c $(POSTCOMPILE) -+python-param.o: $(srcdir)/python/python-param.c -+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-param.c ++py-param.o: $(srcdir)/python/py-param.c ++ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-param.c + $(POSTCOMPILE) + - python-prettyprint.o: $(srcdir)/python/python-prettyprint.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-prettyprint.c + py-prettyprint.o: $(srcdir)/python/py-prettyprint.c + $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-prettyprint.c $(POSTCOMPILE) -+python-symbol.o: $(srcdir)/python/python-symbol.c -+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-symbol.c ++py-symbol.o: $(srcdir)/python/py-symbol.c ++ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-symbol.c + $(POSTCOMPILE) + -+python-symtab.o: $(srcdir)/python/python-symtab.c -+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-symtab.c ++py-symtab.o: $(srcdir)/python/py-symtab.c ++ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-symtab.c + $(POSTCOMPILE) + - python-type.o: $(srcdir)/python/python-type.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-type.c + py-type.o: $(srcdir)/python/py-type.c + $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-type.c $(POSTCOMPILE) -@@ -1949,6 +2010,36 @@ python-value.o: $(srcdir)/python/python-value.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-value.c +@@ -1952,6 +2013,36 @@ py-value.o: $(srcdir)/python/py-value.c + $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-value.c $(POSTCOMPILE) +# All python library files, with the "python/lib" stripped off. @@ -195,10 +197,10 @@ index 9c2b9c7..032b0cf 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 0b8e3af..446246f 100644 +index 14da6c8..1979f42 100644 --- a/gdb/NEWS +++ b/gdb/NEWS -@@ -425,6 +425,13 @@ x86/x86_64 Darwin i[34567]86-*-darwin* +@@ -444,6 +444,13 @@ x86/x86_64 Darwin i[34567]86-*-darwin* x86_64 MinGW x86_64-*-mingw* @@ -387,10 +389,10 @@ index 7d8461c..a6d35d7 100644 /* Override the GNU/Linux inferior startup hook. */ diff --git a/gdb/block.c b/gdb/block.c -index 1889ecd..37fa342 100644 +index 97ea67a..b20beeb 100644 --- a/gdb/block.c +++ b/gdb/block.c -@@ -223,8 +223,9 @@ block_set_scope (struct block *block, const char *scope, +@@ -227,8 +227,9 @@ block_set_scope (struct block *block, const char *scope, BLOCK_NAMESPACE (block)->scope = scope; } @@ -402,7 +404,7 @@ index 1889ecd..37fa342 100644 struct using_direct * block_using (const struct block *block) -@@ -314,6 +315,25 @@ allocate_block (struct obstack *obstack) +@@ -318,6 +319,25 @@ allocate_block (struct obstack *obstack) BLOCK_SUPERBLOCK (bl) = NULL; BLOCK_DICT (bl) = NULL; BLOCK_NAMESPACE (bl) = NULL; @@ -464,18 +466,83 @@ index 53e7371..d373f8a 100644 + #endif /* BLOCK_H */ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index f3940e1..2349fbc 100644 +index 9f50872..a4255d7 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -59,6 +59,7 @@ - #include "top.h" +@@ -60,6 +60,7 @@ #include "wrapper.h" #include "valprint.h" + #include "jit.h" +#include "parser-defs.h" /* readline include files */ #include "readline/readline.h" -@@ -578,6 +579,53 @@ get_breakpoint (int num) +@@ -111,8 +112,6 @@ struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch, + struct symtab_and_line, + enum bptype); + +-static void check_duplicates (struct breakpoint *); +- + 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; + B ? (TMP=B->next, 1): 0; \ + B = TMP) + +-/* Similar iterators for the low-level breakpoints. */ +- +-#define ALL_BP_LOCATIONS(B) for (B = bp_location_chain; B; B = B->global_next) ++/* Similar iterator for the low-level breakpoints. SAFE variant is not ++ provided so update_global_location_list must not be called while executing ++ the block of ALL_BP_LOCATIONS. */ + +-#define ALL_BP_LOCATIONS_SAFE(B,TMP) \ +- for (B = bp_location_chain; \ +- B ? (TMP=B->global_next, 1): 0; \ +- B = TMP) ++#define ALL_BP_LOCATIONS(B,BP_TMP) \ ++ for (BP_TMP = bp_location; \ ++ BP_TMP < bp_location + bp_location_count && (B = *BP_TMP); \ ++ BP_TMP++) + + /* Iterator for tracepoints only. */ + +@@ -353,10 +352,31 @@ static int executing_startup; + + struct breakpoint *breakpoint_chain; + +-struct bp_location *bp_location_chain; ++/* Array is sorted by bp_location_compare - primarily by the ADDRESS. */ ++ ++static struct bp_location **bp_location; ++ ++/* Number of elements of BP_LOCATION. */ ++ ++static unsigned bp_location_count; ++ ++/* Maximum alignment offset between bp_target_info.PLACED_ADDRESS and ADDRESS ++ for the current elements of BP_LOCATION which get a valid result from ++ bp_location_has_shadow. You can use it for roughly limiting the subrange of ++ BP_LOCATION to scan for shadow bytes for an address you need to read. */ ++ ++static CORE_ADDR bp_location_placed_address_before_address_max; ++ ++/* Maximum offset plus alignment between ++ bp_target_info.PLACED_ADDRESS + bp_target_info.SHADOW_LEN and ADDRESS for ++ the current elements of BP_LOCATION which get a valid result from ++ bp_location_has_shadow. You can use it for roughly limiting the subrange of ++ BP_LOCATION to scan for shadow bytes for an address you need to read. */ ++ ++static CORE_ADDR bp_location_shadow_len_after_address_max; + + /* The locations that no longer correspond to any breakpoint, +- unlinked from bp_location_chain, but for which a hit ++ unlinked from bp_location array, but for which a hit + may still be reported by a target. */ + VEC(bp_location_p) *moribund_locations = NULL; + +@@ -579,6 +599,53 @@ get_breakpoint (int num) } @@ -529,7 +596,7 @@ index f3940e1..2349fbc 100644 /* condition N EXP -- set break condition of breakpoint N to EXP. */ static void -@@ -598,42 +646,7 @@ condition_command (char *arg, int from_tty) +@@ -599,42 +666,7 @@ condition_command (char *arg, int from_tty) ALL_BREAKPOINTS (b) if (b->number == bnum) { @@ -573,7 +640,273 @@ index f3940e1..2349fbc 100644 return; } -@@ -1690,6 +1703,7 @@ detach_breakpoints (int pid) +@@ -732,35 +764,88 @@ commands_from_control_command (char *arg, struct command_line *cmd) + } + error (_("No breakpoint number %d."), bnum); + } +- ++ ++/* Return non-zero if BL->TARGET_INFO contains valid information. */ ++ ++static int ++bp_location_has_shadow (struct bp_location *bl) ++{ ++ if (bl->loc_type != bp_loc_software_breakpoint) ++ return 0; ++ if (!bl->inserted) ++ return 0; ++ if (bl->target_info.shadow_len == 0) ++ /* bp isn't valid, or doesn't shadow memory. */ ++ return 0; ++ return 1; ++} ++ + /* Update BUF, which is LEN bytes read from the target address MEMADDR, +- by replacing any memory breakpoints with their shadowed contents. */ ++ by replacing any memory breakpoints with their shadowed contents. ++ ++ The range of shadowed area by each bp_location is: ++ b->address - bp_location_placed_address_before_address_max ++ up to b->address + bp_location_shadow_len_after_address_max ++ The range we were requested to resolve shadows for is: ++ memaddr ... memaddr + le ++ Thus the safe cutoff boundaries for performance optimization are ++ memaddr + len <= b->address - bp_location_placed_address_before_address_max ++ and: ++ b->address + bp_location_shadow_len_after_address_max <= memaddr */ + + void + breakpoint_restore_shadows (gdb_byte *buf, ULONGEST memaddr, LONGEST len) + { +- struct bp_location *b; +- CORE_ADDR bp_addr = 0; +- int bp_size = 0; +- int bptoffset = 0; ++ /* Left boundary, right boundary and media element of our binary search. */ ++ unsigned bc_l, bc_r, bc; ++ ++ /* Find BC_L which is a leftmost element which may affect BUF content. It is ++ safe to report lower value but a failure to report higher one. */ ++ ++ bc_l = 0; ++ bc_r = bp_location_count; ++ while (bc_l + 1 < bc_r) ++ { ++ struct bp_location *b; + +- ALL_BP_LOCATIONS (b) ++ bc = (bc_l + bc_r) / 2; ++ b = bp_location[bc]; ++ ++ if (b->address + bp_location_shadow_len_after_address_max >= b->address ++ && b->address + bp_location_shadow_len_after_address_max <= memaddr) ++ bc_l = bc; ++ else ++ bc_r = bc; ++ } ++ ++ /* Now do full processing of the found relevant range of elements. */ ++ ++ for (bc = bc_l; bc < bp_location_count; bc++) + { ++ struct bp_location *b = bp_location[bc]; ++ CORE_ADDR bp_addr = 0; ++ int bp_size = 0; ++ int bptoffset = 0; ++ + if (b->owner->type == bp_none) + warning (_("reading through apparently deleted breakpoint #%d?"), + b->owner->number); + +- if (b->loc_type != bp_loc_software_breakpoint) +- continue; +- if (!b->inserted) ++ /* Performance optimization: any futher element can no longer affect BUF ++ content. */ ++ ++ if (b->address >= bp_location_placed_address_before_address_max ++ && memaddr + len <= b->address ++ - bp_location_placed_address_before_address_max) ++ break; ++ ++ if (!bp_location_has_shadow (b)) + continue; ++ + /* Addresses and length of the part of the breakpoint that + we need to copy. */ + bp_addr = b->target_info.placed_address; + bp_size = b->target_info.shadow_len; +- if (bp_size == 0) +- /* bp isn't valid, or doesn't shadow memory. */ +- continue; + + 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) + struct bp_location *loc; + bpstat bs; + +- /* We don't free locations. They are stored in bp_location_chain and ++ /* We don't free locations. They are stored in bp_location array and + update_global_locations will eventually delete them and remove + breakpoints if needed. */ + b->loc = NULL; +@@ -1344,7 +1429,7 @@ static void + insert_breakpoint_locations (void) + { + struct breakpoint *bpt; +- struct bp_location *b, *temp; ++ struct bp_location *b, **bp_tmp; + int error = 0; + int val = 0; + int disabled_breaks = 0; +@@ -1357,7 +1442,7 @@ insert_breakpoint_locations (void) + there was an error. */ + fprintf_unfiltered (tmp_error_stream, "Warning:\n"); + +- ALL_BP_LOCATIONS_SAFE (b, temp) ++ ALL_BP_LOCATIONS (b, bp_tmp) + { + if (!should_be_inserted (b) || b->inserted) + continue; +@@ -1431,10 +1516,10 @@ You may have requested too many hardware breakpoints/watchpoints.\n"); + int + remove_breakpoints (void) + { +- struct bp_location *b; ++ struct bp_location *b, **bp_tmp; + int val = 0; + +- ALL_BP_LOCATIONS (b) ++ ALL_BP_LOCATIONS (b, bp_tmp) + { + if (b->inserted) + val |= remove_breakpoint (b, mark_uninserted); +@@ -1445,10 +1530,10 @@ remove_breakpoints (void) + int + remove_hw_watchpoints (void) + { +- struct bp_location *b; ++ struct bp_location *b, **bp_tmp; + int val = 0; + +- ALL_BP_LOCATIONS (b) ++ ALL_BP_LOCATIONS (b, bp_tmp) + { + if (b->inserted && b->loc_type == bp_loc_hardware_watchpoint) + val |= remove_breakpoint (b, mark_uninserted); +@@ -1459,7 +1544,7 @@ remove_hw_watchpoints (void) + int + reattach_breakpoints (int pid) + { +- struct bp_location *b; ++ struct bp_location *b, **bp_tmp; + 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) + make_cleanup_ui_file_delete (tmp_error_stream); + + inferior_ptid = pid_to_ptid (pid); +- ALL_BP_LOCATIONS (b) ++ ALL_BP_LOCATIONS (b, bp_tmp) + { + if (b->inserted) + { +@@ -1566,12 +1651,42 @@ create_longjmp_master_breakpoint (char *func_name) + update_global_location_list (1); + } + ++/* Install a master breakpoint on the unwinder's debug hook. */ ++ ++void ++create_exception_master_breakpoint (void) ++{ ++ struct objfile *objfile; ++ ++ ALL_OBJFILES (objfile) ++ { ++ struct minimal_symbol *debug_hook; ++ ++ debug_hook = lookup_minimal_symbol_text ("_Unwind_DebugHook", objfile); ++ if (debug_hook != NULL) ++ { ++ CORE_ADDR pc; ++ struct breakpoint *b; ++ ++ pc = find_function_start_pc (get_objfile_arch (objfile), ++ SYMBOL_VALUE_ADDRESS (debug_hook), ++ SYMBOL_OBJ_SECTION (debug_hook)); ++ b = create_internal_breakpoint (get_objfile_arch (objfile), ++ pc, bp_exception_master); ++ b->addr_string = xstrdup ("_Unwind_DebugHook"); ++ b->enable_state = bp_disabled; ++ } ++ } ++ ++ update_global_location_list (1); ++} ++ + void + update_breakpoints_after_exec (void) + { + struct breakpoint *b; + struct breakpoint *temp; +- struct bp_location *bploc; ++ struct bp_location *bploc, **bplocp_tmp; + + /* 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) + 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. */ +- ALL_BP_LOCATIONS (bploc) ++ ALL_BP_LOCATIONS (bploc, bplocp_tmp) + gdb_assert (!bploc->inserted); + + ALL_BREAKPOINTS_SAFE (b, temp) +@@ -1603,7 +1718,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 +- || b->type == bp_longjmp_master) ++ || b->type == bp_longjmp_master || b->type == bp_exception_master) + { + delete_breakpoint (b); + continue; +@@ -1618,7 +1733,8 @@ update_breakpoints_after_exec (void) + + /* Longjmp and longjmp-resume breakpoints are also meaningless + after an exec. */ +- if (b->type == bp_longjmp || b->type == bp_longjmp_resume) ++ if (b->type == bp_longjmp || b->type == bp_longjmp_resume ++ || b->type == bp_exception || b->type == bp_exception_resume) + { + delete_breakpoint (b); + continue; +@@ -1679,12 +1795,13 @@ update_breakpoints_after_exec (void) + create_longjmp_master_breakpoint ("_longjmp"); + create_longjmp_master_breakpoint ("siglongjmp"); + create_longjmp_master_breakpoint ("_siglongjmp"); ++ create_exception_master_breakpoint (); + } + + int + detach_breakpoints (int pid) + { +- struct bp_location *b; ++ struct bp_location *b, **bp_tmp; + int val = 0; + struct cleanup *old_chain = save_inferior_ptid (); + +@@ -1693,11 +1810,12 @@ detach_breakpoints (int pid) + + /* Set inferior_ptid; remove_breakpoint uses this global. */ + inferior_ptid = pid_to_ptid (pid); +- ALL_BP_LOCATIONS (b) ++ ALL_BP_LOCATIONS (b, bp_tmp) + { if (b->inserted) val |= remove_breakpoint (b, mark_inserted); } @@ -581,7 +914,7 @@ index f3940e1..2349fbc 100644 do_cleanups (old_chain); return val; } -@@ -1782,12 +1796,14 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) +@@ -1790,12 +1908,14 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) return val; b->inserted = (is == mark_inserted); } @@ -598,7 +931,120 @@ index f3940e1..2349fbc 100644 val = target_remove_watchpoint (b->address, b->length, b->watchpoint_type); -@@ -2961,8 +2977,12 @@ bpstat_check_location (const struct bp_location *bl, CORE_ADDR bp_addr) +@@ -1824,9 +1944,9 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is) + void + mark_breakpoints_out (void) + { +- struct bp_location *bpt; ++ struct bp_location *bpt, **bptp_tmp; + +- ALL_BP_LOCATIONS (bpt) ++ ALL_BP_LOCATIONS (bpt, bptp_tmp) + bpt->inserted = 0; + } + +@@ -1846,7 +1966,7 @@ void + breakpoint_init_inferior (enum inf_context context) + { + struct breakpoint *b, *temp; +- struct bp_location *bpt; ++ struct bp_location *bpt, **bptp_tmp; + int ix; + + /* If breakpoint locations are shared across processes, then there's +@@ -1854,7 +1974,7 @@ breakpoint_init_inferior (enum inf_context context) + if (gdbarch_has_global_breakpoints (target_gdbarch)) + return; + +- ALL_BP_LOCATIONS (bpt) ++ ALL_BP_LOCATIONS (bpt, bptp_tmp) + if (bpt->owner->enable_state != bp_permanent) + bpt->inserted = 0; + +@@ -1915,10 +2035,10 @@ breakpoint_init_inferior (enum inf_context context) + enum breakpoint_here + breakpoint_here_p (CORE_ADDR pc) + { +- const struct bp_location *bpt; ++ struct bp_location *bpt, **bptp_tmp; + int any_breakpoint_here = 0; + +- ALL_BP_LOCATIONS (bpt) ++ ALL_BP_LOCATIONS (bpt, bptp_tmp) + { + 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) + } + + /* Returns non-zero if there's a breakpoint inserted at PC, which is +- inserted using regular breakpoint_chain/bp_location_chain mechanism. ++ inserted using regular breakpoint_chain / bp_location array mechanism. + This does not check for single-step breakpoints, which are + inserted and removed using direct target manipulation. */ + + int + regular_breakpoint_inserted_here_p (CORE_ADDR pc) + { +- const struct bp_location *bpt; ++ struct bp_location *bpt, **bptp_tmp; + +- ALL_BP_LOCATIONS (bpt) ++ ALL_BP_LOCATIONS (bpt, bptp_tmp) + { + 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) + int + software_breakpoint_inserted_here_p (CORE_ADDR pc) + { +- const struct bp_location *bpt; ++ struct bp_location *bpt, **bptp_tmp; + int any_breakpoint_here = 0; + +- ALL_BP_LOCATIONS (bpt) ++ ALL_BP_LOCATIONS (bpt, bptp_tmp) + { + if (bpt->loc_type != bp_loc_software_breakpoint) + continue; +@@ -2041,12 +2161,12 @@ software_breakpoint_inserted_here_p (CORE_ADDR pc) + int + breakpoint_thread_match (CORE_ADDR pc, ptid_t ptid) + { +- const struct bp_location *bpt; ++ struct bp_location *bpt, **bptp_tmp; + /* The thread and task IDs associated to PTID, computed lazily. */ + int thread = -1; + int task = 0; + +- ALL_BP_LOCATIONS (bpt) ++ ALL_BP_LOCATIONS (bpt, bptp_tmp) + { + if (bpt->loc_type != bp_loc_software_breakpoint + && bpt->loc_type != bp_loc_hardware_breakpoint) +@@ -2500,6 +2620,12 @@ print_it_typical (bpstat bs) + result = PRINT_NOTHING; + break; + ++ case bp_exception_master: ++ /* These should never be enabled. */ ++ printf_filtered (_("Exception Master Breakpoint: gdb should not stop!\n")); ++ result = PRINT_NOTHING; ++ break; ++ + case bp_watchpoint: + case bp_hardware_watchpoint: + annotate_watchpoint (b->number); +@@ -2587,6 +2713,8 @@ print_it_typical (bpstat bs) + case bp_none: + case bp_longjmp: + case bp_longjmp_resume: ++ case bp_exception: ++ case bp_exception_resume: + 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) /* If BS refers to a watchpoint, determine if the watched values has actually changed, and we should stop. If not, set BS->stop @@ -613,7 +1059,7 @@ index f3940e1..2349fbc 100644 bpstat_check_watchpoint (bpstat bs) { const struct bp_location *bl = bs->breakpoint_at; -@@ -3051,8 +3071,10 @@ bpstat_check_watchpoint (bpstat bs) +@@ -3060,8 +3192,10 @@ bpstat_check_watchpoint (bpstat bs) anything for this watchpoint. */ bs->print_it = print_it_noop; bs->stop = 0; @@ -624,16 +1070,30 @@ index f3940e1..2349fbc 100644 } -@@ -3156,6 +3178,8 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) +@@ -3154,17 +3288,19 @@ bpstat + bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) + { + struct breakpoint *b = NULL; +- const struct bp_location *bl; ++ struct bp_location *bl, **blp_tmp; + struct bp_location *loc; + /* Root of the chain of bpstat's */ + struct bpstats root_bs[1]; + /* Pointer to the last thing in the chain currently. */ + bpstat bs = root_bs; + int ix; +- int need_remove_insert; ++ int need_remove_insert, update_locations = 0; - ALL_BP_LOCATIONS (bl) +- ALL_BP_LOCATIONS (bl) ++ ALL_BP_LOCATIONS (bl, blp_tmp) { + bpstat bs_prev = bs; + b = bl->owner; gdb_assert (b); if (!breakpoint_enabled (b) && b->enable_state != bp_permanent) -@@ -3176,6 +3200,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) +@@ -3185,6 +3321,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 */ @@ -641,7 +1101,7 @@ index f3940e1..2349fbc 100644 /* Assume we stop. Should we find watchpoint that is not actually triggered, or if condition of breakpoint is false, we'll reset -@@ -3183,9 +3208,18 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) +@@ -3192,12 +3329,21 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) bs->stop = 1; bs->print = 1; @@ -662,8 +1122,723 @@ index f3940e1..2349fbc 100644 + } if (b->type == bp_thread_event || b->type == bp_overlay_event - || b->type == bp_longjmp_master) -@@ -8843,6 +8877,22 @@ all_tracepoints () +- || b->type == bp_longjmp_master) ++ || b->type == bp_longjmp_master || b->type == bp_exception_master) + /* We do not stop for these. */ + bs->stop = 0; + else +@@ -3205,14 +3351,15 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) + + if (bs->stop) + { +- ++(b->hit_count); ++ if (b->enable_state != bp_disabled) ++ ++(b->hit_count); + + /* We will stop here */ + if (b->disposition == disp_disable) + { + if (b->enable_state != bp_permanent) + b->enable_state = bp_disabled; +- update_global_location_list (0); ++ update_locations = 1; + } + if (b->silent) + bs->print = 0; +@@ -3232,6 +3379,10 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid) + bs->print_it = print_it_noop; + } + ++ /* Delay this call which would break the ALL_BP_LOCATIONS iteration above. */ ++ if (update_locations) ++ update_global_location_list (0); ++ + 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) + struct bpstat_what retval; + + retval.call_dummy = 0; ++ retval.is_longjmp = 0; + for (; bs != NULL; bs = bs->next) + { + enum class bs_class = no_effect; +@@ -3455,10 +3607,15 @@ bpstat_what (bpstat bs) + bs_class = no_effect; + break; + case bp_longjmp: ++ case bp_exception: + bs_class = long_jump; ++ retval.is_longjmp = bs->breakpoint_at->owner->type == bp_longjmp; + break; + case bp_longjmp_resume: ++ case bp_exception_resume: + bs_class = long_resume; ++ retval.is_longjmp ++ = bs->breakpoint_at->owner->type == bp_longjmp_resume; + break; + case bp_step_resume: + if (bs->stop) +@@ -3481,6 +3638,7 @@ bpstat_what (bpstat bs) + case bp_thread_event: + case bp_overlay_event: + case bp_longjmp_master: ++ case bp_exception_master: + bs_class = bp_nostop; + break; + case bp_catchpoint: +@@ -3602,6 +3760,8 @@ print_one_breakpoint_location (struct breakpoint *b, + {bp_access_watchpoint, "acc watchpoint"}, + {bp_longjmp, "longjmp"}, + {bp_longjmp_resume, "longjmp resume"}, ++ {bp_exception, "exception"}, ++ {bp_exception_resume, "exception resume"}, + {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, + {bp_thread_event, "thread events"}, + {bp_overlay_event, "overlay events"}, + {bp_longjmp_master, "longjmp master"}, ++ {bp_exception_master, "exception master"}, + {bp_catchpoint, "catchpoint"}, + {bp_tracepoint, "tracepoint"}, + {bp_jit_event, "jit events"}, +@@ -3732,6 +3893,8 @@ print_one_breakpoint_location (struct breakpoint *b, + case bp_finish: + case bp_longjmp: + case bp_longjmp_resume: ++ case bp_exception: ++ case bp_exception_resume: + case bp_step_resume: + case bp_watchpoint_scope: + case bp_call_dummy: +@@ -3739,6 +3902,7 @@ print_one_breakpoint_location (struct breakpoint *b, + case bp_thread_event: + case bp_overlay_event: + case bp_longjmp_master: ++ case bp_exception_master: + 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, + (or use it for any other purpose either). + + More specifically, each of the following breakpoint types will always +- have a zero valued address and we don't want check_duplicates() to mark +- breakpoints of any of these types to be a duplicate of an actual +- breakpoint at address zero: ++ have a zero valued address and we don't want to mark breakpoints of any of ++ these types to be a duplicate of an actual breakpoint at address zero: + + bp_watchpoint + bp_hardware_watchpoint +@@ -4216,88 +4379,6 @@ breakpoint_address_is_meaningful (struct breakpoint *bpt) + && type != bp_catchpoint); + } + +-/* Rescan breakpoints at the same address and section as BPT, +- marking the first one as "first" and any others as "duplicates". +- This is so that the bpt instruction is only inserted once. +- If we have a permanent breakpoint at the same place as BPT, make +- that one the official one, and the rest as duplicates. */ +- +-static void +-check_duplicates_for (CORE_ADDR address, struct obj_section *section) +-{ +- struct bp_location *b; +- int count = 0; +- struct bp_location *perm_bp = 0; +- +- ALL_BP_LOCATIONS (b) +- if (b->owner->enable_state != bp_disabled +- && b->owner->enable_state != bp_call_disabled +- && b->owner->enable_state != bp_startup_disabled +- && b->enabled +- && !b->shlib_disabled +- && b->address == address /* address / overlay match */ +- && (!overlay_debugging || b->section == section) +- && breakpoint_address_is_meaningful (b->owner)) +- { +- /* Have we found a permanent breakpoint? */ +- if (b->owner->enable_state == bp_permanent) +- { +- perm_bp = b; +- break; +- } +- +- count++; +- b->duplicate = count > 1; +- } +- +- /* If we found a permanent breakpoint at this address, go over the +- list again and declare all the other breakpoints there (except +- other permanent breakpoints) to be the duplicates. */ +- if (perm_bp) +- { +- perm_bp->duplicate = 0; +- +- /* Permanent breakpoint should always be inserted. */ +- if (! perm_bp->inserted) +- internal_error (__FILE__, __LINE__, +- _("allegedly permanent breakpoint is not " +- "actually inserted")); +- +- ALL_BP_LOCATIONS (b) +- if (b != perm_bp) +- { +- if (b->owner->enable_state != bp_permanent +- && b->owner->enable_state != bp_disabled +- && b->owner->enable_state != bp_call_disabled +- && b->owner->enable_state != bp_startup_disabled +- && b->enabled && !b->shlib_disabled +- && b->address == address /* address / overlay match */ +- && (!overlay_debugging || b->section == section) +- && breakpoint_address_is_meaningful (b->owner)) +- { +- if (b->inserted) +- internal_error (__FILE__, __LINE__, +- _("another breakpoint was inserted on top of " +- "a permanent breakpoint")); +- +- b->duplicate = 1; +- } +- } +- } +-} +- +-static void +-check_duplicates (struct breakpoint *bpt) +-{ +- struct bp_location *bl = bpt->loc; +- +- if (! breakpoint_address_is_meaningful (bpt)) +- return; +- +- for (; bl; bl = bl->next) +- check_duplicates_for (bl->address, bl->section); +-} +- + 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) + case bp_finish: + case bp_longjmp: + case bp_longjmp_resume: ++ case bp_exception: ++ case bp_exception_resume: + case bp_step_resume: + case bp_watchpoint_scope: + case bp_call_dummy: +@@ -4387,6 +4470,7 @@ allocate_bp_location (struct breakpoint *bpt) + case bp_overlay_event: + case bp_jit_event: + case bp_longjmp_master: ++ case bp_exception_master: + loc->loc_type = bp_loc_software_breakpoint; + break; + case bp_hardware_breakpoint: +@@ -4564,8 +4648,7 @@ make_breakpoint_permanent (struct breakpoint *b) + } + + /* Call this routine when stepping and nexting to enable a breakpoint +- if we do a longjmp() in THREAD. When we hit that breakpoint, call +- set_longjmp_resume_breakpoint() to figure out where we are going. */ ++ if we do a longjmp() or 'throw' in THREAD. */ + + void + set_longjmp_breakpoint (int thread) +@@ -4577,10 +4660,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) +- if (b->type == bp_longjmp_master) ++ if (b->type == bp_longjmp_master || b->type == bp_exception_master) + { + struct breakpoint *clone = clone_momentary_breakpoint (b); +- clone->type = bp_longjmp; ++ clone->type = b->type == bp_longjmp_master ? bp_longjmp : bp_exception; + clone->thread = thread; + } + } +@@ -4592,7 +4675,7 @@ delete_longjmp_breakpoint (int thread) + struct breakpoint *b, *temp; + + ALL_BREAKPOINTS_SAFE (b, temp) +- if (b->type == bp_longjmp) ++ if (b->type == bp_longjmp || b->type == bp_exception) + { + if (b->thread == thread) + delete_breakpoint (b); +@@ -4706,9 +4789,9 @@ create_solib_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address) + void + disable_breakpoints_in_shlibs (void) + { +- struct bp_location *loc; ++ struct bp_location *loc, **locp_tmp; + +- ALL_BP_LOCATIONS (loc) ++ ALL_BP_LOCATIONS (loc, locp_tmp) + { + struct breakpoint *b = loc->owner; + /* We apply the check to all breakpoints, including disabled +@@ -4738,7 +4821,7 @@ disable_breakpoints_in_shlibs (void) + static void + disable_breakpoints_in_unloaded_shlib (struct so_list *solib) + { +- struct bp_location *loc; ++ struct bp_location *loc, **locp_tmp; + 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) + && bfd_get_flavour (exec_bfd) == bfd_target_aout_flavour) + return; + +- ALL_BP_LOCATIONS (loc) ++ ALL_BP_LOCATIONS (loc, locp_tmp) + { + struct breakpoint *b = loc->owner; + if ((loc->loc_type == bp_loc_hardware_breakpoint +@@ -5354,6 +5437,8 @@ mention (struct breakpoint *b) + case bp_finish: + case bp_longjmp: + case bp_longjmp_resume: ++ case bp_exception: ++ case bp_exception_resume: + case bp_step_resume: + case bp_call_dummy: + case bp_watchpoint_scope: +@@ -5362,6 +5447,7 @@ mention (struct breakpoint *b) + case bp_overlay_event: + case bp_jit_event: + case bp_longjmp_master: ++ case bp_exception_master: + break; + } + +@@ -6664,6 +6750,7 @@ struct until_break_command_continuation_args + { + struct breakpoint *breakpoint; + struct breakpoint *breakpoint2; ++ int thread_num; + }; + + /* This function is called by fetch_inferior_event via the +@@ -6678,6 +6765,7 @@ until_break_command_continuation (void *arg) + delete_breakpoint (a->breakpoint); + if (a->breakpoint2) + delete_breakpoint (a->breakpoint2); ++ delete_longjmp_breakpoint (a->thread_num); + } + + void +@@ -6689,6 +6777,8 @@ until_break_command (char *arg, int from_tty, int anywhere) + struct breakpoint *breakpoint; + struct breakpoint *breakpoint2 = NULL; + struct cleanup *old_chain; ++ int thread; ++ struct thread_info *tp; + + clear_proceed_status (); + +@@ -6727,6 +6817,9 @@ until_break_command (char *arg, int from_tty, int anywhere) + + old_chain = make_cleanup_delete_breakpoint (breakpoint); + ++ tp = inferior_thread (); ++ thread = tp->num; ++ + /* 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) + frame_unwind_caller_id (frame), + bp_until); + make_cleanup_delete_breakpoint (breakpoint2); ++ ++ set_longjmp_breakpoint (thread); ++ tp->initiating_frame = frame_unwind_caller_id (frame); ++ make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); + } + + proceed (-1, TARGET_SIGNAL_DEFAULT, 0); +@@ -6755,6 +6852,7 @@ until_break_command (char *arg, int from_tty, int anywhere) + + args->breakpoint = breakpoint; + args->breakpoint2 = breakpoint2; ++ args->thread_num = thread; + + discard_cleanups (old_chain); + add_continuation (inferior_thread (), +@@ -7357,6 +7455,82 @@ do_vec_free (void *p) + VEC_free (bp_location_p, *vec); + } + ++/* A comparison function for bp_location A and B being interfaced to qsort. ++ Sort elements primarily by their ADDRESS (no matter what does ++ breakpoint_address_is_meaningful say for its OWNER), secondarily by ordering ++ first bp_permanent OWNERed elements and terciarily just ensuring the array ++ is sorted stable way despite qsort being an instable algorithm. */ ++ ++static int ++bp_location_compare (struct bp_location *a, struct bp_location *b) ++{ ++ int a_perm = a->owner->enable_state == bp_permanent; ++ int b_perm = b->owner->enable_state == bp_permanent; ++ ++ if (a->address != b->address) ++ return (a->address > b->address) - (a->address < b->address); ++ ++ /* Sort permanent breakpoints first. */ ++ if (a_perm != b_perm) ++ return (a_perm < b_perm) - (a_perm > b_perm); ++ ++ /* Make the user-visible order stable across GDB runs. Locations of the same ++ breakpoint can be sorted in arbitrary order. */ ++ ++ if (a->owner->number != b->owner->number) ++ return (a->owner->number > b->owner->number) ++ - (a->owner->number < b->owner->number); ++ ++ return (a > b) - (a < b); ++} ++ ++/* Interface bp_location_compare as the COMPAR parameter of qsort function. */ ++ ++static int ++bp_location_compare_for_qsort (const void *ap, const void *bp) ++{ ++ struct bp_location *a = *(void **) ap; ++ struct bp_location *b = *(void **) bp; ++ ++ return bp_location_compare (a, b); ++} ++ ++/* Set bp_location_placed_address_before_address_max and ++ bp_location_shadow_len_after_address_max according to the current content of ++ the bp_location array. */ ++ ++static void ++bp_location_target_extensions_update (void) ++{ ++ struct bp_location *bl, **blp_tmp; ++ ++ bp_location_placed_address_before_address_max = 0; ++ bp_location_shadow_len_after_address_max = 0; ++ ++ ALL_BP_LOCATIONS (bl, blp_tmp) ++ { ++ CORE_ADDR start, end, addr; ++ ++ if (!bp_location_has_shadow (bl)) ++ continue; ++ ++ start = bl->target_info.placed_address; ++ end = start + bl->target_info.shadow_len; ++ ++ gdb_assert (bl->address >= start); ++ addr = bl->address - start; ++ if (addr > bp_location_placed_address_before_address_max) ++ bp_location_placed_address_before_address_max = addr; ++ ++ /* Zero SHADOW_LEN would not pass bp_location_has_shadow. */ ++ ++ gdb_assert (bl->address < end); ++ addr = end - bl->address; ++ if (addr > bp_location_shadow_len_after_address_max) ++ bp_location_shadow_len_after_address_max = addr; ++ } ++} ++ + /* 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 + update_global_location_list (int should_insert) + { + struct breakpoint *b; +- struct bp_location **next = &bp_location_chain; +- struct bp_location *loc; +- struct bp_location *loc2; +- VEC(bp_location_p) *old_locations = NULL; +- int ret; +- int ix; ++ struct bp_location **locp, *loc; + struct cleanup *cleanups; + +- cleanups = make_cleanup (do_vec_free, &old_locations); +- /* Store old locations for future reference. */ +- for (loc = bp_location_chain; loc; loc = loc->global_next) +- VEC_safe_push (bp_location_p, old_locations, loc); ++ /* The first bp_location being the only one non-DUPLICATE for the current run ++ of the same ADDRESS. */ ++ struct bp_location *loc_first; ++ ++ /* Saved former bp_location array which we compare against the newly built ++ bp_location from the current state of ALL_BREAKPOINTS. */ ++ struct bp_location **old_location, **old_locp; ++ unsigned old_location_count; ++ ++ old_location = bp_location; ++ old_location_count = bp_location_count; ++ bp_location = NULL; ++ bp_location_count = 0; ++ cleanups = make_cleanup (xfree, old_location); + +- bp_location_chain = NULL; + ALL_BREAKPOINTS (b) +- { +- for (loc = b->loc; loc; loc = loc->next) +- { +- *next = loc; +- next = &(loc->global_next); +- *next = NULL; +- } +- } ++ for (loc = b->loc; loc; loc = loc->next) ++ bp_location_count++; ++ ++ bp_location = xmalloc (sizeof (*bp_location) * bp_location_count); ++ locp = bp_location; ++ ALL_BREAKPOINTS (b) ++ for (loc = b->loc; loc; loc = loc->next) ++ *locp++ = loc; ++ qsort (bp_location, bp_location_count, sizeof (*bp_location), ++ bp_location_compare_for_qsort); ++ ++ bp_location_target_extensions_update (); + + /* Identify bp_location instances that are no longer present in the new + list, and therefore should be freed. Note that it's not necessary that + those locations should be removed from inferior -- if there's another + location at the same address (previously marked as duplicate), +- we don't need to remove/insert the location. */ +- for (ix = 0; VEC_iterate(bp_location_p, old_locations, ix, loc); ++ix) ++ we don't need to remove/insert the location. ++ ++ LOCP is kept in sync with OLD_LOCP, each pointing to the current and ++ former bp_location array state respectively. */ ++ ++ locp = bp_location; ++ for (old_locp = old_location; old_locp < old_location + old_location_count; ++ old_locp++) + { +- /* Tells if 'loc' is found amoung the new locations. If not, we ++ struct bp_location *old_loc = *old_locp; ++ ++ /* Tells if 'old_loc' is found amoung the new locations. If not, we + have to free it. */ +- int found_object = 0; ++ int found_object; + /* Tells if the location should remain inserted in the target. */ + int keep_in_target = 0; + int removed = 0; +- for (loc2 = bp_location_chain; loc2; loc2 = loc2->global_next) +- if (loc2 == loc) +- { +- found_object = 1; +- break; +- } ++ ++ /* Skip LOCP entries which will definitely never be needed. Stop either ++ at or being the one matching OLD_LOC. */ ++ while (locp < bp_location + bp_location_count ++ && bp_location_compare (*locp, old_loc) < 0) ++ locp++; ++ found_object = locp < bp_location + bp_location_count && *locp == old_loc; + + /* 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) + don't have a time window where a breakpoint at certain location is not + inserted. */ + +- if (loc->inserted) ++ if (old_loc->inserted) + { + /* If the location is inserted now, we might have to remove it. */ + +- if (found_object && should_be_inserted (loc)) ++ if (found_object && should_be_inserted (old_loc)) + { + /* 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) + /* 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. */ +- if (breakpoint_address_is_meaningful (loc->owner)) +- for (loc2 = bp_location_chain; loc2; loc2 = loc2->global_next) +- { +- /* For the sake of should_insert_location. The +- call to check_duplicates will fix up this later. */ +- loc2->duplicate = 0; +- if (should_be_inserted (loc2) +- && loc2 != loc && loc2->address == loc->address) +- { +- loc2->inserted = 1; +- loc2->target_info = loc->target_info; +- keep_in_target = 1; +- break; +- } +- } ++ ++ if (breakpoint_address_is_meaningful (old_loc->owner)) ++ { ++ struct bp_location **loc2p; ++ ++ for (loc2p = locp; ++ loc2p < bp_location + bp_location_count ++ && (*loc2p)->address == old_loc->address; ++ loc2p++) ++ { ++ struct bp_location *loc2 = *loc2p; ++ ++ /* For the sake of should_be_inserted. ++ Duplicates check below will fix up this later. */ ++ loc2->duplicate = 0; ++ if (loc2 != old_loc && should_be_inserted (loc2)) ++ { ++ loc2->inserted = 1; ++ loc2->target_info = old_loc->target_info; ++ keep_in_target = 1; ++ break; ++ } ++ } ++ } + } + + if (!keep_in_target) + { +- if (remove_breakpoint (loc, mark_uninserted)) ++ if (remove_breakpoint (old_loc, mark_uninserted)) + { + /* This is just about all we can do. We could keep this + location on the global list, and try to remove it next + time, but there's no particular reason why we will + succeed next time. + +- Note that at this point, loc->owner is still valid, ++ Note that at this point, old_loc->owner is still valid, + as delete_breakpoint frees the breakpoint only + after calling us. */ + printf_filtered (_("warning: Error removing breakpoint %d\n"), +- loc->owner->number); ++ old_loc->owner->number); + } + removed = 1; + } +@@ -7493,19 +7693,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. */ +- loc->events_till_retirement = 3 * (thread_count () + 1); +- loc->owner = NULL; ++ old_loc->events_till_retirement = 3 * (thread_count () + 1); ++ old_loc->owner = NULL; + +- VEC_safe_push (bp_location_p, moribund_locations, loc); ++ VEC_safe_push (bp_location_p, moribund_locations, old_loc); + } + else +- free_bp_location (loc); ++ free_bp_location (old_loc); + } + } + +- ALL_BREAKPOINTS (b) ++ /* Rescan breakpoints at the same address and section, ++ marking the first one as "first" and any others as "duplicates". ++ This is so that the bpt instruction is only inserted once. ++ If we have a permanent breakpoint at the same place as BPT, make ++ that one the official one, and the rest as duplicates. Permanent ++ breakpoints are sorted first for the same address. */ ++ ++ loc_first = NULL; ++ ALL_BP_LOCATIONS (loc, locp) + { +- check_duplicates (b); ++ struct breakpoint *b = loc->owner; ++ ++ if (b->enable_state == bp_disabled ++ || b->enable_state == bp_call_disabled ++ || b->enable_state == bp_startup_disabled ++ || !loc->enabled ++ || loc->shlib_disabled ++ || !breakpoint_address_is_meaningful (b)) ++ continue; ++ ++ /* Permanent breakpoint should always be inserted. */ ++ if (b->enable_state == bp_permanent && ! loc->inserted) ++ internal_error (__FILE__, __LINE__, ++ _("allegedly permanent breakpoint is not " ++ "actually inserted")); ++ ++ if (loc_first == NULL ++ /* address / overlay match */ ++ || loc->address != loc_first->address ++ || (overlay_debugging && loc->section != loc_first->section)) ++ { ++ loc_first = loc; ++ loc->duplicate = 0; ++ continue; ++ } ++ ++ loc->duplicate = 1; ++ ++ if (loc_first->owner->enable_state == bp_permanent && loc->inserted ++ && b->enable_state != bp_permanent) ++ internal_error (__FILE__, __LINE__, ++ _("another breakpoint was inserted on top of " ++ "a permanent breakpoint")); + } + + if (breakpoints_always_inserted_mode () && should_insert +@@ -7681,6 +7921,7 @@ delete_command (char *arg, int from_tty) + && b->type != bp_thread_event + && b->type != bp_overlay_event + && b->type != bp_longjmp_master ++ && b->type != bp_exception_master + && b->number >= 0) + { + breaks_to_delete = 1; +@@ -7700,6 +7941,7 @@ delete_command (char *arg, int from_tty) + && b->type != bp_jit_event + && b->type != bp_overlay_event + && b->type != bp_longjmp_master ++ && b->type != bp_exception_master + && b->number >= 0) + delete_breakpoint (b); + } +@@ -8002,6 +8244,7 @@ breakpoint_re_set_one (void *bint) + reset later by breakpoint_re_set. */ + case bp_overlay_event: + case bp_longjmp_master: ++ case bp_exception_master: + delete_breakpoint (b); + break; + +@@ -8025,6 +8268,8 @@ breakpoint_re_set_one (void *bint) + case bp_longjmp: + case bp_longjmp_resume: + case bp_jit_event: ++ case bp_exception: ++ case bp_exception_resume: + break; + } + +@@ -8060,6 +8305,7 @@ breakpoint_re_set (void) + create_longjmp_master_breakpoint ("_longjmp"); + create_longjmp_master_breakpoint ("siglongjmp"); + create_longjmp_master_breakpoint ("_siglongjmp"); ++ create_exception_master_breakpoint (); + } + + /* Reset the thread number of this breakpoint: +@@ -8871,6 +9117,22 @@ all_tracepoints () return tp_vec; } @@ -686,17 +1861,63 @@ index f3940e1..2349fbc 100644 /* This help string is used for the break, hbreak, tbreak and thbreak commands. It is defined as a macro to prevent duplication. -@@ -9345,4 +9395,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."), +@@ -9373,4 +9635,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 d93c6b6..a555c16 100644 +index 70b1398..0f05b5a 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h -@@ -918,6 +918,9 @@ extern void breakpoint_retire_moribund (void); +@@ -55,6 +55,13 @@ enum bptype + bp_longjmp, /* secret breakpoint to find longjmp() */ + bp_longjmp_resume, /* secret breakpoint to escape longjmp() */ + ++ /* An internal breakpoint that is installed on the unwinder's ++ debug hook. */ ++ bp_exception, ++ /* An internal breakpoint that is set at the point where an ++ exception will land. */ ++ bp_exception_resume, ++ + /* 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 + + bp_longjmp_master, + ++ /* Like bp_longjmp_master, but for exceptions. */ ++ bp_exception_master, ++ + bp_catchpoint, + + bp_tracepoint, +@@ -227,10 +237,6 @@ struct bp_location + the same parent breakpoint. */ + struct bp_location *next; + +- /* Pointer to the next breakpoint location, in a global +- list of all breakpoint locations. */ +- struct bp_location *global_next; +- + /* Type of this breakpoint location. */ + enum bp_loc_type loc_type; + +@@ -573,6 +579,10 @@ struct bpstat_what + continuing from a call dummy without popping the frame is not a + useful one). */ + int call_dummy; ++ ++ /* Used for BPSTAT_WHAT_SET_LONGJMP_RESUME. True if we are ++ handling a longjmp, false if we are handling an exception. */ ++ int is_longjmp; + }; + + /* The possible return values for print_bpstat, print_it_normal, +@@ -927,6 +937,9 @@ extern void breakpoint_retire_moribund (void); /* Tell a breakpoint to be quiet. */ extern void make_breakpoint_silent (struct breakpoint *); @@ -707,7 +1928,7 @@ index d93c6b6..a555c16 100644 extern struct breakpoint *get_tracepoint (int num); diff --git a/gdb/c-exp.y b/gdb/c-exp.y -index aacc112..e206983 100644 +index f8e4f12..5b47e2e 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -117,6 +117,8 @@ static int yylex (void); @@ -740,33 +1961,6 @@ index aacc112..e206983 100644 /* Special type cases, put in to allow the parser to distinguish different legal basetypes. */ -@@ -232,7 +238,7 @@ static int parse_number (char *, int, int, YYSTYPE *); - %left '+' '-' - %left '*' '/' '%' - %right UNARY INCREMENT DECREMENT --%right ARROW '.' '[' '(' -+%right ARROW ARROW_STAR '.' DOT_STAR '[' '(' - %token BLOCKNAME - %token FILENAME - %type block -@@ -333,7 +339,7 @@ exp : exp ARROW qualified_name - write_exp_elt_opcode (STRUCTOP_MPTR); } - ; - --exp : exp ARROW '*' exp -+exp : exp ARROW_STAR exp - { write_exp_elt_opcode (STRUCTOP_MPTR); } - ; - -@@ -368,7 +374,7 @@ exp : exp '.' qualified_name - write_exp_elt_opcode (STRUCTOP_MEMBER); } - ; - --exp : exp '.' '*' exp -+exp : exp DOT_STAR exp - { write_exp_elt_opcode (STRUCTOP_MEMBER); } - ; - @@ -401,6 +407,36 @@ arglist : arglist ',' exp %prec ABOVE_COMMA { arglist_len++; } ; @@ -1017,27 +2211,7 @@ index aacc112..e206983 100644 /* Take care of parsing a number (anything that starts with a digit). Set yylval and return the token type; update lexptr. LEN is the number of characters in it. */ -@@ -1664,7 +1845,8 @@ struct token - static const struct token tokentab3[] = - { - {">>=", ASSIGN_MODIFY, BINOP_RSH, 0}, -- {"<<=", ASSIGN_MODIFY, BINOP_LSH, 0} -+ {"<<=", ASSIGN_MODIFY, BINOP_LSH, 0}, -+ {"->*", ARROW_STAR, BINOP_END, 1} - }; - - static const struct token tokentab2[] = -@@ -1688,7 +1870,8 @@ static const struct token tokentab2[] = - {"==", EQUAL, BINOP_END, 0}, - {"!=", NOTEQUAL, BINOP_END, 0}, - {"<=", LEQ, BINOP_END, 0}, -- {">=", GEQ, BINOP_END, 0} -+ {">=", GEQ, BINOP_END, 0}, -+ {".*", DOT_STAR, BINOP_END, 0} - }; - - /* Identifier-like tokens. */ -@@ -1710,6 +1893,9 @@ static const struct token ident_tokens[] = +@@ -1714,6 +1895,9 @@ static const struct token ident_tokens[] = {"long", LONG, OP_NULL, 0}, {"true", TRUEKEYWORD, OP_NULL, 1}, {"int", INT_KEYWORD, OP_NULL, 0}, @@ -1047,7 +2221,7 @@ index aacc112..e206983 100644 {"and", ANDAND, BINOP_END, 1}, {"and_eq", ASSIGN_MODIFY, BINOP_BITWISE_AND, 1}, -@@ -1818,6 +2004,13 @@ static int last_was_structop; +@@ -1822,6 +2006,13 @@ static int last_was_structop; static int yylex (void) { @@ -1061,7 +2235,7 @@ index aacc112..e206983 100644 int c; int namelen; unsigned int i; -@@ -1826,9 +2019,19 @@ yylex (void) +@@ -1830,9 +2021,19 @@ yylex (void) char *copy; last_was_structop = 0; @@ -1083,10 +2257,10 @@ index aacc112..e206983 100644 /* Check if this is a macro invocation that we need to expand. */ if (! scanning_macro_expansion ()) { -@@ -1856,10 +2059,19 @@ yylex (void) - for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++) - if (strncmp (tokstart, tokentab2[i].operator, 2) == 0) - { +@@ -1868,10 +2069,19 @@ yylex (void) + && parse_language->la_language != language_cplus) + break; + + if (tokentab2[i].token == COLONCOLON) + { + name_prefix_len += 2; @@ -1103,7 +2277,7 @@ index aacc112..e206983 100644 return tokentab2[i].token; } -@@ -1888,6 +2100,8 @@ yylex (void) +@@ -1900,6 +2110,8 @@ yylex (void) return 0; case ' ': @@ -1112,7 +2286,7 @@ index aacc112..e206983 100644 case '\t': case '\n': lexptr++; -@@ -2045,11 +2259,13 @@ yylex (void) +@@ -2057,11 +2269,13 @@ yylex (void) error ("Invalid character '%c' in expression.", c); /* It's a name. See how long it is. */ @@ -1126,7 +2300,7 @@ index aacc112..e206983 100644 /* Template parameter lists are part of the name. FIXME: This mishandles `print $a<4&&$a>3'. */ -@@ -2113,14 +2329,29 @@ yylex (void) +@@ -2125,14 +2339,29 @@ yylex (void) currently as names of types; NAME for other symbols. The caller is not constrained to care about the distinction. */ { @@ -1157,7 +2331,7 @@ index aacc112..e206983 100644 /* Call lookup_symtab, not lookup_partial_symtab, in case there are no psymtabs (coff, xcoff, or some future change to blow away the psymtabs once once symbols are read). */ -@@ -2179,6 +2410,7 @@ yylex (void) +@@ -2191,6 +2420,7 @@ yylex (void) yylval.ssym.is_a_field_of_this = is_a_field_of_this; if (in_parse_field && *lexptr == '\0') saw_name_at_eof = 1; @@ -1460,10 +2634,10 @@ index 888f8b4..65494b8 100644 default_symfile_offsets, /* sym_offsets: xlate external to internal form */ default_symfile_segments, /* sym_segments: Get segment information from diff --git a/gdb/config.in b/gdb/config.in -index f2d56a0..0909c80 100644 +index 4716524..0745c65 100644 --- a/gdb/config.in +++ b/gdb/config.in -@@ -43,11 +43,10 @@ +@@ -46,11 +46,10 @@ language is requested. */ #undef ENABLE_NLS @@ -1477,7 +2651,7 @@ index f2d56a0..0909c80 100644 #undef GDB_DATADIR_RELOCATABLE /* Define to be a string naming the default host character set. */ -@@ -641,6 +640,9 @@ +@@ -647,6 +646,9 @@ 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX @@ -1729,19 +2903,27 @@ index 0000000..49ac420 +#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1 + diff --git a/gdb/configure b/gdb/configure -index 93f7f4b..a6580e2 100755 +index 99acc2f..a2ea1ae 100755 --- a/gdb/configure +++ b/gdb/configure -@@ -314,7 +314,7 @@ ac_subdirs_all="$ac_subdirs_all doc testsuite" - ac_subdirs_all="$ac_subdirs_all gdbtk" - ac_subdirs_all="$ac_subdirs_all multi-ice" - ac_subdirs_all="$ac_subdirs_all gdbserver" --ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE DEBUGDIR GDB_DATADIR subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE SYSTEM_GDBINIT WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags GDB_NM_FILE datarootdir docdir htmldir pdfdir LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS' -+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os am__leading_dot DEPDIR CCDEPMODE MAKE GMAKE_TRUE GMAKE_FALSE SET_MAKE USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT localedir GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE GNULIB_MEMMEM GNULIB_MEMPCPY GNULIB_MEMRCHR GNULIB_STPCPY GNULIB_STPNCPY GNULIB_STRCHRNUL GNULIB_STRDUP GNULIB_STRNDUP GNULIB_STRNLEN GNULIB_STRPBRK GNULIB_STRSEP GNULIB_STRSTR GNULIB_STRCASESTR GNULIB_STRTOK_R GNULIB_MBSLEN GNULIB_MBSNLEN GNULIB_MBSCHR GNULIB_MBSRCHR GNULIB_MBSSTR GNULIB_MBSCASECMP GNULIB_MBSNCASECMP GNULIB_MBSPCASECMP GNULIB_MBSCASESTR GNULIB_MBSCSPN GNULIB_MBSPBRK GNULIB_MBSSPN GNULIB_MBSSEP GNULIB_MBSTOK_R GNULIB_STRERROR GNULIB_STRSIGNAL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_STRCASESTR HAVE_DECL_STRTOK_R HAVE_DECL_STRERROR HAVE_DECL_STRSIGNAL REPLACE_STRERROR REPLACE_STRSIGNAL REPLACE_MEMMEM REPLACE_STRCASESTR REPLACE_STRSTR HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H INCLUDE_NEXT NEXT_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H NEXT_STRING_H GNULIB_WCWIDTH HAVE_DECL_WCWIDTH REPLACE_WCWIDTH WCHAR_H HAVE_WCHAR_H NEXT_WCHAR_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS GNULIB_STDINT_H PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK AMTAR am__tar am__untar am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH am__fastdepCC_TRUE am__fastdepCC_FALSE DEBUGDIR GDB_DATADIR GDB_DATADIR_PATH pythondir subdirs TARGET_OBS PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG READLINE READLINE_DEPS READLINE_CFLAGS HAVE_LIBEXPAT LIBEXPAT LTLIBEXPAT PYTHON_CFLAGS ALLOCA CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE SYSTEM_GDBINIT WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_INCLUDE TCL_LIBRARY TCL_DEPS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_INCLUDE TK_LIBRARY TK_DEPS TK_XINCLUDES X_CFLAGS X_LDFLAGS X_LIBS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR SIM SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags GDB_NM_FILE datarootdir docdir htmldir pdfdir LIBOBJS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS gltests_LIBOBJS gltests_LTLIBOBJS' - ac_subst_files='host_makefile_frag' - ac_pwd=`pwd` - -@@ -891,6 +891,10 @@ Optional Packages: +@@ -676,6 +676,8 @@ REPORT_BUGS_TO + PKGVERSION + TARGET_OBS + subdirs ++pythondir ++GDB_DATADIR_PATH + GDB_DATADIR + DEBUGDIR + am__fastdepCC_FALSE +@@ -883,6 +885,7 @@ enable_dependency_tracking + with_separate_debug_dir + with_gdb_datadir + with_relocated_sources ++with_pythondir + enable_targets + enable_64_bit_bfd + enable_gdbcli +@@ -1581,6 +1584,10 @@ Optional Packages: [DATADIR/gdb] --with-relocated-sources=PATH automatically relocate this path for source files @@ -1752,20 +2934,20 @@ index 93f7f4b..a6580e2 100755 --with-libunwind use libunwind frame unwinding support --with-curses use the curses library instead of the termcap library -@@ -7218,6 +7222,75 @@ _ACEOF +@@ -6602,6 +6609,73 @@ _ACEOF + fi - fi; +# GDB's datadir relocation + +gdbdatadir=${datadir}/gdb + + -+# Check whether --with-gdb-datadir or --without-gdb-datadir was given. -+if test "${with_gdb_datadir+set}" = set; then -+ withval="$with_gdb_datadir" -+ gdbdatadir="${withval}" -+fi; ++# Check whether --with-gdb-datadir was given. ++if test "${with_gdb_datadir+set}" = set; then : ++ withval=$with_gdb_datadir; gdbdatadir="${withval}" ++fi ++ + + + test "x$prefix" = xNONE && prefix="$ac_default_prefix" @@ -1793,9 +2975,7 @@ index 93f7f4b..a6580e2 100755 + "${test_prefix}"|"${test_prefix}/"*|\ + '${exec_prefix}'|'${exec_prefix}/'*) + -+cat >>confdefs.h <<\_ACEOF -+#define GDB_DATADIR_RELOCATABLE 1 -+_ACEOF ++$as_echo "#define GDB_DATADIR_RELOCATABLE 1" >>confdefs.h + + ;; +esac @@ -1803,13 +2983,13 @@ index 93f7f4b..a6580e2 100755 + + + -+# Check whether --with-pythondir or --without-pythondir was given. -+if test "${with_pythondir+set}" = set; then -+ withval="$with_pythondir" -+ pythondir="${withval}" ++# Check whether --with-pythondir was given. ++if test "${with_pythondir+set}" = set; then : ++ withval=$with_pythondir; pythondir="${withval}" +else + pythondir=no -+fi; ++fi ++ + +# If the user passed in a path, define it. Otherwise, compute it at +# runtime based on the possibly-relocatable datadir. @@ -1828,7 +3008,7 @@ index 93f7f4b..a6580e2 100755 subdirs="$subdirs doc testsuite" -@@ -11837,6 +11910,8 @@ _ACEOF +@@ -9282,6 +9356,8 @@ $as_echo "#define HAVE_PYTHON 1" >>confdefs.h CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_PYTHON_OBS)" CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)" CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)" @@ -1837,20 +3017,11 @@ index 93f7f4b..a6580e2 100755 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)" # Flags needed to compile Python code (taken from python-config --cflags). -@@ -22174,6 +22249,8 @@ s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t - s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t - s,@DEBUGDIR@,$DEBUGDIR,;t t - s,@GDB_DATADIR@,$GDB_DATADIR,;t t -+s,@GDB_DATADIR_PATH@,$GDB_DATADIR_PATH,;t t -+s,@pythondir@,$pythondir,;t t - s,@subdirs@,$subdirs,;t t - s,@TARGET_OBS@,$TARGET_OBS,;t t - s,@PKGVERSION@,$PKGVERSION,;t t diff --git a/gdb/configure.ac b/gdb/configure.ac -index 77f8436..bca368c 100644 +index b31d9b7..a1969bc 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -109,6 +109,51 @@ AS_HELP_STRING([--with-relocated-sources=PATH], [automatically relocate this pat +@@ -107,6 +107,51 @@ AS_HELP_STRING([--with-relocated-sources=PATH], [automatically relocate this pat [Relocated directory for source files. ]) ]) @@ -1902,7 +3073,7 @@ index 77f8436..bca368c 100644 AC_CONFIG_SUBDIRS(doc testsuite) # Check whether to support alternative target configurations -@@ -660,6 +705,8 @@ if test "${have_libpython}" = yes; then +@@ -658,6 +703,8 @@ if test "${have_libpython}" = yes; then CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_PYTHON_OBS)" CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)" CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)" @@ -1934,7 +3105,7 @@ index 62800b8..97d587b 100644 { $$ = $1.comp; if ($2) $$ = fill_comp (DEMANGLE_COMPONENT_LOCAL_NAME, $$, $2); } diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c -index d2d8f2e..7672b2e 100644 +index d2d8f2e..b950147 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -36,14 +36,17 @@ static struct using_direct *cp_copy_usings (struct using_direct *using, @@ -2194,7 +3365,7 @@ index d2d8f2e..7672b2e 100644 + struct using_direct *current; + struct symbol *sym = NULL; + int directive_match; -+ int current_line = find_pc_line (get_frame_pc (get_current_frame ()), 0).line; ++ int current_line = find_pc_line (get_frame_pc (get_selected_frame (NULL)), 0).line; - /* First, go through the using directives. If any of them add new + if(!declaration_only) @@ -2616,10 +3787,10 @@ 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 4016acc..1042303 100644 +index 7b26675..0e0c288 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -958,8 +958,10 @@ Connect to process ID @var{number}, as with the @code{attach} command. +@@ -959,8 +959,10 @@ Connect to process ID @var{number}, as with the @code{attach} command. @itemx -x @var{file} @cindex @code{--command} @cindex @code{-x} @@ -2632,7 +3803,7 @@ index 4016acc..1042303 100644 @item -eval-command @var{command} @itemx -ex @var{command} -@@ -1151,6 +1153,16 @@ for remote debugging. +@@ -1152,6 +1154,16 @@ for remote debugging. Run using @var{device} for your program's standard input and output. @c FIXME: kingdon thinks there is more to -tty. Investigate. @@ -2649,7 +3820,7 @@ index 4016acc..1042303 100644 @c resolve the situation of these eventually @item -tui @cindex @code{--tui} -@@ -18465,7 +18477,7 @@ command: +@@ -18519,7 +18531,7 @@ command: @table @code @kindex source @cindex execute commands from a file @@ -2658,7 +3829,7 @@ index 4016acc..1042303 100644 Execute the command file @var{filename}. @end table -@@ -18482,6 +18494,11 @@ If @code{-v}, for verbose mode, is given then @value{GDBN} displays +@@ -18536,6 +18548,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. @@ -2670,7 +3841,7 @@ index 4016acc..1042303 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 -@@ -18743,8 +18760,6 @@ containing @code{end}. For example: +@@ -18797,8 +18814,6 @@ containing @code{end}. For example: @smallexample (@value{GDBP}) python @@ -2679,7 +3850,7 @@ index 4016acc..1042303 100644 >print 23 >end 23 -@@ -18757,6 +18772,14 @@ in a Python script. This can be controlled using @code{maint set +@@ -18811,6 +18826,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. @@ -2694,7 +3865,7 @@ index 4016acc..1042303 100644 @end table @node Python API -@@ -18764,6 +18787,14 @@ disabled. +@@ -18818,6 +18841,14 @@ disabled. @cindex python api @cindex programming in python @@ -2709,7 +3880,7 @@ index 4016acc..1042303 100644 @cindex python stdout @cindex python pagination At startup, @value{GDBN} overrides Python's @code{sys.stdout} and -@@ -18776,13 +18807,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown. +@@ -18830,13 +18861,17 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown. * Basic Python:: Basic Python Functions. * Exception Handling:: * Auto-loading:: Automatically loading Python code. @@ -2728,7 +3899,7 @@ index 4016acc..1042303 100644 * Frames In Python:: Acessing inferior stack frames from Python. @end menu -@@ -18809,6 +18844,12 @@ command as having originated from the user invoking it interactively. +@@ -18863,6 +18898,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 @@ -2741,7 +3912,7 @@ index 4016acc..1042303 100644 @findex gdb.parameter @defun parameter parameter Return the value of a @value{GDBN} parameter. @var{parameter} is a -@@ -18825,6 +18866,7 @@ a Python value of the appropriate type, and returned. +@@ -18879,6 +18920,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. @@ -2749,7 +3920,7 @@ index 4016acc..1042303 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 -@@ -18836,6 +18878,28 @@ If no exception is raised, the return value is always an instance of +@@ -18890,6 +18932,28 @@ If no exception is raised, the return value is always an instance of @code{gdb.Value} (@pxref{Values From Inferior}). @end defun @@ -2778,7 +3949,7 @@ index 4016acc..1042303 100644 @findex gdb.write @defun write string Print a string to @value{GDBN}'s paginated standard output stream. -@@ -18850,6 +18914,11 @@ Flush @value{GDBN}'s paginated standard output stream. Flushing +@@ -18904,6 +18968,11 @@ Flush @value{GDBN}'s paginated standard output stream. Flushing function. @end defun @@ -2790,7 +3961,7 @@ index 4016acc..1042303 100644 @node Exception Handling @subsubsection Exception Handling @cindex python exceptions -@@ -18986,6 +19055,13 @@ The type of this @code{gdb.Value}. The value of this attribute is a +@@ -19040,6 +19109,13 @@ The type of this @code{gdb.Value}. The value of this attribute is a The following methods are provided: @table @code @@ -2804,7 +3975,7 @@ index 4016acc..1042303 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 -@@ -19057,6 +19133,9 @@ module: +@@ -19111,6 +19187,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. @@ -2814,7 +3985,7 @@ index 4016acc..1042303 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 -@@ -19109,6 +19188,12 @@ This is @code{True} if the field is artificial, usually meaning that +@@ -19163,6 +19242,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. @@ -2827,7 +3998,7 @@ index 4016acc..1042303 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, -@@ -19161,7 +19246,7 @@ If the type does not have a target, this method will throw an +@@ -19215,7 +19300,7 @@ If the type does not have a target, this method will throw an exception. @end defmethod @@ -2836,7 +4007,7 @@ index 4016acc..1042303 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. -@@ -19169,7 +19254,8 @@ return a new @code{gdb.Type} which represents the type of the +@@ -19223,7 +19308,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. @@ -2846,7 +4017,7 @@ index 4016acc..1042303 100644 @end defmethod @end table -@@ -19523,6 +19609,121 @@ import gdb.libstdcxx.v6 +@@ -19577,6 +19663,121 @@ import gdb.libstdcxx.v6 gdb.libstdcxx.v6.register_printers (gdb.current_objfile ()) @end smallexample @@ -2968,7 +4139,7 @@ index 4016acc..1042303 100644 @node Commands In Python @subsubsection Commands In Python -@@ -19775,6 +19976,135 @@ registration of the command with @value{GDBN}. Depending on how the +@@ -19829,6 +20030,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. @@ -3104,7 +4275,7 @@ index 4016acc..1042303 100644 @node Functions In Python @subsubsection Writing new convenience functions -@@ -19879,6 +20209,82 @@ which is used to format the value. @xref{Pretty Printing}, for more +@@ -19933,6 +20263,82 @@ which is used to format the value. @xref{Pretty Printing}, for more information. @end defivar @@ -3187,7 +4358,7 @@ index 4016acc..1042303 100644 @node Frames In Python @subsubsection Acessing inferior stack frames from Python. -@@ -19943,6 +20349,14 @@ function to a string. +@@ -19997,6 +20403,14 @@ function to a string. Returns the frame's resume address. @end defmethod @@ -3202,7 +4373,7 @@ index 4016acc..1042303 100644 @defmethod Frame older Return the frame that called this frame. @end defmethod -@@ -19951,10 +20365,18 @@ Return the frame that called this frame. +@@ -20005,10 +20419,18 @@ Return the frame that called this frame. Return the frame called by this frame. @end defmethod @@ -3221,7 +4392,7 @@ index 4016acc..1042303 100644 @end table @node Interpreters -@@ -23306,6 +23728,8 @@ access this functionality: +@@ -23360,6 +23782,8 @@ access this functionality: @item @strong{Operation} @tab @strong{Description} @@ -3230,7 +4401,7 @@ index 4016acc..1042303 100644 @item @code{-var-create} @tab create a variable object @item @code{-var-delete} -@@ -23334,6 +23758,8 @@ access this functionality: +@@ -23388,6 +23812,8 @@ access this functionality: @tab update the variable and its children @item @code{-var-set-frozen} @tab set frozeness attribute @@ -3239,7 +4410,7 @@ index 4016acc..1042303 100644 @end multitable In the next subsection we describe each operation in detail and suggest -@@ -23341,6 +23767,23 @@ how it can be used. +@@ -23395,6 +23821,23 @@ how it can be used. @subheading Description And Use of Operations on Variable Objects @@ -3250,20 +4421,92 @@ index 4016acc..1042303 100644 +-enable-pretty-printing +@end smallexample + -+@var{GDBN} allows Python-based visualizers to affect the output of the ++@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 @var{GDBN}, ++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 -@@ -23473,7 +23916,7 @@ Returns the number of children of a variable object @var{name}: +@@ -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 @@ -3272,7 +4515,7 @@ index 4016acc..1042303 100644 @end smallexample @anchor{-var-list-children} -@@ -23486,6 +23929,12 @@ values; and if it is 2 or @code{--simple-values} print the name and +@@ -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. @@ -3281,17 +4524,47 @@ index 4016acc..1042303 100644 +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 -@@ -23519,6 +23968,14 @@ Otherwise this result is not present. +@@ -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 @var ++@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. @@ -3300,17 +4573,86 @@ index 4016acc..1042303 100644 @subsubheading Example @smallexample -@@ -23700,6 +24157,9 @@ With the @samp{*} parameter, if a variable object is bound to a +@@ -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 -@@ -23767,6 +24227,32 @@ Unfreezing a variable does not update it, only subsequent +@@ -23821,6 +24407,32 @@ Unfreezing a variable does not update it, only subsequent (gdb) @end smallexample @@ -3344,7 +4686,7 @@ index 4016acc..1042303 100644 @findex -var-set-visualizer @anchor{-var-set-visualizer} diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo -index b1c0452..da24b98 100644 +index e706caa..6b055d3 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, @@ -3489,7 +4831,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 427f58f..e66f007 100644 +index f9ca067..979b649 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -38,6 +38,7 @@ @@ -3500,28 +4842,7 @@ index 427f58f..e66f007 100644 struct comp_unit; -@@ -310,6 +311,13 @@ no_get_frame_base (void *baton, gdb_byte **start, size_t *length) - } - - static CORE_ADDR -+no_get_frame_cfa (void *baton) -+{ -+ internal_error (__FILE__, __LINE__, -+ _("Support for DW_OP_call_frame_cfa is unimplemented")); -+} -+ -+static CORE_ADDR - no_get_tls_address (void *baton, CORE_ADDR offset) - { - internal_error (__FILE__, __LINE__, -@@ -363,14 +371,22 @@ execute_stack_op (gdb_byte *exp, ULONGEST len, int addr_size, - ctx->read_reg = read_reg; - ctx->read_mem = read_mem; - ctx->get_frame_base = no_get_frame_base; -+ ctx->get_frame_cfa = no_get_frame_cfa; - ctx->get_tls_address = no_get_tls_address; - - dwarf_expr_push (ctx, initial); +@@ -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); @@ -3538,24 +4859,7 @@ index 427f58f..e66f007 100644 do_cleanups (old_chain); -@@ -1250,6 +1266,16 @@ dwarf2_frame_base_sniffer (struct frame_info *this_frame) - - return NULL; - } -+ -+CORE_ADDR -+dwarf2_frame_cfa (struct frame_info *this_frame) -+{ -+ while (get_frame_type (this_frame) == INLINE_FRAME) -+ this_frame = get_prev_frame (this_frame); -+ if (! frame_unwinder_is (this_frame, &dwarf2_frame_unwind)) -+ error (_("can't compute CFA for this frame")); -+ return get_frame_base (this_frame); -+} - - const struct objfile_data *dwarf2_frame_objfile_data; - -@@ -1539,6 +1565,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc) +@@ -1566,6 +1574,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc) CORE_ADDR offset; CORE_ADDR seek_pc; @@ -3570,21 +4874,8 @@ index 427f58f..e66f007 100644 fde_table = objfile_data (objfile, dwarf2_frame_objfile_data); if (fde_table == NULL) continue; -diff --git a/gdb/dwarf2-frame.h b/gdb/dwarf2-frame.h -index b203661..dd03d59 100644 ---- a/gdb/dwarf2-frame.h -+++ b/gdb/dwarf2-frame.h -@@ -118,4 +118,8 @@ extern const struct frame_base * - - void dwarf2_frame_build_info (struct objfile *objfile); - -+/* Compute the DWARF CFA for a frame. */ -+ -+CORE_ADDR dwarf2_frame_cfa (struct frame_info *this_frame); -+ - #endif /* dwarf2-frame.h */ diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c -index 2721065..0644b46 100644 +index 6401e72..0644b46 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -125,8 +125,7 @@ dwarf_expr_fetch (struct dwarf_expr_context *ctx, int n) @@ -3710,18 +5001,7 @@ index 2721065..0644b46 100644 } break; case DW_OP_dup: -@@ -716,6 +756,10 @@ execute_stack_op (struct dwarf_expr_context *ctx, - } - break; - -+ case DW_OP_call_frame_cfa: -+ result = (ctx->get_frame_cfa) (ctx->baton); -+ break; -+ - case DW_OP_GNU_push_tls_address: - /* Variable is at a constant offset in the thread-local - storage block into the objfile for the current thread and -@@ -754,12 +798,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, +@@ -758,12 +798,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, /* Record the piece. */ op_ptr = read_uleb128 (op_ptr, op_end, &size); @@ -3740,7 +5020,7 @@ index 2721065..0644b46 100644 } goto no_push; -@@ -771,6 +816,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, +@@ -775,6 +816,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, ctx->initialized = 0; goto no_push; @@ -3755,7 +5035,7 @@ index 2721065..0644b46 100644 error (_("Unhandled dwarf expression opcode 0x%x"), op); } diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h -index 2306e49..597c2de 100644 +index 6b3a068..597c2de 100644 --- a/gdb/dwarf2expr.h +++ b/gdb/dwarf2expr.h @@ -23,6 +23,19 @@ @@ -3778,17 +5058,7 @@ index 2306e49..597c2de 100644 /* The expression evaluator works with a dwarf_expr_context, describing its current state and its callbacks. */ struct dwarf_expr_context -@@ -55,6 +68,9 @@ struct dwarf_expr_context - expression evaluation is complete. */ - void (*get_frame_base) (void *baton, gdb_byte **start, size_t *length); - -+ /* Return the CFA for the frame. */ -+ CORE_ADDR (*get_frame_cfa) (void *baton); -+ - /* Return the thread-local storage address for - DW_OP_GNU_push_tls_address. */ - CORE_ADDR (*get_tls_address) (void *baton, CORE_ADDR offset); -@@ -67,19 +83,23 @@ struct dwarf_expr_context +@@ -70,19 +83,23 @@ 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); @@ -3816,7 +5086,7 @@ index 2306e49..597c2de 100644 /* Initialization status of variable: Non-zero if variable has been initialized; zero otherwise. */ -@@ -90,9 +110,9 @@ struct dwarf_expr_context +@@ -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 @@ -3829,7 +5099,7 @@ index 2306e49..597c2de 100644 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 -@@ -103,12 +123,11 @@ struct dwarf_expr_context +@@ -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 @@ -3847,7 +5117,7 @@ index 2306e49..597c2de 100644 int num_pieces; struct dwarf_expr_piece *pieces; }; -@@ -117,13 +136,22 @@ struct dwarf_expr_context +@@ -120,13 +136,22 @@ struct dwarf_expr_context /* A piece of an object, as recorded by DW_OP_piece. */ struct dwarf_expr_piece { @@ -3878,18 +5148,10 @@ index 2306e49..597c2de 100644 /* The length of the piece, in bytes. */ ULONGEST size; diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index 1df6a9f..939f7a2 100644 +index c3f6d40..af816f4 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c -@@ -36,6 +36,7 @@ - #include "dwarf2.h" - #include "dwarf2expr.h" - #include "dwarf2loc.h" -+#include "dwarf2-frame.h" - - #include "gdb_string.h" - #include "gdb_assert.h" -@@ -115,6 +116,9 @@ struct dwarf_expr_baton +@@ -116,6 +116,9 @@ struct dwarf_expr_baton { struct frame_info *frame; struct objfile *objfile; @@ -3899,7 +5161,7 @@ index 1df6a9f..939f7a2 100644 }; /* Helper functions for dwarf2_evaluate_loc_desc. */ -@@ -176,22 +180,40 @@ dwarf_expr_frame_base (void *baton, gdb_byte **start, size_t * length) +@@ -177,22 +180,33 @@ dwarf_expr_frame_base (void *baton, gdb_byte **start, size_t * length) *start = find_location_expression (symbaton, length, get_frame_address_in_block (frame)); } @@ -3919,7 +5181,7 @@ index 1df6a9f..939f7a2 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; @@ -3928,7 +5190,7 @@ index 1df6a9f..939f7a2 100644 + gdb_assert (symbaton == NULL); + *start = NULL; + *length = 0; /* unused */ -+ } + } + else + internal_error (__FILE__, __LINE__, + _("Unsupported SYMBOL_COMPUTED_OPS %p for \"%s\""), @@ -3939,17 +5201,10 @@ index 1df6a9f..939f7a2 100644 error (_("Could not find the frame base for \"%s\"."), - SYMBOL_NATURAL_NAME (framefunc)); + SYMBOL_PRINT_NAME (framefunc)); -+} -+ -+static CORE_ADDR -+dwarf_expr_frame_cfa (void *baton) -+{ -+ struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton; -+ return dwarf2_frame_cfa (debaton->frame); } - /* Using the objfile specified in BATON, find the address for the -@@ -204,6 +226,129 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset) + /* Helper function for dwarf2_evaluate_loc_desc. Computes the CFA for +@@ -215,6 +229,129 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset) return target_translate_tls_address (debaton->objfile, offset); } @@ -4076,10 +5331,51 @@ index 1df6a9f..939f7a2 100644 + return retval; +} + - /* Evaluate a location description, starting at DATA and with length - SIZE, to find the current location of variable VAR in the context - of FRAME. */ -@@ -213,9 +358,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, + 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, struct dwarf2_per_cu_data *per_cu) { struct value *retval; @@ -4090,7 +5386,7 @@ index 1df6a9f..939f7a2 100644 if (size == 0) { -@@ -225,21 +369,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -355,22 +491,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, return retval; } @@ -4107,71 +5403,16 @@ index 1df6a9f..939f7a2 100644 - ctx->read_reg = dwarf_expr_read_reg; - ctx->read_mem = dwarf_expr_read_mem; - ctx->get_frame_base = dwarf_expr_frame_base; +- ctx->get_frame_cfa = dwarf_expr_frame_cfa; - ctx->get_tls_address = dwarf_expr_tls_address; - - dwarf_expr_eval (ctx, data, size); if (ctx->num_pieces > 0) { - int i; -@@ -251,36 +382,115 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, - for (i = 0; i < ctx->num_pieces; i++) - { - struct dwarf_expr_piece *p = &ctx->pieces[i]; -- if (p->in_reg) -- { -- struct gdbarch *arch = get_frame_arch (frame); -- bfd_byte regval[MAX_REGISTER_SIZE]; -- int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, p->value); -- get_frame_register (frame, gdb_regnum, regval); -- memcpy (contents + offset, regval, p->size); -- } -- else /* In memory? */ -+ switch (p->location) - { -- read_memory (p->value, contents + offset, p->size); -+ case DWARF_VALUE_REGISTER: -+ { -+ struct gdbarch *arch = get_frame_arch (frame); -+ bfd_byte regval[MAX_REGISTER_SIZE]; -+ 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); -+ } -+ break; -+ -+ case DWARF_VALUE_MEMORY: -+ read_memory (p->v.value, contents + offset, p->size); -+ break; -+ -+ case DWARF_VALUE_STACK: -+ { -+ gdb_byte bytes[sizeof (ULONGEST)]; -+ size_t n; -+ store_unsigned_integer (bytes, ctx->addr_size, -+ gdbarch_byte_order (ctx->gdbarch), -+ p->v.value); -+ n = p->size; -+ if (n > ctx->addr_size) -+ n = ctx->addr_size; -+ memcpy (contents + offset, bytes, n); -+ } -+ break; -+ -+ case DWARF_VALUE_LITERAL: -+ { -+ size_t n = p->size; -+ if (n > p->v.literal.length) -+ n = p->v.literal.length; -+ memcpy (contents + offset, p->v.literal.data, n); -+ } -+ break; -+ -+ default: -+ internal_error (__FILE__, __LINE__, _("invalid location type")); - } - offset += p->size; - } + 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) - { @@ -4187,6 +5428,7 @@ index 1df6a9f..939f7a2 100644 - 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) + { @@ -4211,6 +5453,7 @@ index 1df6a9f..939f7a2 100644 + 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; @@ -4252,28 +5495,7 @@ index 1df6a9f..939f7a2 100644 } set_value_initialized (retval, ctx->initialized); -@@ -330,6 +540,15 @@ needs_frame_frame_base (void *baton, gdb_byte **start, size_t * length) - nf_baton->needs_frame = 1; - } - -+/* CFA accesses require a frame. */ -+static CORE_ADDR -+needs_frame_frame_cfa (void *baton) -+{ -+ struct needs_frame_baton *nf_baton = baton; -+ nf_baton->needs_frame = 1; -+ return 1; -+} -+ - /* Thread-local accesses do require a frame. */ - static CORE_ADDR - needs_frame_tls_address (void *baton, CORE_ADDR offset) -@@ -362,11 +581,12 @@ dwarf2_loc_desc_needs_frame (gdb_byte *data, unsigned short size, - ctx->read_reg = needs_frame_read_reg; - ctx->read_mem = needs_frame_read_mem; - ctx->get_frame_base = needs_frame_frame_base; -+ ctx->get_frame_cfa = needs_frame_frame_cfa; - ctx->get_tls_address = needs_frame_tls_address; +@@ -494,7 +664,7 @@ dwarf2_loc_desc_needs_frame (gdb_byte *data, unsigned short size, dwarf_expr_eval (ctx, data, size); @@ -4282,7 +5504,7 @@ index 1df6a9f..939f7a2 100644 if (ctx->num_pieces > 0) { -@@ -375,7 +595,7 @@ dwarf2_loc_desc_needs_frame (gdb_byte *data, unsigned short size, +@@ -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++) @@ -4291,7 +5513,7 @@ index 1df6a9f..939f7a2 100644 in_reg = 1; } -@@ -607,7 +827,7 @@ static int +@@ -735,7 +905,7 @@ static int loclist_describe_location (struct symbol *symbol, struct ui_file *stream) { /* FIXME: Could print the entire list of locations. */ @@ -4300,7 +5522,7 @@ index 1df6a9f..939f7a2 100644 return 1; } -@@ -623,16 +843,56 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, +@@ -751,16 +921,56 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, data = find_location_expression (dlbaton, &size, ax->scope); if (data == NULL) @@ -4377,20 +5599,10 @@ index 0bfcfca..01018d6 100644 #endif /* dwarf2loc.h */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 445bab8..42039ea 100644 +index 7f04427..31504fe 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -1,8 +1,7 @@ - /* DWARF 2 debugging format support for GDB. - - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -- 2004, 2005, 2006, 2007, 2008, 2009 -- Free Software Foundation, Inc. -+ 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology, - Inc. with support from Florida State University (under contract -@@ -48,6 +47,12 @@ +@@ -48,6 +48,12 @@ #include "gdbcmd.h" #include "block.h" #include "addrmap.h" @@ -4403,7 +5615,7 @@ index 445bab8..42039ea 100644 #include #include "gdb_string.h" -@@ -93,7 +98,7 @@ typedef struct pubnames_header +@@ -93,7 +99,7 @@ typedef struct pubnames_header _PUBNAMES_HEADER; #define _ACTUAL_PUBNAMES_HEADER_SIZE 13 @@ -4412,7 +5624,7 @@ index 445bab8..42039ea 100644 Because of alignment constraints, this structure has padding and cannot be mapped directly onto the beginning of the .debug_info section. */ typedef struct aranges_header -@@ -150,7 +155,10 @@ struct dwarf2_section_info +@@ -150,7 +156,10 @@ struct dwarf2_section_info asection *asection; gdb_byte *buffer; bfd_size_type size; @@ -4424,7 +5636,7 @@ index 445bab8..42039ea 100644 }; struct dwarf2_per_objfile -@@ -336,6 +344,19 @@ struct dwarf2_cu +@@ -336,6 +345,19 @@ struct dwarf2_cu /* Field `ranges_offset' is filled in; flag as the value may be zero. */ unsigned int has_ranges_offset : 1; @@ -4444,18 +5656,7 @@ index 445bab8..42039ea 100644 }; /* Persistent data held for a compilation unit, even when not -@@ -474,8 +495,8 @@ struct partial_die_info - /* DWARF-2 tag for this DIE. */ - ENUM_BITFIELD(dwarf_tag) tag : 16; - -- /* Language code associated with this DIE. This is only used -- for the compilation unit DIE. */ -+ /* Language code associated with this DIE. This is only used -+ for the compilation unit DIE. */ - unsigned int language : 8; - - /* Assorted flags describing the data found in this DIE. */ -@@ -495,8 +516,7 @@ struct partial_die_info +@@ -495,8 +517,7 @@ struct partial_die_info unsigned int has_byte_size : 1; /* The name of this DIE. Normally the value of DW_AT_name, but @@ -4465,7 +5666,7 @@ index 445bab8..42039ea 100644 char *name; char *dirname; -@@ -691,6 +711,11 @@ struct field_info +@@ -691,6 +712,11 @@ struct field_info int nfnfields; }; @@ -4477,7 +5678,7 @@ index 445bab8..42039ea 100644 /* One item on the queue of compilation units to read in full symbols for. */ struct dwarf2_queue_item -@@ -802,7 +827,10 @@ static void scan_partial_symbols (struct partial_die_info *, +@@ -802,7 +828,10 @@ static void scan_partial_symbols (struct partial_die_info *, static void add_partial_symbol (struct partial_die_info *, struct dwarf2_cu *); @@ -4489,7 +5690,7 @@ index 445bab8..42039ea 100644 static void add_partial_namespace (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, -@@ -827,6 +855,10 @@ static void dwarf2_psymtab_to_symtab (struct partial_symtab *); +@@ -827,6 +856,10 @@ static void dwarf2_psymtab_to_symtab (struct partial_symtab *); static void psymtab_to_symtab_1 (struct partial_symtab *); @@ -4500,7 +5701,7 @@ index 445bab8..42039ea 100644 static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu); static void dwarf2_free_abbrev_table (void *); -@@ -947,8 +979,13 @@ static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *); +@@ -947,8 +980,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 *); @@ -4514,7 +5715,7 @@ index 445bab8..42039ea 100644 static char *typename_concat (struct obstack *, const char *prefix, const char *suffix, -@@ -966,7 +1003,8 @@ static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *, +@@ -966,7 +1004,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 *, @@ -4524,7 +5725,7 @@ index 445bab8..42039ea 100644 static void get_scope_pc_bounds (struct die_info *, CORE_ADDR *, CORE_ADDR *, -@@ -990,17 +1028,25 @@ static void dwarf2_attach_fn_fields_to_type (struct field_info *, +@@ -990,17 +1029,25 @@ static void dwarf2_attach_fn_fields_to_type (struct field_info *, static void process_structure_scope (struct die_info *, struct dwarf2_cu *); @@ -4553,7 +5754,7 @@ index 445bab8..42039ea 100644 static const char *namespace_name (struct die_info *die, int *is_anonymous, struct dwarf2_cu *); -@@ -1036,6 +1082,9 @@ static void process_die (struct die_info *, struct dwarf2_cu *); +@@ -1036,6 +1083,9 @@ static void process_die (struct die_info *, struct dwarf2_cu *); static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *); @@ -4563,13 +5764,12 @@ index 445bab8..42039ea 100644 static char *dwarf2_canonicalize_name (char *, struct dwarf2_cu *, struct obstack *); -@@ -1078,7 +1127,8 @@ static int is_ref_attr (struct attribute *); +@@ -1078,7 +1128,7 @@ static int is_ref_attr (struct attribute *); static unsigned int dwarf2_get_ref_die_offset (struct attribute *); -static int dwarf2_get_attr_constant_value (struct attribute *, int); -+static CORE_ADDR dwarf2_get_attr_constant_value (struct attribute *, CORE_ADDR, -+ struct dwarf2_cu *); ++static CORE_ADDR dwarf2_get_attr_constant_value (struct attribute *, CORE_ADDR); static struct die_info *follow_die_ref_or_sig (struct die_info *, struct attribute *, @@ -4911,20 +6111,7 @@ index 445bab8..42039ea 100644 } /* Fill in SECTP, BUFP and SIZEP with section info, given OBJFILE and -@@ -1666,11 +1909,7 @@ dwarf2_create_include_psymtab (char *name, struct partial_symtab *pst, - - /* Read the Line Number Program data and extract the list of files - included by the source file represented by PST. Build an include -- partial symtab for each of these included files. -- -- This procedure assumes that there *is* a Line Number Program in -- the given CU. Callers should check that PDI->HAS_STMT_LIST is set -- before calling this procedure. */ -+ partial symtab for each of these included files. */ - - static void - dwarf2_build_include_psymtabs (struct dwarf2_cu *cu, -@@ -1812,6 +2051,37 @@ lookup_signatured_type (struct objfile *objfile, ULONGEST sig) +@@ -1812,6 +2055,37 @@ lookup_signatured_type (struct objfile *objfile, ULONGEST sig) return entry; } @@ -4962,27 +6149,7 @@ index 445bab8..42039ea 100644 /* Subroutine of process_type_comp_unit and dwarf2_build_psymtabs_hard to combine the common parts. Process a compilation unit for a psymtab. -@@ -1878,7 +2148,7 @@ process_psymtab_comp_unit (struct objfile *objfile, - } - - /* Set the language we're debugging. */ -- set_cu_language (comp_unit_die.language, &cu); -+ set_cu_language (comp_unit_die.language, &cu); - - /* Allocate a new partial symbol table structure. */ - pst = start_psymtab_common (objfile, objfile->section_offsets, -@@ -1929,8 +2199,8 @@ process_psymtab_comp_unit (struct objfile *objfile, - } - else if (comp_unit_die.has_pc_info - && comp_unit_die.lowpc < comp_unit_die.highpc) -- /* Store the contiguous range if it is not empty; it can be empty for -- CUs with no code. */ -+ /* Store the contiguous range; `DW_AT_ranges' range is stored above. The -+ range can be also empty for CUs with no code. */ - addrmap_set_empty (objfile->psymtabs_addrmap, - comp_unit_die.lowpc + baseaddr, - comp_unit_die.highpc + baseaddr - 1, pst); -@@ -2361,7 +2631,7 @@ partial_die_parent_scope (struct partial_die_info *pdi, +@@ -2361,7 +2635,7 @@ partial_die_parent_scope (struct partial_die_info *pdi, ignoring them. */ complaint (&symfile_complaints, _("unhandled containing DIE tag %d for DIE at %d"), @@ -4991,7 +6158,7 @@ index 445bab8..42039ea 100644 parent->scope = grandparent_scope; } -@@ -2376,12 +2646,22 @@ partial_die_full_name (struct partial_die_info *pdi, +@@ -2376,12 +2650,22 @@ partial_die_full_name (struct partial_die_info *pdi, struct dwarf2_cu *cu) { char *parent_scope; @@ -5018,7 +6185,7 @@ index 445bab8..42039ea 100644 } static void -@@ -2397,12 +2677,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2397,12 +2681,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -5034,7 +6201,7 @@ index 445bab8..42039ea 100644 if (actual_name == NULL) actual_name = pdi->name; -@@ -2493,6 +2770,12 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2493,6 +2774,12 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) &objfile->global_psymbols, 0, (CORE_ADDR) 0, cu->language, objfile); break; @@ -5047,7 +6214,7 @@ index 445bab8..42039ea 100644 case DW_TAG_class_type: case DW_TAG_interface_type: case DW_TAG_structure_type: -@@ -2534,22 +2817,6 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2534,22 +2821,6 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) break; } @@ -5070,7 +6237,7 @@ index 445bab8..42039ea 100644 if (built_actual_name) xfree (actual_name); } -@@ -2559,9 +2826,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2559,9 +2830,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) name listed in the die. */ static int @@ -5082,7 +6249,7 @@ index 445bab8..42039ea 100644 { case DW_TAG_namespace: case DW_TAG_typedef: -@@ -2571,7 +2838,23 @@ pdi_needs_namespace (enum dwarf_tag tag) +@@ -2571,7 +2842,23 @@ pdi_needs_namespace (enum dwarf_tag tag) case DW_TAG_union_type: case DW_TAG_enumeration_type: case DW_TAG_enumerator: @@ -5106,7 +6273,7 @@ index 445bab8..42039ea 100644 default: return 0; } -@@ -2604,12 +2887,12 @@ static void +@@ -2604,12 +2891,12 @@ static void add_partial_module (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, int need_pc, struct dwarf2_cu *cu) { @@ -5123,7 +6290,7 @@ index 445bab8..42039ea 100644 } /* Read a partial die corresponding to a subprogram and create a partial -@@ -2700,27 +2983,6 @@ guess_structure_name (struct partial_die_info *struct_pdi, +@@ -2700,27 +2987,6 @@ guess_structure_name (struct partial_die_info *struct_pdi, if (real_pdi->die_parent != NULL) return; @@ -5151,55 +6318,7 @@ index 445bab8..42039ea 100644 } } -@@ -3170,7 +3432,6 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu) - CORE_ADDR lowpc, highpc; - struct symtab *symtab; - struct cleanup *back_to; -- struct attribute *attr; - CORE_ADDR baseaddr; - - baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -@@ -3180,30 +3441,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu) - - cu->list_in_scope = &file_symbols; - -- /* Find the base address of the compilation unit for range lists and -- location lists. It will normally be specified by DW_AT_low_pc. -- In DWARF-3 draft 4, the base address could be overridden by -- DW_AT_entry_pc. It's been removed, but GCC still uses this for -- compilation units with discontinuous ranges. */ -- -- cu->base_known = 0; -- cu->base_address = 0; -- -- attr = dwarf2_attr (cu->dies, DW_AT_entry_pc, cu); -- if (attr) -- { -- cu->base_address = DW_ADDR (attr); -- cu->base_known = 1; -- } -- else -- { -- attr = dwarf2_attr (cu->dies, DW_AT_low_pc, cu); -- if (attr) -- { -- cu->base_address = DW_ADDR (attr); -- cu->base_known = 1; -- } -- } -+ dwarf2_find_base_address (cu->dies, cu); - - /* Do line number decoding in read_file_scope () */ - process_die (cu->dies, cu); -@@ -3234,6 +3472,7 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu) - static void - process_die (struct die_info *die, struct dwarf2_cu *cu) - { -+ - switch (die->tag) - { - case DW_TAG_padding: -@@ -3297,6 +3536,14 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -3297,6 +3563,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; @@ -5214,7 +6333,7 @@ index 445bab8..42039ea 100644 if (die->child != NULL && (die->tag == DW_TAG_imported_declaration || cu->language != language_fortran)) complaint (&symfile_complaints, _("Tag '%s' has unexpected children"), -@@ -3312,42 +3559,69 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -3312,41 +3586,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 @@ -5289,7 +6408,6 @@ index 445bab8..42039ea 100644 return name; } --/* Read the import statement specified by the given die and record it. */ +/* read the given die's decl_line number. Return -1 if in case of an error */ +static const int dwarf2_read_decl_line (struct die_info *die, struct dwarf2_cu *cu){ + struct attribute *line_attr; @@ -5302,11 +6420,10 @@ index 445bab8..42039ea 100644 + return -1; +} + -+/* Read the import statement specified by the given die and record it. */ + /* Read the import statement specified by the given die and record it. */ static void - read_import_statement (struct die_info *die, struct dwarf2_cu *cu) -@@ -3356,9 +3630,15 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) +@@ -3356,9 +3657,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; @@ -5324,7 +6441,7 @@ index 445bab8..42039ea 100644 import_attr = dwarf2_attr (die, DW_AT_import, cu); if (import_attr == NULL) { -@@ -3406,29 +3686,45 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) +@@ -3406,17 +3713,27 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) return; } @@ -5343,12 +6460,8 @@ index 445bab8..42039ea 100644 + /* Figure out where the statement is being imported to */ import_prefix = determine_prefix (die, cu); -- /* Figure out what the scope of the imported die is and prepend it -- to the name of the imported die. */ -+ /* -+ Figure out what the scope of the imported die is and prepend it -+ to the name of the imported die -+ */ + /* Figure out what the scope of the imported die is and prepend it + to the name of the imported die. */ imported_name_prefix = determine_prefix (imported_die, cu); - - if (strlen (imported_name_prefix) > 0) @@ -5362,11 +6475,7 @@ index 445bab8..42039ea 100644 canonical_name = alloca (strlen (imported_name_prefix) + 2 + strlen (imported_name) + 1); strcpy (canonical_name, imported_name_prefix); strcat (canonical_name, "::"); - strcat (canonical_name, imported_name); -- } -- else -- { -+ }else{ +@@ -3427,8 +3744,14 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) canonical_name = alloca (strlen (imported_name) + 1); strcpy (canonical_name, imported_name); } @@ -5383,16 +6492,7 @@ index 445bab8..42039ea 100644 } static void -@@ -3676,7 +3972,7 @@ unsigned_int_compar (const void *ap, const void *bp) - - return (a > b) - (b > a); - } -- -+ - /* DW_AT_abstract_origin inherits whole DIEs (not just their attributes). - Inherit only the children of the DW_AT_abstract_origin DIE not being already - referenced by DW_AT_abstract_origin from the children of the current DIE. */ -@@ -3697,6 +3993,14 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) +@@ -3697,6 +4020,14 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr; attr = dwarf2_attr (die, DW_AT_abstract_origin, cu); @@ -5407,7 +6507,7 @@ index 445bab8..42039ea 100644 if (!attr) return; -@@ -3795,6 +4099,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3795,6 +4126,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) char *name; CORE_ADDR baseaddr; struct block *block; @@ -5415,7 +6515,7 @@ index 445bab8..42039ea 100644 int inlined_func = (die->tag == DW_TAG_inlined_subroutine); if (inlined_func) -@@ -3813,13 +4118,23 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3813,13 +4145,23 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -5442,7 +6542,7 @@ index 445bab8..42039ea 100644 lowpc += baseaddr; highpc += baseaddr; -@@ -3846,14 +4161,19 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3846,14 +4188,19 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) cu->list_in_scope = &local_symbols; @@ -5469,7 +6569,7 @@ index 445bab8..42039ea 100644 } inherit_abstract_dies (die, cu); -@@ -3869,6 +4189,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3869,6 +4216,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) determine_prefix (die, cu), processing_has_namespace_info); @@ -5483,7 +6583,7 @@ index 445bab8..42039ea 100644 /* If we have address ranges, record them. */ dwarf2_record_block_ranges (die, block, baseaddr, cu); -@@ -3905,7 +4232,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3905,7 +4259,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. */ @@ -5492,7 +6592,7 @@ index 445bab8..42039ea 100644 return; lowpc += baseaddr; highpc += baseaddr; -@@ -3922,7 +4249,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3922,7 +4276,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) } new = pop_context (); @@ -5501,7 +6601,7 @@ index 445bab8..42039ea 100644 { struct block *block = finish_block (0, &local_symbols, new->old_blocks, new->start_addr, -@@ -4077,7 +4404,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return, +@@ -4077,7 +4431,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, @@ -5511,7 +6611,7 @@ index 445bab8..42039ea 100644 { struct attribute *attr; CORE_ADDR low = 0; -@@ -4105,7 +4433,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, +@@ -4105,7 +4460,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. */ @@ -5520,7 +6620,7 @@ index 445bab8..42039ea 100644 return 0; /* Found discontinuous range of addresses. */ ret = -1; -@@ -4144,7 +4472,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die, +@@ -4144,7 +4499,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die, CORE_ADDR low, high; struct die_info *child = die->child; @@ -5529,7 +6629,7 @@ index 445bab8..42039ea 100644 { *lowpc = min (*lowpc, low); *highpc = max (*highpc, high); -@@ -4181,7 +4509,7 @@ get_scope_pc_bounds (struct die_info *die, +@@ -4181,7 +4536,7 @@ get_scope_pc_bounds (struct die_info *die, CORE_ADDR best_high = (CORE_ADDR) 0; CORE_ADDR current_low, current_high; @@ -5538,66 +6638,7 @@ index 445bab8..42039ea 100644 { best_low = current_low; best_high = current_high; -@@ -4384,21 +4712,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, - /* Get bit offset of field. */ - attr = dwarf2_attr (die, DW_AT_data_member_location, cu); - if (attr) -- { -- int byte_offset; -- -- if (attr_form_is_section_offset (attr)) -- { -- dwarf2_complex_location_expr_complaint (); -- byte_offset = 0; -- } -- else if (attr_form_is_constant (attr)) -- byte_offset = dwarf2_get_attr_constant_value (attr, 0); -- else -- byte_offset = decode_locdesc (DW_BLOCK (attr), cu); -- -- SET_FIELD_BITPOS (*fp, byte_offset * bits_per_byte); -- } -+ SET_FIELD_BITPOS (*fp, dwarf2_get_attr_constant_value (attr, 0, cu) -+ * bits_per_byte); - attr = dwarf2_attr (die, DW_AT_bit_offset, cu); - if (attr) - { -@@ -4476,7 +4791,11 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, - if (fieldname == NULL) - return; - -- /* Get physical name. */ -+ /* Get physical name. We prefer the linkage name if one was specified, -+ because this lets GDB find a non-debugging version of the symbol. -+ Otherwise construct the full name from type information. Ideally, -+ when GDB supports canonicalization of C++ symbol names, we will not -+ need the linkage name for anything. */ - physname = dwarf2_linkage_name (die, cu); - - /* The name is already allocated along with this objfile, so we don't -@@ -4490,7 +4809,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, - /* C++ base class field. */ - attr = dwarf2_attr (die, DW_AT_data_member_location, cu); - if (attr) -- SET_FIELD_BITPOS (*fp, decode_locdesc (DW_BLOCK (attr), cu) -+ SET_FIELD_BITPOS (*fp, dwarf2_get_attr_constant_value (attr, 0, cu) - * bits_per_byte); - FIELD_BITSIZE (*fp) = 0; - FIELD_TYPE (*fp) = die_type (die, cu); -@@ -4607,7 +4926,11 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, - if (fieldname == NULL) - return; - -- /* Get the mangled name. */ -+ /* Get physical name. We prefer the linkage name if one was specified, -+ because this lets GDB find a non-debugging version of the symbol. -+ Otherwise construct the full name from type information. Ideally, -+ when GDB supports canonicalization of C++ symbol names, we will not -+ need the linkage name for anything. */ - physname = dwarf2_linkage_name (die, cu); - - /* Look up member function name in fieldlist. */ -@@ -4652,7 +4975,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, +@@ -4663,7 +5018,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 : ""; @@ -5606,31 +6647,33 @@ index 445bab8..42039ea 100644 this_type = read_type_die (die, cu); if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC) { -@@ -4709,22 +5032,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, - /* Get index in virtual function table if it is a virtual member function. */ - attr = dwarf2_attr (die, DW_AT_vtable_elem_location, cu); - if (attr) -- { -- /* Support the .debug_loc offsets */ -- if (attr_form_is_block (attr)) +@@ -4723,18 +5078,18 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, + { + /* Support the .debug_loc offsets */ + if (attr_form_is_block (attr)) - { - fnp->voffset = decode_locdesc (DW_BLOCK (attr), cu) + 2; - } -- else if (attr_form_is_section_offset (attr)) ++ { ++ fnp->voffset = decode_locdesc (DW_BLOCK (attr), cu) + 2; ++ } + else if (attr_form_is_section_offset (attr)) - { -- dwarf2_complex_location_expr_complaint (); ++ { + dwarf2_complex_location_expr_complaint (); - } -- else ++ } + else - { -- dwarf2_invalid_attrib_class_complaint ("DW_AT_vtable_elem_location", -- fieldname); ++ { + dwarf2_invalid_attrib_class_complaint ("DW_AT_vtable_elem_location", + fieldname); - } -- } -+ fnp->voffset = dwarf2_get_attr_constant_value (attr, -2, cu) + 2; ++ } + } } - /* Create the vector of member function fields, and attach it to the type. */ -@@ -4836,7 +5144,7 @@ quirk_gcc_member_function_pointer (struct die_info *die, struct dwarf2_cu *cu) +@@ -4847,7 +5202,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)); @@ -5639,7 +6682,7 @@ index 445bab8..42039ea 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)); -@@ -4889,7 +5197,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4900,7 +5255,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -5648,7 +6691,7 @@ index 445bab8..42039ea 100644 INIT_CPLUS_SPECIFIC (type); name = dwarf2_name (die, cu); -@@ -4898,14 +5206,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4909,14 +5264,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) if (cu->language == language_cplus || cu->language == language_java) { @@ -5670,7 +6713,7 @@ index 445bab8..42039ea 100644 } } -@@ -5115,7 +5427,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5126,7 +5485,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -5679,7 +6722,7 @@ index 445bab8..42039ea 100644 TYPE_CODE (type) = TYPE_CODE_ENUM; name = dwarf2_full_name (die, cu); -@@ -5143,51 +5455,6 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5154,51 +5513,6 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -5731,7 +6774,7 @@ index 445bab8..42039ea 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. -@@ -5265,6 +5532,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -5276,6 +5590,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) new_symbol (die, this_type, cu); } @@ -5761,7 +6804,7 @@ index 445bab8..42039ea 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. */ -@@ -5278,7 +5568,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5289,7 +5626,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; @@ -5770,7 +6813,7 @@ index 445bab8..42039ea 100644 struct cleanup *back_to; char *name; -@@ -5325,16 +5615,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5336,16 +5673,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) @@ -5792,7 +6835,7 @@ index 445bab8..42039ea 100644 /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -5401,49 +5686,83 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5412,12 +5744,14 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, set_type, cu); } @@ -5809,26 +6852,30 @@ index 445bab8..42039ea 100644 struct attribute *attr; struct symbol *sym; CORE_ADDR base = (CORE_ADDR) 0; - - attr = dwarf2_attr (die, DW_AT_location, cu); - if (attr) -- { -- /* Support the .debug_loc offsets */ -- if (attr_form_is_block (attr)) +@@ -5427,25 +5761,55 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) + { + /* Support the .debug_loc offsets */ + if (attr_form_is_block (attr)) - { - base = decode_locdesc (DW_BLOCK (attr), cu); - } -- else if (attr_form_is_section_offset (attr)) ++ { ++ base = decode_locdesc (DW_BLOCK (attr), cu); ++ } + else if (attr_form_is_section_offset (attr)) - { -- dwarf2_complex_location_expr_complaint (); ++ { + dwarf2_complex_location_expr_complaint (); - } -- else ++ } + else - { -- dwarf2_invalid_attrib_class_complaint ("DW_AT_location", -- "common block member"); ++ { + dwarf2_invalid_attrib_class_complaint ("DW_AT_location", + "common block member"); - } -- } -+ base = dwarf2_get_attr_constant_value (attr, 0, cu); ++ } + } if (die->child != NULL) { + struct objfile *objfile = cu->objfile; @@ -5843,9 +6890,9 @@ index 445bab8..42039ea 100644 + /* Artificial type to be used only by `info common'. */ + TYPE_NAME (type) = ""; + -+ child_die = die->child; -+ while (child_die && child_die->tag) -+ { + child_die = die->child; + while (child_die && child_die->tag) + { + TYPE_NFIELDS (type)++; + child_die = sibling_die (child_die); + } @@ -5857,9 +6904,9 @@ index 445bab8..42039ea 100644 + * TYPE_NFIELDS (type)); + + field = TYPE_FIELDS (type); - child_die = die->child; - while (child_die && child_die->tag) - { ++ child_die = die->child; ++ while (child_die && child_die->tag) ++ { + /* Create the symbol in the DW_TAG_common_block block in the current + symbol scope. */ sym = new_symbol (child_die, NULL, cu); @@ -5868,9 +6915,8 @@ index 445bab8..42039ea 100644 attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu); if (attr) { - SYMBOL_VALUE_ADDRESS (sym) = -- base + decode_locdesc (DW_BLOCK (attr), cu); -+ base + dwarf2_get_attr_constant_value (attr, 0, cu); +@@ -5463,8 +5827,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); } + @@ -5895,7 +6941,7 @@ index 445bab8..42039ea 100644 } } -@@ -5511,7 +5830,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -5532,7 +5913,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) if (is_anonymous) { const char *previous_prefix = determine_prefix (die, cu); @@ -5904,7 +6950,7 @@ index 445bab8..42039ea 100644 } } -@@ -5527,20 +5846,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -5548,20 +5929,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) } } @@ -5923,10 +6969,9 @@ index 445bab8..42039ea 100644 + if (type) + new_symbol (die, type, cu); +} - -- /* FIXME: Support the separate Fortran module namespaces. */ ++ +/* Read a Fortran module as type. - ++ + Modules present only as declarations - being used only for DW_AT_import of + DW_TAG_imported_module - are ignored here. They are read in only in form of + the module name by read_fortran_imported_module. */ @@ -5953,9 +6998,10 @@ index 445bab8..42039ea 100644 + type = init_type (TYPE_CODE_MODULE, 0, 0, module_name, objfile); + + /* Create a context for reading the module variables. */ -+ + +- /* FIXME: Support the separate Fortran module namespaces. */ + new = push_context (0, 0); -+ + + save_file_symbols = file_symbols; + file_symbols = NULL; + save_global_symbols = global_symbols; @@ -6063,7 +7109,7 @@ index 445bab8..42039ea 100644 } /* Return the name of the namespace represented by DIE. Set -@@ -5705,29 +6159,114 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5726,29 +6242,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; @@ -6178,8 +7224,7 @@ index 445bab8..42039ea 100644 + TYPE_DYNAMIC (range_type) = 1; + } + else if (attr && attr_form_is_constant (attr)) -+ TYPE_HIGH_BOUND (range_type) = dwarf2_get_attr_constant_value (attr, 0, -+ cu); ++ TYPE_HIGH_BOUND (range_type) = dwarf2_get_attr_constant_value (attr, 0); else - { - length = 1; @@ -6192,7 +7237,7 @@ index 445bab8..42039ea 100644 char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -5822,7 +6361,6 @@ static struct type * +@@ -5843,7 +6443,6 @@ static struct type * read_typedef (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; @@ -6200,7 +7245,7 @@ index 445bab8..42039ea 100644 const char *name = NULL; struct type *this_type; -@@ -5930,8 +6468,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5951,8 +6550,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type; struct type *range_type; struct attribute *attr; @@ -6210,7 +7255,7 @@ index 445bab8..42039ea 100644 char *name; base_type = die_type (die, cu); -@@ -5944,42 +6481,91 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5965,42 +6563,89 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) 0, NULL, cu->objfile); } @@ -6240,7 +7285,7 @@ index 445bab8..42039ea 100644 + else + { + if (attr && attr_form_is_constant (attr)) -+ low = dwarf2_get_attr_constant_value (attr, 0, cu); ++ low = dwarf2_get_attr_constant_value (attr, 0); + else + { + if (cu->language == language_fortran) @@ -6300,8 +7345,7 @@ index 445bab8..42039ea 100644 + else + { + if (attr && attr_form_is_constant (attr)) -+ TYPE_HIGH_BOUND (range_type) = dwarf2_get_attr_constant_value (attr, 0, -+ cu); ++ TYPE_HIGH_BOUND (range_type) = dwarf2_get_attr_constant_value (attr, 0); else - high = dwarf2_get_attr_constant_value (attr, 1); + { @@ -6322,8 +7366,7 @@ index 445bab8..42039ea 100644 + } + else if (attr && attr_form_is_constant (attr)) + { -+ TYPE_BYTE_STRIDE (range_type) = dwarf2_get_attr_constant_value (attr, 0, -+ cu); ++ TYPE_BYTE_STRIDE (range_type) = dwarf2_get_attr_constant_value (attr, 0); + if (TYPE_BYTE_STRIDE (range_type) == 0) + complaint (&symfile_complaints, + _("Found DW_AT_byte_stride with unsupported value 0")); @@ -6331,7 +7374,7 @@ index 445bab8..42039ea 100644 name = dwarf2_name (die, cu); if (name) -@@ -6450,6 +7036,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, +@@ -6471,6 +7116,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 @@ -6339,7 +7382,7 @@ index 445bab8..42039ea 100644 && abbrev->tag != DW_TAG_member) { /* Otherwise we skip to the next sibling, if any. */ -@@ -6670,9 +7257,6 @@ read_partial_die (struct partial_die_info *part_die, +@@ -6691,9 +7337,6 @@ read_partial_die (struct partial_die_info *part_die, if (part_die->dirname == NULL) part_die->dirname = DW_STRING (&attr); break; @@ -6349,36 +7392,7 @@ index 445bab8..42039ea 100644 case DW_AT_low_pc: has_low_pc_attr = 1; part_die->lowpc = DW_ADDR (&attr); -@@ -6744,10 +7328,10 @@ read_partial_die (struct partial_die_info *part_die, - else - part_die->sibling = buffer + dwarf2_get_ref_die_offset (&attr); - break; -- case DW_AT_stmt_list: -- part_die->has_stmt_list = 1; -- part_die->line_offset = DW_UNSND (&attr); -- break; -+ case DW_AT_stmt_list: -+ part_die->has_stmt_list = 1; -+ part_die->line_offset = DW_UNSND (&attr); -+ break; - case DW_AT_byte_size: - part_die->has_byte_size = 1; - break; -@@ -6789,13 +7373,6 @@ read_partial_die (struct partial_die_info *part_die, - || dwarf2_per_objfile->has_section_at_zero)) - part_die->has_pc_info = 1; - -- if (base_address_type != base_address_none && !cu->base_known) -- { -- gdb_assert (part_die->tag == DW_TAG_compile_unit); -- cu->base_known = 1; -- cu->base_address = base_address; -- } -- - return info_ptr; - } - -@@ -6904,7 +7481,8 @@ fixup_partial_die (struct partial_die_info *part_die, +@@ -6925,7 +7568,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. */ @@ -6388,7 +7402,7 @@ index 445bab8..42039ea 100644 { struct partial_die_info *spec_die; -@@ -8244,10 +8822,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, +@@ -8265,10 +8909,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, (i.e. when the value of a register or memory location is referenced, or a thread-local block, etc.). Then again, it might not be worthwhile. I'm assuming that it isn't unless performance @@ -6403,7 +7417,7 @@ index 445bab8..42039ea 100644 } /* Given a pointer to a DWARF information entry, figure out if we need -@@ -8269,21 +8849,30 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8290,21 +8936,30 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -6441,7 +7455,7 @@ index 445bab8..42039ea 100644 /* Default assumptions. Use the passed type or decode it from the die. */ -@@ -8381,9 +8970,28 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8402,9 +9057,28 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) if (attr) { var_decode_location (attr, sym, cu); @@ -6471,7 +7485,7 @@ index 445bab8..42039ea 100644 else add_symbol_to_list (sym, cu->list_in_scope); } -@@ -8513,7 +9121,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8534,7 +9208,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) add_symbol_to_list (sym, cu->list_in_scope); break; case DW_TAG_enumerator: @@ -6480,7 +7494,7 @@ index 445bab8..42039ea 100644 attr = dwarf2_attr (die, DW_AT_const_value, cu); if (attr) { -@@ -8537,6 +9145,16 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8558,6 +9232,16 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) SYMBOL_CLASS (sym) = LOC_TYPEDEF; add_symbol_to_list (sym, &global_symbols); break; @@ -6497,7 +7511,7 @@ index 445bab8..42039ea 100644 default: /* Not a tag we recognize. Hopefully we aren't processing trash data, but since we must specifically ignore things -@@ -8550,8 +9168,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8571,8 +9255,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* For the benefit of old versions of GCC, check for anonymous namespaces based on the demangled name. */ if (!processing_has_namespace_info @@ -6507,7 +7521,7 @@ index 445bab8..42039ea 100644 cp_scan_for_anonymous_namespaces (sym); } return (sym); -@@ -8802,12 +9419,18 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -8823,12 +9506,18 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_namespace: this_type = read_namespace_type (die, cu); break; @@ -6526,7 +7540,7 @@ index 445bab8..42039ea 100644 return this_type; } -@@ -8889,10 +9512,97 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) +@@ -8910,10 +9599,97 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) So it does not need a prefix. */ return ""; default: @@ -6625,7 +7639,7 @@ index 445bab8..42039ea 100644 /* Return a newly-allocated string formed by concatenating PREFIX and SUFFIX with appropriate separator. If PREFIX or SUFFIX is NULL or empty, then simply copy the SUFFIX or PREFIX, respectively. If OBS is non-null, -@@ -8948,14 +9658,108 @@ static char * +@@ -8969,11 +9745,105 @@ static char * dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu) { struct attribute *attr; @@ -6661,11 +7675,7 @@ index 445bab8..42039ea 100644 + && die->tag == DW_TAG_subprogram) + { + struct type *type = read_type_die (die, cu); - -- attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); -- if (attr && DW_STRING (attr)) -- return DW_STRING (attr); -- return dwarf2_name (die, cu); ++ + c_type_print_args (type, buf, 0, cu->language); + + if (cu->language == language_java) @@ -6683,7 +7693,11 @@ index 445bab8..42039ea 100644 + fputs_unfiltered (" const", buf); + } + } -+ + +- attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); +- if (attr && DW_STRING (attr)) +- return DW_STRING (attr); +- return dwarf2_name (die, cu); + name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack, + &length); + ui_file_delete (buf); @@ -6699,9 +7713,8 @@ index 445bab8..42039ea 100644 + } + + return name; - } - --/* Get name of a die, return NULL if not found. */ ++} ++ +/* Return the fully qualified .symtab name for symbols contained in Fortran + modules. Return DWARF2_NAME otherwise. */ + @@ -6733,13 +7746,10 @@ index 445bab8..42039ea 100644 + } + + return name; -+} -+ -+/* Canonicalize the name of the given DIE. */ + } - static char * - dwarf2_canonicalize_name (char *name, struct dwarf2_cu *cu, -@@ -10181,11 +10985,12 @@ dwarf2_get_ref_die_offset (struct attribute *attr) + /* Get name of a die, return NULL if not found. */ +@@ -10202,11 +11072,11 @@ dwarf2_get_ref_die_offset (struct attribute *attr) return 0; } @@ -6750,21 +7760,11 @@ index 445bab8..42039ea 100644 -static int -dwarf2_get_attr_constant_value (struct attribute *attr, int default_value) +static CORE_ADDR -+dwarf2_get_attr_constant_value (struct attribute *attr, CORE_ADDR default_value, -+ struct dwarf2_cu *cu) ++dwarf2_get_attr_constant_value (struct attribute *attr, CORE_ADDR default_value) { if (attr->form == DW_FORM_sdata) return DW_SND (attr); -@@ -10195,6 +11000,8 @@ dwarf2_get_attr_constant_value (struct attribute *attr, int default_value) - || attr->form == DW_FORM_data4 - || attr->form == DW_FORM_data8) - return DW_UNSND (attr); -+ else if (attr_form_is_block (attr)) -+ return decode_locdesc (DW_BLOCK (attr), cu); - else - { - complaint (&symfile_complaints, _("Attribute value is not a constant (%s)"), -@@ -10990,8 +11797,6 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11011,8 +11881,6 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, { gdb_byte *mac_ptr, *mac_end; struct macro_source_file *current_file = 0; @@ -6773,7 +7773,7 @@ index 445bab8..42039ea 100644 if (dwarf2_per_objfile->macinfo.buffer == NULL) { -@@ -10999,29 +11804,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11020,29 +11888,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, return; } @@ -6808,7 +7808,7 @@ index 445bab8..42039ea 100644 } macinfo_type = read_1_byte (abfd, mac_ptr); -@@ -11032,92 +11827,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11053,92 +11911,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, /* A zero macinfo type indicates the end of the macro information. */ case 0: @@ -6902,7 +7902,7 @@ index 445bab8..42039ea 100644 case DW_MACINFO_define: case DW_MACINFO_undef: -@@ -11132,31 +11842,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11153,31 +11926,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, mac_ptr += bytes_read; if (! current_file) @@ -6945,7 +7945,7 @@ index 445bab8..42039ea 100644 } break; -@@ -11170,22 +11868,9 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11191,22 +11952,9 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read); mac_ptr += bytes_read; @@ -6971,7 +7971,7 @@ index 445bab8..42039ea 100644 } break; -@@ -11239,7 +11924,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11260,7 +12008,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, } break; } @@ -6980,7 +7980,7 @@ index 445bab8..42039ea 100644 } /* Check if the attribute's form is a DW_FORM_block* -@@ -11299,6 +11984,34 @@ attr_form_is_constant (struct attribute *attr) +@@ -11320,6 +12068,34 @@ attr_form_is_constant (struct attribute *attr) } } @@ -7015,7 +8015,7 @@ index 445bab8..42039ea 100644 static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu) -@@ -11328,35 +12041,25 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, +@@ -11349,35 +12125,25 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, SYMBOL_COMPUTED_OPS (sym) = &dwarf2_loclist_funcs; SYMBOL_LOCATION_BATON (sym) = baton; } @@ -7066,7 +8066,7 @@ index 445bab8..42039ea 100644 } } -@@ -11644,6 +12347,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) +@@ -11665,6 +12431,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) return ofs_lhs->offset == ofs_rhs->offset; } @@ -7098,7 +8098,7 @@ index 445bab8..42039ea 100644 /* Set the type associated with DIE to TYPE. Save it in CU's hash table if necessary. For convenience, return TYPE. */ -@@ -11652,6 +12380,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -11673,6 +12464,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { struct dwarf2_offset_and_type **slot, ofs; @@ -7107,7 +8107,7 @@ index 445bab8..42039ea 100644 if (cu->type_hash == NULL) { gdb_assert (cu->per_cu != NULL); -@@ -11794,23 +12524,13 @@ show_dwarf2_cmd (char *args, int from_tty) +@@ -11815,23 +12608,13 @@ show_dwarf2_cmd (char *args, int from_tty) cmd_show_list (show_dwarf2_cmdlist, from_tty, ""); } @@ -7135,7 +8135,7 @@ index 445bab8..42039ea 100644 } /* munmap debug sections for OBJFILE, if necessary. */ -@@ -11819,15 +12539,15 @@ static void +@@ -11840,15 +12623,15 @@ static void dwarf2_per_objfile_cleanup (struct objfile *objfile, void *d) { struct dwarf2_per_objfile *data = d; @@ -7160,7 +8160,7 @@ index 445bab8..42039ea 100644 } void _initialize_dwarf2_read (void); -@@ -11835,6 +12555,7 @@ void _initialize_dwarf2_read (void); +@@ -11856,6 +12639,7 @@ void _initialize_dwarf2_read (void); void _initialize_dwarf2_read (void) { @@ -8995,10 +9995,10 @@ index 8c027c9..d201f76 100644 else { diff --git a/gdb/frame.c b/gdb/frame.c -index 67e0607..7dcf2cb 100644 +index 9ca69bf..1b4e67c 100644 --- a/gdb/frame.c +++ b/gdb/frame.c -@@ -1109,6 +1109,14 @@ has_stack_frames (void) +@@ -1157,6 +1157,14 @@ has_stack_frames (void) if (ptid_equal (inferior_ptid, null_ptid)) return 0; @@ -9013,39 +10013,6 @@ index 67e0607..7dcf2cb 100644 /* Don't try to read from a dead thread. */ if (is_exited (inferior_ptid)) return 0; -@@ -1843,6 +1851,17 @@ get_frame_args_address (struct frame_info *fi) - return fi->base->this_args (fi, &fi->base_cache); - } - -+/* Return true if the frame base for frame FI is BASE; false -+ otherwise. */ -+ -+int -+frame_unwinder_is (struct frame_info *fi, const struct frame_unwind *unwinder) -+{ -+ if (fi->unwind == NULL) -+ fi->unwind = frame_unwind_find_by_frame (fi, &fi->prologue_cache); -+ return fi->unwind == unwinder; -+} -+ - /* Level of the selected frame: 0 for innermost, 1 for its caller, ... - or -1 for a NULL frame. */ - -diff --git a/gdb/frame.h b/gdb/frame.h -index febef5c..611c6d3 100644 ---- a/gdb/frame.h -+++ b/gdb/frame.h -@@ -696,4 +696,10 @@ extern struct frame_info *deprecated_safe_get_selected_frame (void); - - extern struct frame_info *create_new_frame (CORE_ADDR base, CORE_ADDR pc); - -+/* Return true if the frame unwinder for frame FI is UNWINDER; false -+ otherwise. */ -+ -+extern int frame_unwinder_is (struct frame_info *fi, -+ const struct frame_unwind *unwinder); -+ - #endif /* !defined (FRAME_H) */ diff --git a/gdb/gdbinit.in b/gdb/gdbinit.in index ffb7f53..a2e7e94 100644 --- a/gdb/gdbinit.in @@ -9473,10 +10440,21 @@ index 0000000..b8213f5 + NULL, +}; diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h -index 79d33fe..aecd820 100644 +index 79d33fe..d3b4fa1 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h -@@ -249,6 +249,9 @@ extern struct thread_info *any_thread_of_process (int pid); +@@ -185,6 +185,10 @@ struct thread_info + /* True if this thread has been explicitly requested to stop. */ + int stop_requested; + ++ /* The initiating frame of a nexting operation, used for deciding ++ which exceptions to intercept. */ ++ struct frame_id initiating_frame; ++ + /* Private data used by the target vector implementation. */ + struct private_thread_info *private; + }; +@@ -249,6 +253,9 @@ extern struct thread_info *any_thread_of_process (int pid); /* Change the ptid of thread OLD_PTID to NEW_PTID. */ void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid); @@ -10609,21 +11587,6 @@ index 0f9d44e..c910e88 100644 /* We didn't find it; print the raw data. */ if (vbit) -diff --git a/gdb/gnulib/Makefile.in b/gdb/gnulib/Makefile.in -index 5e55573..5439aba 100644 ---- a/gdb/gnulib/Makefile.in -+++ b/gdb/gnulib/Makefile.in -@@ -1,8 +1,8 @@ - # Makefile.in generated by automake 1.9.6 from Makefile.am. - # @configure_input@ - --# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, --# 2003, 2004, 2005 Free Software Foundation, Inc. -+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -+# 2004, 2005, 2009 Free Software Foundation, Inc. - # This Makefile.in is free software; the Free Software Foundation - # gives unlimited permission to copy and/or distribute it, - # with or without modifications, as long as this notice is preserved. diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 991b27f..411b41b 100644 --- a/gdb/i386-linux-nat.c @@ -10866,11 +11829,141 @@ index f49b9f6..cd31958 100644 int debug_register_length; }; +diff --git a/gdb/infcmd.c b/gdb/infcmd.c +index 9e98290..fab1892 100644 +--- a/gdb/infcmd.c ++++ b/gdb/infcmd.c +@@ -801,7 +801,7 @@ nexti_command (char *count_string, int from_tty) + step_1 (1, 1, count_string); + } + +-static void ++void + delete_longjmp_breakpoint_cleanup (void *arg) + { + int thread = * (int *) arg; +@@ -841,10 +841,13 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) + + if (!single_inst || skip_subroutines) /* leave si command alone */ + { ++ struct thread_info *tp = inferior_thread (); ++ + if (in_thread_list (inferior_ptid)) + thread = pid_to_thread_id (inferior_ptid); + + set_longjmp_breakpoint (thread); ++ tp->initiating_frame = get_frame_id (get_current_frame ()); + + make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); + } +@@ -1193,6 +1196,15 @@ signal_command (char *signum_exp, int from_tty) + proceed ((CORE_ADDR) -1, oursig, 0); + } + ++/* A continuation callback for until_next_command. */ ++ ++static void ++until_next_continuation (void *arg) ++{ ++ struct thread_info *tp = arg; ++ delete_longjmp_breakpoint (tp->num); ++} ++ + /* Proceed until we reach a different source line with pc greater than + our current one or exit the function. We skip calls in both cases. + +@@ -1209,6 +1221,8 @@ until_next_command (int from_tty) + struct symbol *func; + struct symtab_and_line sal; + struct thread_info *tp = inferior_thread (); ++ int thread = tp->num; ++ struct cleanup *old_chain; + + clear_proceed_status (); + set_step_frame (); +@@ -1244,7 +1258,19 @@ until_next_command (int from_tty) + + tp->step_multi = 0; /* Only one call to proceed */ + ++ set_longjmp_breakpoint (thread); ++ tp->initiating_frame = get_frame_id (frame); ++ old_chain = make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); ++ + proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1); ++ ++ if (target_can_async_p () && is_running (inferior_ptid)) ++ { ++ discard_cleanups (old_chain); ++ add_continuation (tp, until_next_continuation, tp, NULL); ++ } ++ else ++ do_cleanups (old_chain); + } + + static void +@@ -1421,6 +1447,7 @@ finish_command_continuation (void *arg) + if (bs != NULL && tp->proceed_to_finish) + observer_notify_normal_stop (bs, 1 /* print frame */); + delete_breakpoint (a->breakpoint); ++ delete_longjmp_breakpoint (inferior_thread ()->num); + } + + static void +@@ -1504,6 +1531,7 @@ finish_forward (struct symbol *function, struct frame_info *frame) + struct breakpoint *breakpoint; + struct cleanup *old_chain; + struct finish_command_continuation_args *cargs; ++ int thread = tp->num; + + sal = find_pc_line (get_frame_pc (frame), 0); + sal.pc = get_frame_pc (frame); +@@ -1514,6 +1542,10 @@ finish_forward (struct symbol *function, struct frame_info *frame) + + old_chain = make_cleanup_delete_breakpoint (breakpoint); + ++ set_longjmp_breakpoint (thread); ++ tp->initiating_frame = get_frame_id (frame); ++ make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); ++ + tp->proceed_to_finish = 1; /* We want stop_registers, please... */ + proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); + +diff --git a/gdb/inferior.h b/gdb/inferior.h +index 7312e51..d4eae88 100644 +--- a/gdb/inferior.h ++++ b/gdb/inferior.h +@@ -272,6 +272,8 @@ extern void interrupt_target_command (char *args, int from_tty); + + extern void interrupt_target_1 (int all_threads); + ++extern void delete_longjmp_breakpoint_cleanup (void *arg); ++ + extern void detach_command (char *, int); + + extern void notice_new_inferior (ptid_t, int, int); diff --git a/gdb/infrun.c b/gdb/infrun.c -index e3eddce..8917ac9 100644 +index c907635..bda8d84 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -2630,6 +2630,10 @@ handle_inferior_event (struct execution_control_state *ecs) +@@ -45,6 +45,8 @@ + #include "language.h" + #include "solib.h" + #include "main.h" ++#include "dictionary.h" ++#include "block.h" + #include "gdb_assert.h" + #include "mi/mi-common.h" + #include "event-top.h" +@@ -1782,6 +1784,8 @@ static void insert_step_resume_breakpoint_at_sal (struct gdbarch *gdbarch, + struct symtab_and_line sr_sal, + struct frame_id sr_id); + static void insert_longjmp_resume_breakpoint (struct gdbarch *, CORE_ADDR); ++static void check_exception_resume (struct execution_control_state *, ++ struct frame_info *, struct symbol *); + + 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) stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid)); @@ -10881,7 +11974,7 @@ index e3eddce..8917ac9 100644 ecs->event_thread->stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid); ecs->random_signal = !bpstat_explains_signal (ecs->event_thread->stop_bpstat); -@@ -2667,6 +2671,10 @@ handle_inferior_event (struct execution_control_state *ecs) +@@ -2670,6 +2678,10 @@ handle_inferior_event (struct execution_control_state *ecs) stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid)); @@ -10892,6 +11985,212 @@ index e3eddce..8917ac9 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: + + ecs->event_thread->stepping_over_breakpoint = 1; + +- if (!gdbarch_get_longjmp_target_p (gdbarch) +- || !gdbarch_get_longjmp_target (gdbarch, frame, &jmp_buf_pc)) ++ if (what.is_longjmp) + { +- if (debug_infrun) +- fprintf_unfiltered (gdb_stdlog, "\ ++ if (!gdbarch_get_longjmp_target_p (gdbarch) ++ || !gdbarch_get_longjmp_target (gdbarch, ++ frame, &jmp_buf_pc)) ++ { ++ if (debug_infrun) ++ fprintf_unfiltered (gdb_stdlog, "\ + infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n"); +- keep_going (ecs); +- return; +- } ++ keep_going (ecs); ++ return; ++ } + +- /* We're going to replace the current step-resume breakpoint +- with a longjmp-resume breakpoint. */ +- delete_step_resume_breakpoint (ecs->event_thread); ++ /* We're going to replace the current step-resume breakpoint ++ with a longjmp-resume breakpoint. */ ++ delete_step_resume_breakpoint (ecs->event_thread); + +- /* Insert a breakpoint at resume address. */ +- insert_longjmp_resume_breakpoint (gdbarch, jmp_buf_pc); ++ /* Insert a breakpoint at resume address. */ ++ insert_longjmp_resume_breakpoint (gdbarch, jmp_buf_pc); ++ } ++ else ++ { ++ struct symbol *func = get_frame_function (frame); + ++ if (func) ++ check_exception_resume (ecs, frame, func); ++ } + keep_going (ecs); + return; + +@@ -3439,6 +3461,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); + ++ if (!what.is_longjmp) ++ { ++ /* There are several cases to consider. ++ ++ 1. The initiating frame no longer exists. In this case ++ we must stop, because the exception has gone too far. ++ ++ 2. The initiating frame exists, and is the same as the ++ current frame. ++ ++ 2.1. If we are stepping, defer to the stepping logic. ++ ++ 2.2. Otherwise, we are not stepping, so we are doing a ++ "finish" and we have reached the calling frame. So, ++ stop. ++ ++ 3. The initiating frame exists and is different from ++ the current frame. This means the exception has been ++ caught beneath the initiating frame, so keep going. */ ++ struct frame_info *init_frame ++ = frame_find_by_id (ecs->event_thread->initiating_frame); ++ if (init_frame) ++ { ++ struct frame_id current_id ++ = get_frame_id (get_current_frame ()); ++ if (frame_id_eq (current_id, ++ ecs->event_thread->initiating_frame)) ++ { ++ if (ecs->event_thread->step_range_start) ++ { ++ /* Case 2.1. */ ++ break; ++ } ++ else ++ { ++ /* Case 2.2: fall through. */ ++ } ++ } ++ else ++ { ++ /* Case 3. */ ++ keep_going (ecs); ++ return; ++ } ++ } ++ } ++ + 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) + set_momentary_breakpoint_at_pc (gdbarch, pc, bp_longjmp_resume); + } + ++/* Insert an exception resume breakpoint. TP is the thread throwing ++ the exception. The block B is the block of the unwinder debug hook ++ function. FRAME is the frame corresponding to the call to this ++ function. SYM is the symbol of the function argument holding the ++ target PC of the exception. */ ++ ++static void ++insert_exception_resume_breakpoint (struct thread_info *tp, ++ struct block *b, ++ struct frame_info *frame, ++ struct symbol *sym) ++{ ++ struct gdb_exception e; ++ ++ /* We want to ignore errors here. */ ++ TRY_CATCH (e, RETURN_MASK_ALL) ++ { ++ struct symbol *vsym; ++ struct value *value; ++ CORE_ADDR handler; ++ struct breakpoint *bp; ++ ++ vsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), b, VAR_DOMAIN, NULL); ++ value = read_var_value (vsym, frame); ++ handler = value_as_address (value); ++ ++ /* We're going to replace the current step-resume breakpoint ++ with an exception-resume breakpoint. */ ++ delete_step_resume_breakpoint (tp); ++ ++ if (debug_infrun) ++ fprintf_unfiltered (gdb_stdlog, ++ "infrun: exception resume at %lx\n", ++ (unsigned long) handler); ++ ++ bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame), ++ handler, bp_exception_resume); ++ inferior_thread ()->step_resume_breakpoint = bp; ++ } ++} ++ ++/* This is called when an exception has been intercepted. Check to ++ see whether the exception's destination is of interest, and if so, ++ set an exception resume breakpoint there. */ ++ ++static void ++check_exception_resume (struct execution_control_state *ecs, ++ struct frame_info *frame, struct symbol *func) ++{ ++ struct gdb_exception e; ++ ++ TRY_CATCH (e, RETURN_MASK_ALL) ++ { ++ struct block *b; ++ struct dict_iterator iter; ++ struct symbol *sym; ++ int argno = 0; ++ ++ /* The exception breakpoint is a thread-specific breakpoint on ++ the unwinder's debug hook, declared as: ++ ++ void _Unwind_DebugHook (void *cfa, void *handler); ++ ++ The CFA argument indicates the frame to which control is ++ about to be transferred. HANDLER is the destination PC. ++ ++ We ignore the CFA and set a temporary breakpoint at HANDLER. ++ This is not extremely efficient but it avoids issues in gdb ++ with computing the DWARF CFA, and it also works even in weird ++ cases such as throwing an exception from inside a signal ++ handler. */ ++ ++ b = SYMBOL_BLOCK_VALUE (func); ++ ALL_BLOCK_SYMBOLS (b, iter, sym) ++ { ++ if (!SYMBOL_IS_ARGUMENT (sym)) ++ continue; ++ ++ if (argno == 0) ++ ++argno; ++ else ++ { ++ insert_exception_resume_breakpoint (ecs->event_thread, ++ b, frame, sym); ++ break; ++ } ++ } ++ } ++} ++ + static void + stop_stepping (struct execution_control_state *ecs) + { +@@ -4499,6 +4658,8 @@ keep_going (struct execution_control_state *ecs) + } + if (e.reason < 0) + { ++ if (debug_infrun) ++ exception_fprintf (gdb_stdlog, e, "infrun: exception while inserting breakpoints: "); + stop_stepping (ecs); + return; + } diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 6b68e7d..5095180 100644 --- a/gdb/jv-lang.c @@ -11214,7 +12513,7 @@ index 5f9a0fe..66fa067 100644 macho_symfile_offsets, /* sym_offsets: xlate external to internal form */ NULL /* next: pointer to next struct sym_fns */ diff --git a/gdb/main.c b/gdb/main.c -index 8b66f78..ddeab6f 100644 +index 55411a8..ac9a540 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -40,6 +40,7 @@ @@ -11395,7 +12694,7 @@ 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..e4ca621 100644 +index 0cf03d9..93459dd 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, @@ -11422,7 +12721,17 @@ index 0cf03d9..e4ca621 100644 type = varobj_get_type (var); if (type != NULL) -@@ -138,6 +142,8 @@ mi_cmd_var_create (char *command, char **argv, int argc) +@@ -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 */); @@ -11431,7 +12740,7 @@ index 0cf03d9..e4ca621 100644 do_cleanups (old_cleanups); } -@@ -223,6 +229,7 @@ mi_cmd_var_set_format (char *command, char **argv, int argc) +@@ -223,6 +232,7 @@ mi_cmd_var_set_format (char *command, char **argv, int argc) { enum varobj_display_formats format; struct varobj *var; @@ -11439,7 +12748,7 @@ index 0cf03d9..e4ca621 100644 if (argc != 2) error (_("mi_cmd_var_set_format: Usage: NAME FORMAT.")); -@@ -239,7 +246,9 @@ mi_cmd_var_set_format (char *command, char **argv, int argc) +@@ -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 */ @@ -11450,7 +12759,7 @@ index 0cf03d9..e4ca621 100644 } void -@@ -337,11 +346,12 @@ Must be: 0 or \"%s\", 1 or \"%s\", 2 or \"%s\""), +@@ -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 @@ -11465,7 +12774,7 @@ index 0cf03d9..e4ca621 100644 if (print_values == PRINT_NO_VALUES) return 0; -@@ -349,6 +359,10 @@ mi_print_value_p (struct type *type, enum print_values print_values) +@@ -349,6 +362,10 @@ mi_print_value_p (struct type *type, enum print_values print_values) if (print_values == PRINT_ALL_VALUES) return 1; @@ -11476,7 +12785,7 @@ index 0cf03d9..e4ca621 100644 if (type == NULL) return 1; else -@@ -369,24 +383,35 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) +@@ -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; @@ -11519,7 +12828,7 @@ index 0cf03d9..e4ca621 100644 print_values = mi_parse_values_option (argv[0]); else print_values = PRINT_NO_VALUES; -@@ -398,21 +423,28 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) +@@ -398,21 +426,28 @@ mi_cmd_var_list_children (char *command, char **argv, int argc) xfree (display_hint); } @@ -11561,7 +12870,7 @@ index 0cf03d9..e4ca621 100644 } void -@@ -538,16 +570,24 @@ mi_cmd_var_evaluate_expression (char *command, char **argv, int argc) +@@ -538,16 +573,24 @@ mi_cmd_var_evaluate_expression (char *command, char **argv, int argc) var = varobj_get_handle (argv[optind]); if (formatFound) @@ -11589,7 +12898,7 @@ index 0cf03d9..e4ca621 100644 if (argc != 2) error (_("mi_cmd_var_assign: Usage: NAME EXPRESSION.")); -@@ -563,7 +603,9 @@ mi_cmd_var_assign (char *command, char **argv, int argc) +@@ -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")); @@ -11600,7 +12909,7 @@ index 0cf03d9..e4ca621 100644 } /* Type used for parameters passing to mi_cmd_var_update_iter. */ -@@ -644,7 +686,6 @@ mi_cmd_var_update (char *command, char **argv, int argc) +@@ -644,7 +689,6 @@ mi_cmd_var_update (char *command, char **argv, int argc) } else { @@ -11608,7 +12917,7 @@ index 0cf03d9..e4ca621 100644 struct varobj *var = varobj_get_handle (name); varobj_update_one (var, print_values, 1 /* explicit */); -@@ -670,6 +711,7 @@ varobj_update_one (struct varobj *var, enum print_values print_values, +@@ -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; @@ -11616,7 +12925,7 @@ index 0cf03d9..e4ca621 100644 if (mi_version (uiout) > 1) cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); -@@ -678,8 +720,12 @@ varobj_update_one (struct varobj *var, enum print_values print_values, +@@ -678,8 +723,12 @@ varobj_update_one (struct varobj *var, enum print_values print_values, switch (r->status) { case VAROBJ_IN_SCOPE: @@ -11631,7 +12940,7 @@ index 0cf03d9..e4ca621 100644 ui_out_field_string (uiout, "in_scope", "true"); break; case VAROBJ_NOT_IN_SCOPE: -@@ -699,11 +745,11 @@ varobj_update_one (struct varobj *var, enum print_values print_values, +@@ -699,11 +748,11 @@ varobj_update_one (struct varobj *var, enum print_values print_values, } if (r->type_changed) @@ -11648,7 +12957,7 @@ index 0cf03d9..e4ca621 100644 display_hint = varobj_get_display_hint (var); if (display_hint) -@@ -712,28 +758,56 @@ varobj_update_one (struct varobj *var, enum print_values print_values, +@@ -712,28 +761,59 @@ varobj_update_one (struct varobj *var, enum print_values print_values, xfree (display_hint); } @@ -11658,18 +12967,21 @@ index 0cf03d9..e4ca621 100644 - 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)); -- VEC (varobj_p)* children = varobj_list_children (r->varobj); +- for (ix = 0; VEC_iterate (varobj_p, children, ix, child); ++ix) + if (r->new) + { + int j; + varobj_p child; + struct cleanup *cleanup; - -- for (ix = 0; VEC_iterate (varobj_p, children, ix, child); ++ix) ++ + cleanup = make_cleanup_ui_out_list_begin_end (uiout, "new_children"); + for (j = 0; VEC_iterate (varobj_p, r->new, j, child); ++j) { @@ -11749,28 +13061,18 @@ index 85ad0c4..dfab411 100644 /* Description of a single command. */ diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c -index 6aa1d08..448d10a 100644 +index 857a5d5..6181002 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c -@@ -1130,6 +1130,10 @@ mi_cmd_list_features (char *command, char **argv, int argc) +@@ -1130,7 +1130,7 @@ mi_cmd_list_features (char *command, char **argv, int argc) ui_out_field_string (uiout, NULL, "frozen-varobjs"); ui_out_field_string (uiout, NULL, "pending-breakpoints"); ui_out_field_string (uiout, NULL, "thread-info"); +- + -+#if HAVE_PYTHON -+ ui_out_field_string (uiout, NULL, "python"); -+#endif - #if HAVE_PYTHON ui_out_field_string (uiout, NULL, "python"); -@@ -1354,6 +1358,7 @@ mi_cmd_execute (struct mi_parse *parse) - int i; - - free_all_values (); -+ free_all_types (); - cleanup = make_cleanup (null_cleanup, NULL); - - if (parse->frame != -1 && parse->thread == -1) + #endif diff --git a/gdb/mipsread.c b/gdb/mipsread.c index a84003f..924c1c5 100644 --- a/gdb/mipsread.c @@ -11784,7 +13086,7 @@ 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 92db65e..4d39112 100644 +index 3fa68f6..10d2bd1 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -50,7 +50,6 @@ @@ -11812,9 +13114,9 @@ index 92db65e..4d39112 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 -@@ -716,6 +717,20 @@ have_partial_symbols (void) - return 1; - } +@@ -730,6 +731,20 @@ have_partial_symbols (void) + if (objfile_has_partial_symbols (ofp)) + return 1; } + + /* Try again, after reading partial symbols. We do this in two @@ -11834,7 +13136,7 @@ index 92db65e..4d39112 100644 } diff --git a/gdb/objfiles.h b/gdb/objfiles.h -index aecf8d8..9a7d635 100644 +index 6abcb0f..2139590 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -212,6 +212,11 @@ struct objfile @@ -11865,7 +13167,7 @@ index aecf8d8..9a7d635 100644 /* The object file that the main symbol table was loaded from (e.g. the argument to the "symbol-file" or "file" command). */ -@@ -554,6 +568,13 @@ extern void gdb_bfd_unref (struct bfd *abfd); +@@ -559,6 +573,13 @@ extern void gdb_bfd_unref (struct bfd *abfd); ALL_OBJFILES (objfile) \ ALL_OBJFILE_PSYMTABS (objfile, p) @@ -13210,11 +14512,11 @@ index 0000000..debb3bb + return wanted == found + +InScope () -diff --git a/gdb/python/python-block.c b/gdb/python/python-block.c +diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c new file mode 100644 index 0000000..8019e9d --- /dev/null -+++ b/gdb/python/python-block.c ++++ b/gdb/python/py-block.c @@ -0,0 +1,265 @@ +/* Python interface to blocks. + @@ -13481,11 +14783,11 @@ index 0000000..8019e9d + blpy_block_syms_iternext, /* tp_iternext */ + 0 /* tp_methods */ +}; -diff --git a/gdb/python/python-breakpoint.c b/gdb/python/python-breakpoint.c +diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c new file mode 100644 index 0000000..afa9526 --- /dev/null -+++ b/gdb/python/python-breakpoint.c ++++ b/gdb/python/py-breakpoint.c @@ -0,0 +1,665 @@ +/* Python interface to breakpoints + @@ -14152,10 +15454,10 @@ index 0000000..afa9526 + 0, /* tp_members */ + breakpoint_object_getset /* tp_getset */ +}; -diff --git a/gdb/python/python-cmd.c b/gdb/python/python-cmd.c +diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c index 528aca6..04b3fd1 100644 ---- a/gdb/python/python-cmd.c -+++ b/gdb/python/python-cmd.c +--- a/gdb/python/py-cmd.c ++++ b/gdb/python/py-cmd.c @@ -49,8 +49,7 @@ static struct cmdpy_completer completers[] = #define N_COMPLETERS (sizeof (completers) / sizeof (completers[0])) @@ -14217,10 +15519,10 @@ index 528aca6..04b3fd1 100644 if (! cmd_name) return -1; -diff --git a/gdb/python/python-frame.c b/gdb/python/python-frame.c +diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c index 279415c..5d8ce0a 100644 ---- a/gdb/python/python-frame.c -+++ b/gdb/python/python-frame.c +--- a/gdb/python/py-frame.c ++++ b/gdb/python/py-frame.c @@ -202,10 +202,59 @@ frapy_pc (PyObject *self, PyObject *args) return PyLong_FromUnsignedLongLong (pc); } @@ -14405,11 +15707,11 @@ index 279415c..5d8ce0a 100644 {NULL} /* Sentinel */ }; -diff --git a/gdb/python/python-hooks.c b/gdb/python/python-hooks.c +diff --git a/gdb/python/py-hooks.c b/gdb/python/py-hooks.c new file mode 100644 index 0000000..a3140bc --- /dev/null -+++ b/gdb/python/python-hooks.c ++++ b/gdb/python/py-hooks.c @@ -0,0 +1,50 @@ +/* Notifications from gdb to Python + @@ -14461,11 +15763,11 @@ index 0000000..a3140bc + Py_DECREF (hooks); + return result; +} -diff --git a/gdb/python/python-inferior.c b/gdb/python/python-inferior.c +diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c new file mode 100644 index 0000000..5e90cc2 --- /dev/null -+++ b/gdb/python/python-inferior.c ++++ b/gdb/python/py-inferior.c @@ -0,0 +1,926 @@ +/* Python interface to inferiors. + @@ -15393,11 +16695,11 @@ index 0000000..5e90cc2 + 0, /* tp_alloc */ + PyType_GenericNew /* tp_new */ +}; -diff --git a/gdb/python/python-infthread.c b/gdb/python/python-infthread.c +diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c new file mode 100644 index 0000000..21e4eab --- /dev/null -+++ b/gdb/python/python-infthread.c ++++ b/gdb/python/py-infthread.c @@ -0,0 +1,285 @@ +/* Python interface to inferior threads. + @@ -15684,149 +16986,11 @@ index 0000000..21e4eab + 0, /* tp_init */ + 0 /* tp_alloc */ +}; -diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h -index 67a78af..47662d9 100644 ---- a/gdb/python/python-internal.h -+++ b/gdb/python/python-internal.h -@@ -61,33 +61,76 @@ typedef int Py_ssize_t; - #define PyEval_ReleaseLock() 0 - #endif - -+#include "command.h" -+ -+struct block; -+struct symbol; -+struct symtab_and_line; - struct value; - struct language_defn; - - extern PyObject *gdb_module; -+extern PyTypeObject block_object_type; - extern PyTypeObject value_object_type; -+extern PyTypeObject symbol_object_type; -+ -+/* Used in python-inferior.c. */ -+typedef struct -+{ -+ PyObject_HEAD -+ -+ /* The thread we represent. */ -+ struct thread_info *thread; -+ -+ /* The Inferior object to which this thread belongs. */ -+ PyObject *inf_obj; -+} thread_object; - - PyObject *gdbpy_history (PyObject *self, PyObject *args); -+PyObject *gdbpy_breakpoints (PyObject *, PyObject *); - PyObject *gdbpy_frame_stop_reason_string (PyObject *, PyObject *); -+PyObject *gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw); - PyObject *gdbpy_selected_frame (PyObject *self, PyObject *args); -+PyObject *gdbpy_block_for_pc (PyObject *self, PyObject *args); - PyObject *gdbpy_lookup_type (PyObject *self, PyObject *args, PyObject *kw); -+PyObject *gdbpy_inferiors (PyObject *unused, PyObject *unused2); -+PyObject *gdbpy_selected_thread (PyObject *self, PyObject *args); - -+PyObject *symtab_and_line_to_sal_object (struct symtab_and_line sal); -+PyObject *symtab_to_symtab_object (struct symtab *symtab); -+PyObject *symbol_to_symbol_object (struct symbol *sym); -+PyObject *block_to_block_object (struct block *block); - PyObject *value_to_value_object (struct value *v); - PyObject *type_to_type_object (struct type *); - PyObject *objfile_to_objfile_object (struct objfile *); -+PyObject *frame_info_to_frame_object (struct frame_info *frame); -+thread_object *create_thread_object (struct thread_info *tp); -+thread_object *find_thread_object (ptid_t ptid); -+PyObject *find_inferior_object (int pid); - - PyObject *objfpy_get_printers (PyObject *, void *); - -+struct block *block_object_to_block (PyObject *obj); -+struct symbol *symbol_object_to_symbol (PyObject *obj); - struct value *value_object_to_value (PyObject *self); - struct value *convert_value_from_python (PyObject *obj); - struct type *type_object_to_type (PyObject *obj); - -+PyObject *gdbpy_get_hook_function (const char *); -+ - void gdbpy_initialize_values (void); -+void gdbpy_initialize_breakpoints (void); - void gdbpy_initialize_frames (void); -+void gdbpy_initialize_symtabs (void); - void gdbpy_initialize_commands (void); -+void gdbpy_initialize_symbols (void); - void gdbpy_initialize_types (void); -+void gdbpy_initialize_blocks (void); - void gdbpy_initialize_functions (void); - void gdbpy_initialize_objfile (void); -+void gdbpy_initialize_parameters (void); -+void gdbpy_initialize_thread (void); -+void gdbpy_initialize_inferior (void); - - struct cleanup *make_cleanup_py_decref (PyObject *py); - -@@ -97,6 +140,12 @@ struct cleanup *ensure_python_env (struct gdbarch *gdbarch, - extern struct gdbarch *python_gdbarch; - extern const struct language_defn *python_language; - -+char *gdbpy_parse_command_name (char *text, -+ struct cmd_list_element ***base_list, -+ struct cmd_list_element **start_list); -+ -+PyObject *gdbpy_parameter_value (enum var_types, void *); -+ - /* Use this after a TRY_EXCEPT to throw the appropriate Python - exception. */ - #define GDB_PY_HANDLE_EXCEPTION(Exception) \ -@@ -107,6 +156,19 @@ extern const struct language_defn *python_language; - "%s", Exception.message); \ - } while (0) - -+/* Use this after a TRY_EXCEPT to throw the appropriate Python -+ exception. This macro is for use inside setter functions. */ -+#define GDB_PY_SET_HANDLE_EXCEPTION(Exception) \ -+ do { \ -+ if (Exception.reason < 0) \ -+ { \ -+ PyErr_Format (Exception.reason == RETURN_QUIT \ -+ ? PyExc_KeyboardInterrupt : PyExc_RuntimeError, \ -+ "%s", Exception.message); \ -+ return -1; \ -+ } \ -+ } while (0) -+ - - void gdbpy_print_stack (void); - -@@ -118,17 +180,22 @@ char *python_string_to_host_string (PyObject *obj); - PyObject *target_string_to_unicode (const gdb_byte *str, int length); - int gdbpy_is_string (PyObject *obj); - -+int gdbpy_is_value_object (PyObject *obj); -+ - /* Note that these are declared here, and not in python.h with the - other pretty-printer functions, because they refer to PyObject. */ - PyObject *apply_varobj_pretty_printer (PyObject *print_obj, - struct value **replacement); - PyObject *gdbpy_get_varobj_pretty_printer (struct value *value); -+PyObject *gdbpy_instantiate_printer (PyObject *cons, PyObject *value); - char *gdbpy_get_display_hint (PyObject *printer); - PyObject *gdbpy_default_visualizer (PyObject *self, PyObject *args); - --extern PyObject *gdbpy_doc_cst; - extern PyObject *gdbpy_children_cst; - extern PyObject *gdbpy_to_string_cst; - extern PyObject *gdbpy_display_hint_cst; -+extern PyObject *gdbpy_doc_cst; -+ -+int get_addr_from_python (PyObject *obj, CORE_ADDR *addr); - - #endif /* GDB_PYTHON_INTERNAL_H */ -diff --git a/gdb/python/python-membuf.c b/gdb/python/python-membuf.c +diff --git a/gdb/python/py-membuf.c b/gdb/python/py-membuf.c new file mode 100644 index 0000000..7bc294c --- /dev/null -+++ b/gdb/python/python-membuf.c ++++ b/gdb/python/py-membuf.c @@ -0,0 +1,268 @@ +/* Python interface to the inferior memory. + @@ -16096,11 +17260,11 @@ index 0000000..7bc294c + Py_INCREF (&membuf_object_type); + PyModule_AddObject (gdb_module, "Membuf", (PyObject *) &membuf_object_type); +} -diff --git a/gdb/python/python-param.c b/gdb/python/python-param.c +diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c new file mode 100644 index 0000000..1f591a8 --- /dev/null -+++ b/gdb/python/python-param.c ++++ b/gdb/python/py-param.c @@ -0,0 +1,606 @@ +/* gdb parameters implemented in Python + @@ -16708,10 +17872,10 @@ index 0000000..1f591a8 + 0, /* tp_alloc */ + PyType_GenericNew /* tp_new */ +}; -diff --git a/gdb/python/python-prettyprint.c b/gdb/python/python-prettyprint.c +diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 5d696c8..a6348ba 100644 ---- a/gdb/python/python-prettyprint.c -+++ b/gdb/python/python-prettyprint.c +--- a/gdb/python/py-prettyprint.c ++++ b/gdb/python/py-prettyprint.c @@ -121,6 +121,7 @@ find_pretty_printer (PyObject *value) return function; @@ -16755,11 +17919,11 @@ index 5d696c8..a6348ba 100644 val_obj = value_to_value_object (value); if (! val_obj) return NULL; -diff --git a/gdb/python/python-symbol.c b/gdb/python/python-symbol.c +diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c new file mode 100644 index 0000000..03d43c1 --- /dev/null -+++ b/gdb/python/python-symbol.c ++++ b/gdb/python/py-symbol.c @@ -0,0 +1,336 @@ +/* Python interface to symbols. + @@ -17097,11 +18261,11 @@ index 0000000..03d43c1 + 0, /* tp_members */ + symbol_object_getset /* tp_getset */ +}; -diff --git a/gdb/python/python-symtab.c b/gdb/python/python-symtab.c +diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c new file mode 100644 index 0000000..830e586 --- /dev/null -+++ b/gdb/python/python-symtab.c ++++ b/gdb/python/py-symtab.c @@ -0,0 +1,322 @@ +/* Python interface to symbol tables. + @@ -17425,10 +18589,10 @@ index 0000000..830e586 + 0, /* tp_members */ + sal_object_getset /* tp_getset */ +}; -diff --git a/gdb/python/python-type.c b/gdb/python/python-type.c +diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index f23248c..b41d868 100644 ---- a/gdb/python/python-type.c -+++ b/gdb/python/python-type.c +--- a/gdb/python/py-type.c ++++ b/gdb/python/py-type.c @@ -27,6 +27,8 @@ #include "demangle.h" #include "objfiles.h" @@ -17734,10 +18898,10 @@ index f23248c..b41d868 100644 } -diff --git a/gdb/python/python-utils.c b/gdb/python/python-utils.c +diff --git a/gdb/python/py-utils.c b/gdb/python/py-utils.c index 49c0437..84a476e 100644 ---- a/gdb/python/python-utils.c -+++ b/gdb/python/python-utils.c +--- a/gdb/python/py-utils.c ++++ b/gdb/python/py-utils.c @@ -19,6 +19,7 @@ #include "defs.h" @@ -17795,10 +18959,10 @@ index 49c0437..84a476e 100644 + + return 1; +} -diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c -index c4217d5..b993515 100644 ---- a/gdb/python/python-value.c -+++ b/gdb/python/python-value.c +diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c +index 3d88aa3..b993515 100644 +--- a/gdb/python/py-value.c ++++ b/gdb/python/py-value.c @@ -25,6 +25,7 @@ #include "language.h" #include "dfp.h" @@ -17818,37 +18982,7 @@ index c4217d5..b993515 100644 #define builtin_type_pybool \ language_bool_type (python_language, python_gdbarch) -@@ -693,7 +698,10 @@ valpy_richcompare (PyObject *self, PyObject *other, int op) - { - value_other = convert_value_from_python (other); - if (value_other == NULL) -- return NULL; -+ { -+ result = -1; -+ break; -+ } - - switch (op) { - case Py_LT: -@@ -720,11 +728,16 @@ valpy_richcompare (PyObject *self, PyObject *other, int op) - /* Can't happen. */ - PyErr_SetString (PyExc_NotImplementedError, - "Invalid operation on gdb.Value."); -- return NULL; -+ result = -1; -+ break; - } - } - GDB_PY_HANDLE_EXCEPTION (except); - -+ /* In this case, the Python exception has already been set. */ -+ if (result < 0) -+ return NULL; -+ - if (result == 1) - Py_RETURN_TRUE; - -@@ -883,7 +896,34 @@ convert_value_from_python (PyObject *obj) +@@ -891,7 +896,34 @@ convert_value_from_python (PyObject *obj) { LONGEST l = PyLong_AsLongLong (obj); @@ -17884,7 +19018,7 @@ index c4217d5..b993515 100644 value = value_from_longest (builtin_type_pylong, l); } else if (PyFloat_Check (obj)) -@@ -942,6 +982,25 @@ gdbpy_history (PyObject *self, PyObject *args) +@@ -950,6 +982,25 @@ gdbpy_history (PyObject *self, PyObject *args) return value_to_value_object (res_val); } @@ -17910,7 +19044,7 @@ index c4217d5..b993515 100644 void gdbpy_initialize_values (void) { -@@ -952,6 +1011,8 @@ gdbpy_initialize_values (void) +@@ -960,6 +1011,8 @@ gdbpy_initialize_values (void) PyModule_AddObject (gdb_module, "Value", (PyObject *) &value_object_type); values_in_python = NULL; @@ -17919,6 +19053,144 @@ index c4217d5..b993515 100644 } +diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h +index 67a78af..47662d9 100644 +--- a/gdb/python/python-internal.h ++++ b/gdb/python/python-internal.h +@@ -61,33 +61,76 @@ typedef int Py_ssize_t; + #define PyEval_ReleaseLock() 0 + #endif + ++#include "command.h" ++ ++struct block; ++struct symbol; ++struct symtab_and_line; + struct value; + struct language_defn; + + extern PyObject *gdb_module; ++extern PyTypeObject block_object_type; + extern PyTypeObject value_object_type; ++extern PyTypeObject symbol_object_type; ++ ++/* Used in python-inferior.c. */ ++typedef struct ++{ ++ PyObject_HEAD ++ ++ /* The thread we represent. */ ++ struct thread_info *thread; ++ ++ /* The Inferior object to which this thread belongs. */ ++ PyObject *inf_obj; ++} thread_object; + + PyObject *gdbpy_history (PyObject *self, PyObject *args); ++PyObject *gdbpy_breakpoints (PyObject *, PyObject *); + PyObject *gdbpy_frame_stop_reason_string (PyObject *, PyObject *); ++PyObject *gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw); + PyObject *gdbpy_selected_frame (PyObject *self, PyObject *args); ++PyObject *gdbpy_block_for_pc (PyObject *self, PyObject *args); + PyObject *gdbpy_lookup_type (PyObject *self, PyObject *args, PyObject *kw); ++PyObject *gdbpy_inferiors (PyObject *unused, PyObject *unused2); ++PyObject *gdbpy_selected_thread (PyObject *self, PyObject *args); + ++PyObject *symtab_and_line_to_sal_object (struct symtab_and_line sal); ++PyObject *symtab_to_symtab_object (struct symtab *symtab); ++PyObject *symbol_to_symbol_object (struct symbol *sym); ++PyObject *block_to_block_object (struct block *block); + PyObject *value_to_value_object (struct value *v); + PyObject *type_to_type_object (struct type *); + PyObject *objfile_to_objfile_object (struct objfile *); ++PyObject *frame_info_to_frame_object (struct frame_info *frame); ++thread_object *create_thread_object (struct thread_info *tp); ++thread_object *find_thread_object (ptid_t ptid); ++PyObject *find_inferior_object (int pid); + + PyObject *objfpy_get_printers (PyObject *, void *); + ++struct block *block_object_to_block (PyObject *obj); ++struct symbol *symbol_object_to_symbol (PyObject *obj); + struct value *value_object_to_value (PyObject *self); + struct value *convert_value_from_python (PyObject *obj); + struct type *type_object_to_type (PyObject *obj); + ++PyObject *gdbpy_get_hook_function (const char *); ++ + void gdbpy_initialize_values (void); ++void gdbpy_initialize_breakpoints (void); + void gdbpy_initialize_frames (void); ++void gdbpy_initialize_symtabs (void); + void gdbpy_initialize_commands (void); ++void gdbpy_initialize_symbols (void); + void gdbpy_initialize_types (void); ++void gdbpy_initialize_blocks (void); + void gdbpy_initialize_functions (void); + void gdbpy_initialize_objfile (void); ++void gdbpy_initialize_parameters (void); ++void gdbpy_initialize_thread (void); ++void gdbpy_initialize_inferior (void); + + struct cleanup *make_cleanup_py_decref (PyObject *py); + +@@ -97,6 +140,12 @@ struct cleanup *ensure_python_env (struct gdbarch *gdbarch, + extern struct gdbarch *python_gdbarch; + extern const struct language_defn *python_language; + ++char *gdbpy_parse_command_name (char *text, ++ struct cmd_list_element ***base_list, ++ struct cmd_list_element **start_list); ++ ++PyObject *gdbpy_parameter_value (enum var_types, void *); ++ + /* Use this after a TRY_EXCEPT to throw the appropriate Python + exception. */ + #define GDB_PY_HANDLE_EXCEPTION(Exception) \ +@@ -107,6 +156,19 @@ extern const struct language_defn *python_language; + "%s", Exception.message); \ + } while (0) + ++/* Use this after a TRY_EXCEPT to throw the appropriate Python ++ exception. This macro is for use inside setter functions. */ ++#define GDB_PY_SET_HANDLE_EXCEPTION(Exception) \ ++ do { \ ++ if (Exception.reason < 0) \ ++ { \ ++ PyErr_Format (Exception.reason == RETURN_QUIT \ ++ ? PyExc_KeyboardInterrupt : PyExc_RuntimeError, \ ++ "%s", Exception.message); \ ++ return -1; \ ++ } \ ++ } while (0) ++ + + void gdbpy_print_stack (void); + +@@ -118,17 +180,22 @@ char *python_string_to_host_string (PyObject *obj); + PyObject *target_string_to_unicode (const gdb_byte *str, int length); + int gdbpy_is_string (PyObject *obj); + ++int gdbpy_is_value_object (PyObject *obj); ++ + /* Note that these are declared here, and not in python.h with the + other pretty-printer functions, because they refer to PyObject. */ + PyObject *apply_varobj_pretty_printer (PyObject *print_obj, + struct value **replacement); + PyObject *gdbpy_get_varobj_pretty_printer (struct value *value); ++PyObject *gdbpy_instantiate_printer (PyObject *cons, PyObject *value); + char *gdbpy_get_display_hint (PyObject *printer); + PyObject *gdbpy_default_visualizer (PyObject *self, PyObject *args); + +-extern PyObject *gdbpy_doc_cst; + extern PyObject *gdbpy_children_cst; + extern PyObject *gdbpy_to_string_cst; + extern PyObject *gdbpy_display_hint_cst; ++extern PyObject *gdbpy_doc_cst; ++ ++int get_addr_from_python (PyObject *obj, CORE_ADDR *addr); + + #endif /* GDB_PYTHON_INTERNAL_H */ diff --git a/gdb/python/python.c b/gdb/python/python.c index 254bd28..5a2a9ae 100644 --- a/gdb/python/python.c @@ -18534,10 +19806,10 @@ index 6cfaa85..68aadc0 100644 extern initialize_file_ftype _initialize_svr4_solib; /* -Wmissing-prototypes */ diff --git a/gdb/solib.c b/gdb/solib.c -index aad2d59..def02f8 100644 +index c7fd0fc..6f31852 100644 --- a/gdb/solib.c +++ b/gdb/solib.c -@@ -1066,13 +1066,12 @@ show_auto_solib_add (struct ui_file *file, int from_tty, +@@ -1127,13 +1127,12 @@ show_auto_solib_add (struct ui_file *file, int from_tty, struct symbol * solib_global_lookup (const struct objfile *objfile, const char *name, @@ -18676,10 +19948,10 @@ index 1c37801..594eb16 100644 print_variable_and_value (NULL, sym, frame, stream, 4 * num_tabs); break; diff --git a/gdb/symfile.c b/gdb/symfile.c -index 5151966..acca537 100644 +index 2f3441c..776066d 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c -@@ -928,6 +928,17 @@ new_symfile_objfile (struct objfile *objfile, int add_flags) +@@ -921,6 +921,17 @@ new_symfile_objfile (struct objfile *objfile, int add_flags) clear_complaints (&symfile_complaints, 0, add_flags & SYMFILE_VERBOSE); } @@ -18697,7 +19969,7 @@ index 5151966..acca537 100644 /* Process a symbol file, as either the main file or as a dynamically loaded file. -@@ -965,13 +976,16 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, +@@ -958,13 +969,16 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, /* Give user a chance to burp if we'd be interactively wiping out any existing symbols. */ @@ -18716,16 +19988,16 @@ index 5151966..acca537 100644 discard_cleanups (my_cleanups); if (addrs) -@@ -1007,6 +1021,8 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, +@@ -997,6 +1011,8 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, if ((flags & OBJF_READNOW) || readnow_symbol_files) { + require_partial_symbols (objfile); + - if ((from_tty || info_verbose) && print_symbol_loading) + if (from_tty || info_verbose) { printf_unfiltered (_("expanding to full symbols...")); -@@ -1025,7 +1041,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, +@@ -1015,7 +1031,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, /* If the file has its own symbol tables it has no separate debug info. `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to SYMTABS/PSYMTABS. `.gnu_debuglink' may no longer be present with `.note.gnu.build-id'. */ @@ -18734,21 +20006,20 @@ index 5151966..acca537 100644 debugfile = find_separate_debug_file (objfile); if (debugfile) { -@@ -1049,8 +1065,11 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, +@@ -1039,9 +1055,10 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, xfree (debugfile); } -- if (!have_partial_symbols () && !have_full_symbols () -- && print_symbol_loading) + /* has_any_debug_symbols is not fully compatible with the former calls which + would just be needlessly expensive here. */ -+ if ((from_tty || info_verbose) && print_symbol_loading -+ && (add_flags & SYMFILE_MAINLINE) + if ((from_tty || info_verbose) +- && !objfile_has_partial_symbols (objfile) +- && !objfile_has_full_symbols (objfile)) + && !has_any_debug_symbols (objfile)) { wrap_here (""); - printf_unfiltered (_("(no debugging symbols found)")); -@@ -1166,7 +1185,9 @@ symbol_file_clear (int from_tty) + printf_unfiltered (_("(no debugging symbols found)...")); +@@ -1150,7 +1167,9 @@ symbol_file_clear (int from_tty) descriptors as well. */ no_shared_libraries (NULL, from_tty); @@ -18759,11 +20030,12 @@ index 5151966..acca537 100644 if (from_tty) printf_unfiltered (_("No symbol file now.\n")); } -@@ -2436,13 +2457,15 @@ reread_symbols (void) +@@ -2422,14 +2441,15 @@ reread_symbols (void) zero is OK since dbxread.c also does what it needs to do if objfile->global_psymbols.size is 0. */ (*objfile->sf->sym_read) (objfile, 0); -- if (!have_partial_symbols () && !have_full_symbols ()) +- if (!objfile_has_partial_symbols (objfile) +- && !objfile_has_full_symbols (objfile)) + if (!has_any_debug_symbols (objfile)) { wrap_here (""); @@ -18776,7 +20048,7 @@ index 5151966..acca537 100644 /* We're done reading the symbol file; finish off complaints. */ clear_complaints (&symfile_complaints, 0, 1); -@@ -2740,7 +2763,7 @@ allocate_symtab (char *filename, struct objfile *objfile) +@@ -2727,7 +2747,7 @@ allocate_symtab (char *filename, struct objfile *objfile) } struct partial_symtab * @@ -18785,7 +20057,7 @@ index 5151966..acca537 100644 { struct partial_symtab *psymtab; -@@ -3054,7 +3077,8 @@ again2: +@@ -3041,7 +3061,8 @@ again2: struct partial_symtab * start_psymtab_common (struct objfile *objfile, @@ -18796,7 +20068,7 @@ index 5151966..acca537 100644 struct partial_symbol **static_syms) { diff --git a/gdb/symfile.h b/gdb/symfile.h -index bba242c..58bd2d8 100644 +index 8c9249c..bf9d9e7 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -140,6 +140,12 @@ struct sym_fns @@ -18821,7 +20093,7 @@ index bba242c..58bd2d8 100644 struct partial_symbol **, struct partial_symbol **); -@@ -316,7 +322,7 @@ extern int auto_solib_limit; +@@ -309,7 +315,7 @@ extern int auto_solib_limit; extern void set_initial_language (void); @@ -18830,7 +20102,7 @@ index bba242c..58bd2d8 100644 extern void discard_psymtab (struct partial_symtab *); -@@ -385,7 +391,7 @@ void free_symfile_segment_data (struct symfile_segment_data *data); +@@ -378,7 +384,7 @@ void free_symfile_segment_data (struct symfile_segment_data *data); /* From dwarf2read.c */ extern int dwarf2_has_info (struct objfile *); @@ -18862,7 +20134,7 @@ index eb35369..dfd8c8c 100644 { printf_filtered ("Global symbol `"); diff --git a/gdb/symtab.c b/gdb/symtab.c -index c88156a..75b907f 100644 +index 8d9d72c..82e0163 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -42,6 +42,7 @@ @@ -19696,7 +20968,7 @@ index 740d4e0..461ff95 100644 extern struct symtabs_and_lines diff --git a/gdb/target.c b/gdb/target.c -index 7ee444f..631e5f8 100644 +index a662eca..8e6af42 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -124,6 +124,8 @@ static int debug_to_insert_watchpoint (CORE_ADDR, int, int); @@ -19708,7 +20980,7 @@ index 7ee444f..631e5f8 100644 static int debug_to_stopped_by_watchpoint (void); static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); -@@ -584,6 +586,7 @@ update_current_target (void) +@@ -622,6 +624,7 @@ update_current_target (void) INHERIT (to_remove_hw_breakpoint, t); INHERIT (to_insert_watchpoint, t); INHERIT (to_remove_watchpoint, t); @@ -19716,7 +20988,7 @@ index 7ee444f..631e5f8 100644 INHERIT (to_stopped_data_address, t); INHERIT (to_have_steppable_watchpoint, t); INHERIT (to_have_continuable_watchpoint, t); -@@ -694,6 +697,9 @@ update_current_target (void) +@@ -732,6 +735,9 @@ update_current_target (void) de_fault (to_remove_watchpoint, (int (*) (CORE_ADDR, int, int)) return_minus_one); @@ -19726,7 +20998,7 @@ index 7ee444f..631e5f8 100644 de_fault (to_stopped_by_watchpoint, (int (*) (void)) return_zero); -@@ -3095,6 +3101,19 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type) +@@ -3168,6 +3174,19 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type) return retval; } @@ -19746,7 +21018,7 @@ index 7ee444f..631e5f8 100644 static void debug_to_terminal_init (void) { -@@ -3342,6 +3361,7 @@ setup_target_debug (void) +@@ -3415,6 +3434,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; @@ -19755,10 +21027,10 @@ index 7ee444f..631e5f8 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 2c743e9..dbbce12 100644 +index c210fea..065a7ea 100644 --- a/gdb/target.h +++ b/gdb/target.h -@@ -376,6 +376,7 @@ struct target_ops +@@ -379,6 +379,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); @@ -19766,7 +21038,7 @@ index 2c743e9..dbbce12 100644 int (*to_stopped_by_watchpoint) (void); int to_have_steppable_watchpoint; int to_have_continuable_watchpoint; -@@ -1120,6 +1121,15 @@ extern char *normal_pid_to_str (ptid_t ptid); +@@ -1126,6 +1127,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) @@ -19782,7 +21054,7 @@ index 2c743e9..dbbce12 100644 #define target_insert_hw_breakpoint(gdbarch, bp_tgt) \ (*current_target.to_insert_hw_breakpoint) (gdbarch, bp_tgt) -@@ -1157,6 +1167,20 @@ extern int target_search_memory (CORE_ADDR start_addr, +@@ -1163,6 +1173,20 @@ extern int target_search_memory (CORE_ADDR start_addr, ULONGEST pattern_len, CORE_ADDR *found_addrp); @@ -19803,7 +21075,7 @@ index 2c743e9..dbbce12 100644 /* Command logging facility. */ #define target_log_command(p) \ -@@ -1276,6 +1300,14 @@ extern struct target_ops *find_target_beneath (struct target_ops *); +@@ -1282,6 +1306,14 @@ extern struct target_ops *find_target_beneath (struct target_ops *); extern char *target_get_osdata (const char *type); @@ -20930,215 +22202,6 @@ index 750fd23..dfdb929 100644 gdb_test "set input-radix 1" \ "Nonsense input radix ``decimal 1''; input radix unchanged\\." \ "Reject input-radix 1" -diff --git a/gdb/testsuite/gdb.base/solib-overlap-lib.c b/gdb/testsuite/gdb.base/solib-overlap-lib.c -new file mode 100644 -index 0000000..d4aec0d ---- /dev/null -+++ b/gdb/testsuite/gdb.base/solib-overlap-lib.c -@@ -0,0 +1,27 @@ -+/* Copyright 2009 Free Software Foundation, Inc. -+ 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 -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ Contributed by Jan Kratochvil . */ -+ -+void -+libsym (void) -+{ -+} -+ -+#ifdef SYMB -+void -+libsymb (void) -+{ -+} -+#endif -diff --git a/gdb/testsuite/gdb.base/solib-overlap-main.c b/gdb/testsuite/gdb.base/solib-overlap-main.c -new file mode 100644 -index 0000000..1e91dd2 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/solib-overlap-main.c -@@ -0,0 +1,25 @@ -+/* Copyright 2009 Free Software Foundation, Inc. -+ 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 -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ Contributed by Jan Kratochvil . */ -+ -+#include -+ -+int -+main (void) -+{ -+ sleep (60); -+ -+ return 1; -+} -diff --git a/gdb/testsuite/gdb.base/solib-overlap.exp b/gdb/testsuite/gdb.base/solib-overlap.exp -new file mode 100644 -index 0000000..d644d9b ---- /dev/null -+++ b/gdb/testsuite/gdb.base/solib-overlap.exp -@@ -0,0 +1,139 @@ -+# Copyright 2009 Free Software Foundation, Inc. -+# 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 -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+# Contributed by Jan Kratochvil . -+ -+# Test GDB can cope with two libraries loaded with overlapping VMA ranges. -+# Prelink libraries first so they can be loaded and their native address. -+# In such case `struct linkmap'.l_addr will be zero. Provide different -+# unprelinked library files on the disk which have zero-based VMAs. These -+# different files should have their .dynamic section at a different offset in -+# page size so that we get for -+# warning: .dynamic section for "..." is not at the expected address -+# the reason -+# (wrong library or version mismatch?) -+# and not: -+# difference appears to be caused by prelink, adjusting expectations -+# In such case both disk libraries will be loaded at VMAs starting at zero. -+ -+if [skip_shlib_tests] { -+ return 0 -+} -+ -+# Are we on a target board? It is required for attaching to a process. -+if [is_remote target] { -+ return 0 -+} -+ -+if [get_compiler_info binfile-unused] { -+ return -1; -+} -+ -+# Library file. -+set libname "solib-overlap-lib" -+set srcfile_lib ${srcdir}/${subdir}/${libname}.c -+# Binary file. -+set testfile "solib-overlap-main" -+set srcfile ${srcdir}/${subdir}/${testfile}.c -+ -+# Base addresses for `prelink -r' which should be compatible with both -m32 and -+# -m64 targets. If it clashes with system prelinked libraries it would give -+# false PASS. -+# Prelink first lib1 at 0x40000000 and lib2 at 0x41000000. -+# During second pass try lib1 at 0x50000000 and lib2 at 0x51000000. -+foreach prelink_lib1 {0x40000000 0x50000000} { -+ set prelink_lib2 [format "0x%x" [expr $prelink_lib1 + 0x01000000]] -+ -+ set old_prefix $pf_prefix -+ lappend pf_prefix "$prelink_lib1:" -+ -+ # Library file. -+ set binfile_lib1 ${objdir}/${subdir}/${libname}1-${prelink_lib1}.so -+ set binfile_lib2 ${objdir}/${subdir}/${libname}2-${prelink_lib1}.so -+ set lib_flags {debug} -+ # Binary file. -+ set binfile_base ${testfile}-${prelink_lib1} -+ set binfile ${objdir}/${subdir}/${binfile_base} -+ set bin_flags [list debug shlib=${binfile_lib1} shlib=${binfile_lib2}] -+ set escapedbinfile [string_to_regexp ${binfile}] -+ -+ if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib1} $lib_flags] != "" -+ || [gdb_compile_shlib ${srcfile_lib} ${binfile_lib2} $lib_flags] != "" -+ || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } { -+ untested "Could not compile ${binfile_lib1}, ${binfile_lib2} or ${binfile}." -+ return -1 -+ } -+ -+ if {[catch "system \"prelink -N -r ${prelink_lib1} ${binfile_lib1}\""] != 0 -+ || [catch "system \"prelink -N -r ${prelink_lib2} ${binfile_lib2}\""] != 0} { -+ # Maybe we don't have prelink. -+ untested "Could not prelink ${binfile_lib1} or ${binfile_lib2}." -+ return -1 -+ } -+ -+ # Start the program running and then wait for a bit, to be sure -+ # that it can be attached to. -+ -+ set testpid [eval exec $binfile &] -+ sleep 2 -+ if { [istarget "*-*-cygwin*"] } { -+ # testpid is the Cygwin PID, GDB uses the Windows PID, which might be -+ # different due to the way fork/exec works. -+ set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ] -+ } -+ -+ remote_exec build "mv -f ${binfile_lib1} ${binfile_lib1}-running" -+ remote_exec build "mv -f ${binfile_lib2} ${binfile_lib2}-running" -+ -+ # Provide another exported function name to cause different sizes of sections. -+ lappend lib_flags additional_flags=-DSYMB -+ -+ if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib1} $lib_flags] != "" -+ || [gdb_compile_shlib ${srcfile_lib} ${binfile_lib2} $lib_flags] != ""} { -+ untested "Could not recompile ${binfile_lib1} or ${binfile_lib2}." -+ remote_exec build "kill -9 ${testpid}" -+ return -1 -+ } -+ -+ clean_restart ${binfile_base} -+ # This testcase currently does not support remote targets. -+ # gdb_load_shlibs ${binfile_lib1} ${binfile_lib2} -+ -+ # Here we should get: -+ # warning: .dynamic section for ".../solib-overlap-lib1.so" is not at the expected address (wrong library or version mismatch?) -+ # warning: .dynamic section for ".../solib-overlap-lib2.so" is not at the expected address (wrong library or version mismatch?) -+ -+ set test attach -+ gdb_test_multiple "attach $testpid" $test { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass $test -+ } -+ -re "Attaching to program.*`?$escapedbinfile\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" { -+ # Response expected on Cygwin -+ pass $test -+ } -+ } -+ -+ # Detach the process. -+ -+ gdb_test "detach" "Detaching from program: .*$escapedbinfile, process $testpid" -+ -+ # Wait a bit for gdb to finish detaching -+ -+ sleep 5 -+ -+ remote_exec build "kill -9 ${testpid}" -+ -+ set pf_prefix $old_prefix -+} diff --git a/gdb/testsuite/gdb.base/valgrind-attach.c b/gdb/testsuite/gdb.base/valgrind-attach.c new file mode 100644 index 0000000..84b57db @@ -21663,6 +22726,19 @@ index a2bb731..d74d6c7 100644 +gdb_test "continue" \ + "Continuing\\.\[ \r\n\]+Breakpoint \[0-9\]+, .*break-at-exit.*" \ + "continue to break-at-exit after hbreak" +diff --git a/gdb/testsuite/gdb.cp/Makefile.in b/gdb/testsuite/gdb.cp/Makefile.in +index 0a087c7..b4880f2 100644 +--- a/gdb/testsuite/gdb.cp/Makefile.in ++++ b/gdb/testsuite/gdb.cp/Makefile.in +@@ -4,7 +4,7 @@ srcdir = @srcdir@ + EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \ + derivation inherit local member-ptr method misc \ + overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc namespace \ +- ref-types ref-params method2 pr9594 gdb2495 ++ ref-types ref-params method2 pr9594 gdb2495 gdb9593 + + all info install-info dvi install uninstall installcheck check: + @echo "Nothing to be done for $@..." diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp index 4095ccf..03c07d5 100644 --- a/gdb/testsuite/gdb.cp/cp-relocate.exp @@ -22005,6 +23081,383 @@ index 3c302c3..cd0496d 100644 "bt from A" gdb_continue_to_breakpoint "next caller func" ".*func-line.*" +diff --git a/gdb/testsuite/gdb.cp/gdb9593.cc b/gdb/testsuite/gdb.cp/gdb9593.cc +new file mode 100644 +index 0000000..783c962 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/gdb9593.cc +@@ -0,0 +1,180 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008, 2009 Free Software Foundation, Inc. ++ ++ 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 ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ */ ++#include ++ ++using namespace std; ++ ++class NextOverThrowDerivates ++{ ++ ++public: ++ ++ ++ // Single throw an exception in this function. ++ void function1() ++ { ++ throw 20; ++ } ++ ++ // Throw an exception in another function. ++ void function2() ++ { ++ function1(); ++ } ++ ++ // Throw an exception in another function, but handle it ++ // locally. ++ void function3 () ++ { ++ { ++ try ++ { ++ function1 (); ++ } ++ catch (...) ++ { ++ cout << "Caught and handled function1 exception" << endl; ++ } ++ } ++ } ++ ++ void rethrow () ++ { ++ try ++ { ++ function1 (); ++ } ++ catch (...) ++ { ++ throw; ++ } ++ } ++ ++ void finish () ++ { ++ // We use this to test that a "finish" here does not end up in ++ // this frame, but in the one above. ++ try ++ { ++ function1 (); ++ } ++ catch (int x) ++ { ++ } ++ function1 (); // marker for until ++ } ++ ++ void until () ++ { ++ function1 (); ++ function1 (); // until here ++ } ++ ++}; ++NextOverThrowDerivates next_cases; ++ ++ ++int main () ++{ ++ try ++ { ++ next_cases.function1 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ try ++ { ++ next_cases.function2 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ try ++ { ++ // This is duplicated so we can next over one but step into ++ // another. ++ next_cases.function2 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ next_cases.function3 (); ++ ++ try ++ { ++ next_cases.rethrow (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ try ++ { ++ // Another duplicate so we can test "finish". ++ next_cases.function2 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ // Another test for "finish". ++ try ++ { ++ next_cases.finish (); ++ } ++ catch (...) ++ { ++ } ++ ++ // Test of "until". ++ try ++ { ++ next_cases.finish (); ++ } ++ catch (...) ++ { ++ } ++ ++ // Test of "until" with an argument. ++ try ++ { ++ next_cases.until (); ++ } ++ catch (...) ++ { ++ } ++ ++ // Test of "advance". ++ try ++ { ++ next_cases.until (); ++ } ++ catch (...) ++ { ++ } ++} ++ +diff --git a/gdb/testsuite/gdb.cp/gdb9593.exp b/gdb/testsuite/gdb.cp/gdb9593.exp +new file mode 100644 +index 0000000..ee9aeff +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/gdb9593.exp +@@ -0,0 +1,185 @@ ++# Copyright 2008, 2009 Free Software Foundation, Inc. ++ ++# 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 ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++if { [skip_cplus_tests] } { continue } ++ ++set prms_id 9593 ++set bug_id 0 ++ ++set testfile "gdb9593" ++set srcfile ${testfile}.cc ++set binfile $objdir/$subdir/$testfile ++ ++# Create and source the file that provides information about the compiler ++# used to compile the test case. ++if [get_compiler_info ${binfile} "c++"] { ++ untested gdb9593.exp ++ return -1 ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { ++ untested gdb9593.exp ++ return -1 ++} ++ ++# Some targets can't do function calls, so don't even bother with this ++# test. ++if [target_info exists gdb,cannot_call_functions] { ++ setup_xfail "*-*-*" 9593 ++ fail "This target can not call functions" ++ continue ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] then { ++ perror "couldn't run to main" ++ continue ++} ++ ++# See whether we have the needed unwinder hooks. ++set ok 1 ++gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" { ++ -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" { ++ pass "check for unwinder hook" ++ } ++ -re "No symbol .* in current context.\r\n$gdb_prompt $" { ++ # Pass the test so we don't get bogus fails in the results. ++ pass "check for unwinder hook" ++ set ok 0 ++ } ++} ++if {!$ok} { ++ untested gdb9593.exp ++ return -1 ++} ++ ++# See http://sourceware.org/bugzilla/show_bug.cgi?id=9593 ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a throw 1" ++ ++gdb_test "next" \ ++ ".*next_cases.function2.*" \ ++ "next past catch 1" ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a throw 2" ++ ++gdb_test "next" \ ++ ".*next_cases.function2.*" \ ++ "next past catch 2" ++ ++gdb_test "step" \ ++ ".*function1().*" \ ++ "step into function2 1" ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a throw 3" ++ ++gdb_test "next" \ ++ ".*next_cases.function3.*" \ ++ "next past catch 3" ++ ++gdb_test "next" \ ++ ".*next_cases.rethrow.*" \ ++ "next over a throw 4" ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a rethrow" ++ ++gdb_test "next" \ ++ ".*next_cases.function2.*" \ ++ "next after a rethrow" ++ ++gdb_test "step" \ ++ ".*function1().*" \ ++ "step into function2 2" ++ ++gdb_test "finish" \ ++ ".*catch (...).*" \ ++ "finish 1" ++ ++gdb_test "next" \ ++ ".*next_cases.finish ().*" \ ++ "next past catch 4" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into finish method" ++ ++gdb_test "finish" \ ++ ".*catch (...).*" \ ++ "finish 2" ++ ++gdb_test "next" \ ++ ".*next_cases.finish ().*" \ ++ "next past catch 5" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into finish, for until" ++ ++gdb_test "until" \ ++ ".*catch .int x.*" \ ++ "until with no argument 1" ++ ++set line [gdb_get_line_number "marker for until" $testfile.cc] ++ ++gdb_test "until $line" \ ++ ".*function1 ().*" \ ++ "next past catch 6" ++ ++gdb_test "until" \ ++ ".*catch (...).*" \ ++ "until with no argument 2" ++ ++set line [gdb_get_line_number "until here" $testfile.cc] ++ ++gdb_test "next" \ ++ ".*next_cases.until ().*" \ ++ "next past catch 6" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into until" ++ ++gdb_test "until $line" \ ++ ".*catch (...).*" \ ++ "until-over-throw" ++ ++gdb_test "next" \ ++ ".*next_cases.until ().*" \ ++ "next past catch 7" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into until, for advance" ++ ++gdb_test "advance $line" \ ++ ".*catch (...).*" \ ++ "advance-over-throw" diff --git a/gdb/testsuite/gdb.cp/member-ptr.cc b/gdb/testsuite/gdb.cp/member-ptr.cc index 1dff70a..648b2af 100644 --- a/gdb/testsuite/gdb.cp/member-ptr.cc @@ -22443,10 +23896,10 @@ index 0000000..e508103 +gdb_test "print abc" "= 33" diff --git a/gdb/testsuite/gdb.cp/namespace-recursive.cc b/gdb/testsuite/gdb.cp/namespace-recursive.cc new file mode 100644 -index 0000000..84605a6 +index 0000000..46d4c18 --- /dev/null +++ b/gdb/testsuite/gdb.cp/namespace-recursive.cc -@@ -0,0 +1,30 @@ +@@ -0,0 +1,47 @@ +namespace A{ + int ax = 9; +} @@ -22459,12 +23912,14 @@ index 0000000..84605a6 + using namespace B; +} + ++using namespace C; ++ +//--------------- +namespace D{ + using namespace D; + int dx = 99; +} -+using namespace C; ++using namespace D; + +//--------------- +namespace{ @@ -22473,16 +23928,31 @@ index 0000000..84605a6 + } +} + ++//--------------- ++namespace E{ ++ int ex = 9999; ++} ++ ++namespace F{ ++ namespace FE = E; ++} ++ ++namespace G{ ++ namespace GF = F; ++} ++ ++//---------------- +int main(){ + using namespace D; -+ return ax + dx + xx; ++ namespace GX = G; ++ return ax + dx + xx + G::GF::FE::ex; +} diff --git a/gdb/testsuite/gdb.cp/namespace-recursive.exp b/gdb/testsuite/gdb.cp/namespace-recursive.exp new file mode 100644 -index 0000000..ebc898f +index 0000000..5543757 --- /dev/null +++ b/gdb/testsuite/gdb.cp/namespace-recursive.exp -@@ -0,0 +1,66 @@ +@@ -0,0 +1,75 @@ +# Copyright 2008 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -22549,6 +24019,15 @@ index 0000000..ebc898f + +gdb_test "print xx" "= 999" + ++############################################ ++# Test printing using recursive namespace ++# aliases. ++ ++setup_kfail "gdb/10541" "*-*-*" ++gdb_test "ptype G::GF" "= namespace F" ++ ++setup_kfail "gdb/10541" "*-*-*" ++gdb_test "print G::GF::FE::ex" "= 9999" diff --git a/gdb/testsuite/gdb.cp/namespace-stress.cc b/gdb/testsuite/gdb.cp/namespace-stress.cc new file mode 100644 index 0000000..f34083e @@ -22838,7 +24317,7 @@ index 4786fd5..8ff5622 100644 + return marker1 (); } diff --git a/gdb/testsuite/gdb.cp/namespace-using.exp b/gdb/testsuite/gdb.cp/namespace-using.exp -index f24973f..c015ef7 100644 +index f24973f..fc23115 100644 --- a/gdb/testsuite/gdb.cp/namespace-using.exp +++ b/gdb/testsuite/gdb.cp/namespace-using.exp @@ -28,6 +28,11 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb @@ -22853,7 +24332,7 @@ index f24973f..c015ef7 100644 # Get things started. gdb_exit -@@ -46,15 +51,61 @@ if ![runto_main] then { +@@ -46,42 +51,155 @@ if ![runto_main] then { gdb_test "print _a" "= 1" @@ -22915,7 +24394,9 @@ index f24973f..c015ef7 100644 ############################################ # Test printing of namespace aliases -@@ -64,16 +115,32 @@ if ![runto marker2] then { +-setup_kfail "gdb/7935" "*-*-*" + if ![runto marker2] then { + perror "couldn't run to breakpoint marker2" continue } @@ -22952,7 +24433,10 @@ index f24973f..c015ef7 100644 ############################################ # Test printing of individually imported elements -@@ -84,4 +151,57 @@ if ![runto marker4] then { + +-setup_kfail "gdb/7936" "*-*-*" + if ![runto marker4] then { + perror "couldn't run to breakpoint marker4" continue } @@ -23325,382 +24809,6 @@ index 0000000..6922eed +if [test_compiler_info gcc-4-3-*] then { setup_xfail *-*-* } + +gdb_test "print x" "= 11" "Print imported namespace x" -diff --git a/gdb/testsuite/gdb.dwarf2/callframecfa.S b/gdb/testsuite/gdb.dwarf2/callframecfa.S -new file mode 100644 -index 0000000..6d0421a ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/callframecfa.S -@@ -0,0 +1,309 @@ -+/* -+ Copyright 2009 Free Software Foundation, Inc. -+ -+ 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 -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ */ -+ -+/* This was compiled from a trivial program just to test the -+ DW_OP_call_frame_cfa operator: -+ -+ int func (int arg) { -+ return arg + 23; -+ } -+ -+ int main(int argc, char *argv[]) { -+ func (77); -+ } -+*/ -+ -+ .file "q.c" -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .text -+.Ltext0: -+.globl func -+ .type func, @function -+func: -+.LFB0: -+ .file 1 "q.c" -+ .loc 1 2 0 -+ .cfi_startproc -+ pushl %ebp -+ .cfi_def_cfa_offset 8 -+ movl %esp, %ebp -+ .cfi_offset 5, -8 -+ .cfi_def_cfa_register 5 -+ .loc 1 3 0 -+ movl 8(%ebp), %eax -+ addl $23, %eax -+ .loc 1 4 0 -+ popl %ebp -+ .cfi_restore 5 -+ .cfi_def_cfa 4, 4 -+ ret -+ .cfi_endproc -+.LFE0: -+ .size func, .-func -+.globl _start -+ .type _start, @function -+_start: -+.LFB1: -+ .loc 1 6 0 -+ .cfi_startproc -+ pushl %ebp -+ .cfi_def_cfa_offset 8 -+ movl %esp, %ebp -+ .cfi_offset 5, -8 -+ .cfi_def_cfa_register 5 -+ subl $4, %esp -+ .loc 1 7 0 -+ movl $77, (%esp) -+ call func -+ .loc 1 8 0 -+ leave -+ .cfi_restore 5 -+ .cfi_def_cfa 4, 4 -+ ret -+ .cfi_endproc -+.LFE1: -+ .size _start, .-_start -+.Letext0: -+ .section .debug_info -+ .long 0x9e -+ .value 0x3 -+ .long .Ldebug_abbrev0 -+ .byte 0x4 -+ .uleb128 0x1 -+ .long .LASF5 -+ .byte 0x1 -+ .string "q.c" -+ .long .LASF6 -+ .long .Ltext0 -+ .long .Letext0 -+ .long .Ldebug_line0 -+ .uleb128 0x2 -+ .byte 0x1 -+ .long .LASF0 -+ .byte 0x1 -+ .byte 0x1 -+ .byte 0x1 -+ .long 0x4f -+ .long .LFB0 -+ .long .LFE0 -+ .byte 0x1 -+ .byte 0x9c -+ .long 0x4f -+ .uleb128 0x3 -+ .string "arg" -+ .byte 0x1 -+ .byte 0x1 -+ .long 0x4f -+ .byte 0x2 -+ .byte 0x91 -+ .sleb128 0 -+ .byte 0x0 -+ .uleb128 0x4 -+ .byte 0x4 -+ .byte 0x5 -+ .string "int" -+ .uleb128 0x2 -+ .byte 0x1 -+ .long .LASF1 -+ .byte 0x1 -+ .byte 0x6 -+ .byte 0x1 -+ .long 0x4f -+ .long .LFB1 -+ .long .LFE1 -+ .byte 0x1 -+ .byte 0x9c -+ .long 0x8e -+ .uleb128 0x5 -+ .long .LASF2 -+ .byte 0x1 -+ .byte 0x6 -+ .long 0x4f -+ .byte 0x2 -+ .byte 0x91 -+ .sleb128 0 -+ .uleb128 0x5 -+ .long .LASF3 -+ .byte 0x1 -+ .byte 0x6 -+ .long 0x8e -+ .byte 0x2 -+ .byte 0x91 -+ .sleb128 4 -+ .byte 0x0 -+ .uleb128 0x6 -+ .byte 0x4 -+ .long 0x94 -+ .uleb128 0x6 -+ .byte 0x4 -+ .long 0x9a -+ .uleb128 0x7 -+ .byte 0x1 -+ .byte 0x6 -+ .long .LASF4 -+ .byte 0x0 -+ .section .debug_abbrev -+ .uleb128 0x1 -+ .uleb128 0x11 -+ .byte 0x1 -+ .uleb128 0x25 -+ .uleb128 0xe -+ .uleb128 0x13 -+ .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0x8 -+ .uleb128 0x1b -+ .uleb128 0xe -+ .uleb128 0x11 -+ .uleb128 0x1 -+ .uleb128 0x12 -+ .uleb128 0x1 -+ .uleb128 0x10 -+ .uleb128 0x6 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x2 -+ .uleb128 0x2e -+ .byte 0x1 -+ .uleb128 0x3f -+ .uleb128 0xc -+ .uleb128 0x3 -+ .uleb128 0xe -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x27 -+ .uleb128 0xc -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .uleb128 0x11 -+ .uleb128 0x1 -+ .uleb128 0x12 -+ .uleb128 0x1 -+ .uleb128 0x40 -+ .uleb128 0xa -+ .uleb128 0x1 -+ .uleb128 0x13 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0x5 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0x8 -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .uleb128 0x2 -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x4 -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0x8 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x5 -+ .uleb128 0x5 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0xe -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .uleb128 0x2 -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x6 -+ .uleb128 0xf -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x7 -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0xe -+ .byte 0x0 -+ .byte 0x0 -+ .byte 0x0 -+ .section .debug_pubnames,"",@progbits -+ .long 0x20 -+ .value 0x2 -+ .long .Ldebug_info0 -+ .long 0xa2 -+ .long 0x25 -+ .string "func" -+ .long 0x56 -+ .string "main" -+ .long 0x0 -+ .section .debug_aranges,"",@progbits -+ .long 0x1c -+ .value 0x2 -+ .long .Ldebug_info0 -+ .byte 0x4 -+ .byte 0x0 -+ .value 0x0 -+ .value 0x0 -+ .long .Ltext0 -+ .long .Letext0-.Ltext0 -+ .long 0x0 -+ .long 0x0 -+ .section .debug_str,"MS",@progbits,1 -+.LASF5: -+ .string "GNU C 4.5.0 20090810 (experimental) [trunk revision 150633]" -+.LASF2: -+ .string "argc" -+.LASF6: -+ .string "/tmp" -+.LASF0: -+ .string "func" -+.LASF3: -+ .string "argv" -+.LASF1: -+ .string "main" -+.LASF4: -+ .string "char" -+ .ident "GCC: (GNU) 4.5.0 20090810 (experimental) [trunk revision 150633]" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/callframecfa.exp b/gdb/testsuite/gdb.dwarf2/callframecfa.exp -new file mode 100644 -index 0000000..00d67fc ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/callframecfa.exp -@@ -0,0 +1,55 @@ -+# Copyright 2009 Free Software Foundation, Inc. -+ -+# 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 -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Test DW_OP_call_frame_cfa. -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+# For now pick a sampling of likely targets. -+if {![istarget *-*-linux*] -+ && ![istarget *-*-gnu*] -+ && ![istarget *-*-elf*] -+ && ![istarget *-*-openbsd*] -+ && ![istarget arm-*-eabi*] -+ && ![istarget powerpc-*-eabi*]} { -+ return 0 -+} -+# This test can only be run on x86 targets. -+if {![istarget i?86-*]} { -+ return 0 -+} -+ -+set testfile "callframecfa" -+set srcfile ${testfile}.S -+set binfile ${objdir}/${subdir}/${testfile}.x -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ -+ [list {additional_flags=-nostdlib}]] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+gdb_test "break *func" "Breakpoint 1.*" "set breakpoint for call-frame-cfa" -+gdb_test "run" "" "run for call-frame-cfa" -+gdb_test "display arg" "arg = 77" "set display for call-frame-cfa" -+ -+# We know how many instructions are in the function. Note that we -+# can't handle the "ret" instruction due to the epilogue unwinder. -+for {set i 1} {$i < 5} {incr i} { -+ gdb_test "si" "arg = 77" "step $i for call-frame-cfa" -+} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S new file mode 100644 index 0000000..d5b9ca5 @@ -25113,6 +26221,128 @@ index 495ae45..d08d7a4 100644 -re ".*time_at_startup = get_run_time.*$gdb_prompt $" { set description "next over get_run_time and everything it calls" set command "next" +diff --git a/gdb/testsuite/gdb.java/jnpe.exp b/gdb/testsuite/gdb.java/jnpe.exp +new file mode 100644 +index 0000000..74d4d58 +--- /dev/null ++++ b/gdb/testsuite/gdb.java/jnpe.exp +@@ -0,0 +1,72 @@ ++# Copyright 2009 Free Software Foundation, Inc. ++ ++# 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 ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++load_lib "java.exp" ++ ++set testfile "jnpe" ++set srcfile ${srcdir}/$subdir/${testfile}.java ++set binfile ${objdir}/${subdir}/${testfile} ++if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } { ++ untested "Couldn't compile ${srcfile}" ++ return -1 ++} ++ ++set prms_id 0 ++set bug_id 0 ++ ++# Start with a fresh gdb. ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++set line [gdb_get_line_number "break here" $testfile.java] ++gdb_test "break $testfile.java:$line" "" ++ ++gdb_test "run" \ ++ "Current language.*java" \ ++ "run java next-over-throw" ++ ++# See whether we have the needed unwinder hooks. ++set ok 1 ++gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook in java" { ++ -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" { ++ pass "check for unwinder hook in java" ++ } ++ -re "No symbol .* in current context.\r\n$gdb_prompt $" { ++ # Pass the test so we don't get bogus fails in the results. ++ pass "check for unwinder hook in java" ++ set ok 0 ++ } ++} ++if {!$ok} { ++ untested jnpe.exp ++ return -1 ++} ++ ++gdb_test "handle SIGSEGV nostop noprint" \ ++ "SIGSEGV.*fault" \ ++ "disable SIGSEGV for next-over-NPE" ++ ++# We sometimes stop at line 37, not line 35. This seems to be a gcj ++# oddity -- another next will solve it. ++gdb_test "next" \ ++ "3\[57\].*" \ ++ "next over NPE" +diff --git a/gdb/testsuite/gdb.java/jnpe.java b/gdb/testsuite/gdb.java/jnpe.java +new file mode 100644 +index 0000000..ffca3ab +--- /dev/null ++++ b/gdb/testsuite/gdb.java/jnpe.java +@@ -0,0 +1,38 @@ ++// Test next-over-NPE. ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2009 Free Software Foundation, Inc. ++ ++ 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 ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ */ ++ ++public class jnpe ++{ ++ public static String npe () ++ { ++ return ((Object) null).toString(); ++ } ++ ++ public static void main (String[] args) ++ { ++ try ++ { ++ System.out.println (npe ()); // break here ++ } ++ catch (NullPointerException n) ++ { ++ System.out.println ("success"); ++ } ++ } ++} 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 @@ -25668,10 +26898,10 @@ index 161b34f..0f9b4d4 100644 diff --git a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp -index 96d42a1..e900d14 100644 +index dda77bb..0e91634 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp -@@ -146,7 +146,7 @@ mi_step_to "do_locals_tests" "" "var-cmd.c" $line_dlt_linteger "step at do_local +@@ -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 *" \ @@ -25680,7 +26910,7 @@ index 96d42a1..e900d14 100644 "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 +@@ -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 *" \ @@ -25689,7 +26919,7 @@ index 96d42a1..e900d14 100644 "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 +@@ -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 *" \ @@ -25698,7 +26928,7 @@ index 96d42a1..e900d14 100644 "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 +@@ -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 *" \ @@ -25707,7 +26937,7 @@ index 96d42a1..e900d14 100644 "update all vars: lpcharacter changed" -@@ -195,7 +195,7 @@ mi_execute_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \ +@@ -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 *" \ @@ -25716,7 +26946,7 @@ index 96d42a1..e900d14 100644 "update all vars: many changed" # Step over: -@@ -212,7 +212,7 @@ mi_execute_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \ +@@ -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 *" \ @@ -25725,7 +26955,7 @@ index 96d42a1..e900d14 100644 "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" "" \ +@@ -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 *" \ @@ -25734,7 +26964,7 @@ index 96d42a1..e900d14 100644 "update all vars: lsimple and others changed" -@@ -257,7 +257,7 @@ mi_gdb_test "-var-assign linteger 3333" \ +@@ -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 *" \ @@ -25743,7 +26973,7 @@ index 96d42a1..e900d14 100644 "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\"" \ +@@ -282,7 +282,7 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \ "assign to lpinteger" mi_gdb_test "-var-update *" \ @@ -25752,7 +26982,7 @@ index 96d42a1..e900d14 100644 "update all vars: lpinteger changed after assign" mi_gdb_test "-var-update *" \ -@@ -402,7 +402,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\ +@@ -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 *" \ @@ -25761,7 +26991,7 @@ index 96d42a1..e900d14 100644 "update all vars: i changed" mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \ -@@ -411,7 +411,7 @@ 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 *" \ @@ -25770,7 +27000,7 @@ index 96d42a1..e900d14 100644 "update all vars: llong changed" set line_dlt_call_subroutine1 [gdb_get_line_number "subroutine1 (linteger, &llong);"] -@@ -421,7 +421,7 @@ mi_next_to "do_locals_tests" "" "var-cmd.c" \ +@@ -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 *" \ @@ -25779,7 +27009,7 @@ index 96d42a1..e900d14 100644 "update all vars: all now out of scope" # Done with locals/globals tests. Erase all variables -@@ -513,14 +513,14 @@ mi_gdb_test "-var-create selected_a @ a" \ +@@ -518,14 +518,14 @@ mi_gdb_test "-var-create selected_a @ a" \ mi_continue_to incr_a mi_gdb_test "-var-update selected_a" \ @@ -26000,23 +27230,10 @@ index 0000000..e48d520 + program main + call f ('foo') + end -diff --git a/gdb/testsuite/gdb.python/Makefile.in b/gdb/testsuite/gdb.python/Makefile.in -index 79be9e7..c49f713 100644 ---- a/gdb/testsuite/gdb.python/Makefile.in -+++ b/gdb/testsuite/gdb.python/Makefile.in -@@ -1,7 +1,7 @@ - VPATH = @srcdir@ - srcdir = @srcdir@ - --EXECUTABLES = python-value -+EXECUTABLES = python-value python-prettyprint python-template - - all info install-info dvi install uninstall installcheck check: - @echo "Nothing to be done for $@..." -diff --git a/gdb/testsuite/gdb.python/python-cmd.exp b/gdb/testsuite/gdb.python/python-cmd.exp +diff --git a/gdb/testsuite/gdb.python/py-cmd.exp b/gdb/testsuite/gdb.python/py-cmd.exp index f6ef938..1032a2d 100644 ---- a/gdb/testsuite/gdb.python/python-cmd.exp -+++ b/gdb/testsuite/gdb.python/python-cmd.exp +--- a/gdb/testsuite/gdb.python/py-cmd.exp ++++ b/gdb/testsuite/gdb.python/py-cmd.exp @@ -20,36 +20,15 @@ if $tracelevel then { strace $tracelevel } @@ -26057,10 +27274,10 @@ index f6ef938..1032a2d 100644 } # Test a simple command. -diff --git a/gdb/testsuite/gdb.python/python-frame.exp b/gdb/testsuite/gdb.python/python-frame.exp -index 82b526e..82ae814 100644 ---- a/gdb/testsuite/gdb.python/python-frame.exp -+++ b/gdb/testsuite/gdb.python/python-frame.exp +diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp +index a67eaa3..5380c0f 100644 +--- a/gdb/testsuite/gdb.python/py-frame.exp ++++ b/gdb/testsuite/gdb.python/py-frame.exp @@ -20,40 +20,28 @@ if $tracelevel then { strace $tracelevel } @@ -26076,7 +27293,7 @@ index 82b526e..82ae814 100644 + return -1 +} + - set testfile "python-frame" + set testfile "py-frame" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} + @@ -26147,10 +27364,10 @@ index 82b526e..82ae814 100644 gdb_test "python print 'result =', gdb.selected_frame () == f1" " = True" "test gdb.selected_frame" + +gdb_test "python print 'result =', f0.block ()" "" "test Frame.block" -diff --git a/gdb/testsuite/gdb.python/python-function.exp b/gdb/testsuite/gdb.python/python-function.exp +diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb.python/py-function.exp index 7feca2b..4ae519f 100644 ---- a/gdb/testsuite/gdb.python/python-function.exp -+++ b/gdb/testsuite/gdb.python/python-function.exp +--- a/gdb/testsuite/gdb.python/py-function.exp ++++ b/gdb/testsuite/gdb.python/py-function.exp @@ -20,36 +20,15 @@ if $tracelevel then { strace $tracelevel } @@ -26191,11 +27408,11 @@ index 7feca2b..4ae519f 100644 } gdb_py_test_multiple "input convenience function" \ -diff --git a/gdb/testsuite/gdb.python/python-inferior.c b/gdb/testsuite/gdb.python/python-inferior.c +diff --git a/gdb/testsuite/gdb.python/py-inferior.c b/gdb/testsuite/gdb.python/py-inferior.c new file mode 100644 index 0000000..0b48299 --- /dev/null -+++ b/gdb/testsuite/gdb.python/python-inferior.c ++++ b/gdb/testsuite/gdb.python/py-inferior.c @@ -0,0 +1,49 @@ +#include +#include @@ -26246,11 +27463,11 @@ index 0000000..0b48299 + + return f1 (1, 2); +} -diff --git a/gdb/testsuite/gdb.python/python-inferior.exp b/gdb/testsuite/gdb.python/python-inferior.exp +diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp new file mode 100644 -index 0000000..ea413c6 +index 0000000..719b178 --- /dev/null -+++ b/gdb/testsuite/gdb.python/python-inferior.exp ++++ b/gdb/testsuite/gdb.python/py-inferior.exp @@ -0,0 +1,201 @@ +# Copyright (C) 2009 Free Software Foundation, Inc. + @@ -26285,7 +27502,7 @@ index 0000000..ea413c6 + return -1 +} + -+set testfile "python-inferior" ++set testfile "py-inferior" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + @@ -26453,11 +27670,11 @@ index 0000000..ea413c6 + gdb_test "py print gdb.inferiors()\[0\].search_memory (start_addr, length, 0xfdb97531, 4)" \ + "${one_pattern_found}" "find pattern straddling chunk boundary" +} -diff --git a/gdb/testsuite/gdb.python/python-infthread.c b/gdb/testsuite/gdb.python/python-infthread.c +diff --git a/gdb/testsuite/gdb.python/py-infthread.c b/gdb/testsuite/gdb.python/py-infthread.c new file mode 100644 index 0000000..22eb9f2 --- /dev/null -+++ b/gdb/testsuite/gdb.python/python-infthread.c ++++ b/gdb/testsuite/gdb.python/py-infthread.c @@ -0,0 +1,14 @@ +int f2 (int a) +{ @@ -26473,11 +27690,11 @@ index 0000000..22eb9f2 +{ + return f1 (1, 2); +} -diff --git a/gdb/testsuite/gdb.python/python-infthread.exp b/gdb/testsuite/gdb.python/python-infthread.exp +diff --git a/gdb/testsuite/gdb.python/py-infthread.exp b/gdb/testsuite/gdb.python/py-infthread.exp new file mode 100644 -index 0000000..d444554 +index 0000000..e9d18b7 --- /dev/null -+++ b/gdb/testsuite/gdb.python/python-infthread.exp ++++ b/gdb/testsuite/gdb.python/py-infthread.exp @@ -0,0 +1,58 @@ +# Copyright (C) 2009 Free Software Foundation, Inc. + @@ -26512,7 +27729,7 @@ index 0000000..d444554 + return -1 +} + -+set testfile "python-infthread" ++set testfile "py-infthread" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + @@ -26537,10 +27754,10 @@ index 0000000..d444554 +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/python-mi.exp b/gdb/testsuite/gdb.python/python-mi.exp -index 3258810..7791775 100644 ---- a/gdb/testsuite/gdb.python/python-mi.exp -+++ b/gdb/testsuite/gdb.python/python-mi.exp +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" @@ -26567,7 +27784,7 @@ index 3258810..7791775 100644 + "assign string_1 from string_2" + +mi_gdb_test "-var-update string" \ -+ "\\^done,changelist=\\\[{name=\"string\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"}\\\]" \ ++ "\\^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 \ @@ -26582,7 +27799,7 @@ index 3258810..7791775 100644 - { {container.\[0\]} {\[0\]} 0 int } -} "varobj update 1" +mi_varobj_update_dynamic container "varobj update 1" { -+ type_changed false new_num_children 1 has_more 0 ++ type_changed false new_num_children 1 dynamic 1 has_more 0 +} { +} { + { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 } @@ -26595,7 +27812,7 @@ index 3258810..7791775 100644 - { {container.\[1\]} {\[1\]} 0 int } -} "varobj update 2" +mi_varobj_update_dynamic container "varobj update 2" { -+ type_changed false new_num_children 2 has_more 0 ++ type_changed false new_num_children 2 dynamic 1 has_more 0 +} { +} { + { name {container.\[1\]} exp {\[1\]} numchild 0 type int thread-id 1 } @@ -26603,7 +27820,7 @@ index 3258810..7791775 100644 mi_gdb_test "-var-set-visualizer container None" \ "\\^done" \ -@@ -78,19 +108,88 @@ mi_gdb_test "-var-set-visualizer container gdb.default_visualizer" \ +@@ -78,19 +108,111 @@ mi_gdb_test "-var-set-visualizer container gdb.default_visualizer" \ "\\^done" \ "choose default visualizer" @@ -26612,7 +27829,7 @@ index 3258810..7791775 100644 - { {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 has_more 0 ++ type_changed false new_num_children 2 dynamic 1 has_more 0 +} { +} { + { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 } @@ -26626,7 +27843,7 @@ index 3258810..7791775 100644 -mi_varobj_update_dynamic container { +mi_varobj_update_dynamic container \ + "varobj update after choosing via expression" { -+ type_changed false new_num_children 2 has_more 0 ++ type_changed false new_num_children 2 dynamic 1 has_more 0 + } { + } { + { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 } @@ -26638,9 +27855,8 @@ index 3258810..7791775 100644 +} "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 } --} "varobj update after choosing via expression" ++ { {container.\[0\]} {\[0\]} 0 int } ++ { {container.\[1\]} {\[1\]} 0 int } +} "list varobj children after resetting child range" + +mi_next "next over update 3" @@ -26651,12 +27867,13 @@ index 3258810..7791775 100644 + +# This should truncate the list. +mi_list_varobj_children container { -+ { {container.\[0\]} {\[0\]} 0 int } + { {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 } + { {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. @@ -26683,25 +27900,48 @@ index 3258810..7791775 100644 +# should not actually see them. +mi_varobj_update_dynamic container2 \ + "update varobj 2, no children requested" { -+ type_changed false has_more 1 ++ 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 has_more 1 ++ type_changed false new_num_children 1 dynamic 1 has_more 1 + } { -+ { name {container.\[0\]} in_scope true type_changed false has_more 0 } ++ { 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/python-prettyprint.c b/gdb/testsuite/gdb.python/python-prettyprint.c -index 3cafc48..adf66b5 100644 ---- a/gdb/testsuite/gdb.python/python-prettyprint.c -+++ b/gdb/testsuite/gdb.python/python-prettyprint.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 . */ @@ -26711,7 +27951,37 @@ index 3cafc48..adf66b5 100644 struct s { int a; -@@ -148,6 +150,14 @@ void do_nothing(void) +@@ -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 */ } @@ -26726,7 +27996,7 @@ index 3cafc48..adf66b5 100644 int main () { -@@ -155,11 +165,15 @@ main () +@@ -155,11 +188,15 @@ main () struct ss ssa[2]; string x = make_string ("this is x"); zzz_type c = make_container ("container"); @@ -26742,7 +28012,7 @@ index 3cafc48..adf66b5 100644 struct ns ns; ns.null_str = "embedded\0null\0string"; -@@ -193,6 +207,11 @@ main () +@@ -193,6 +230,13 @@ main () add_item (&c, 72); #ifdef MI @@ -26751,13 +28021,15 @@ index 3cafc48..adf66b5 100644 + + add_item (&c2, 2222); + add_item (&c2, 3333); ++ ++ substruct_test (); do_nothing (); #endif -diff --git a/gdb/testsuite/gdb.python/python-prettyprint.exp b/gdb/testsuite/gdb.python/python-prettyprint.exp -index 01d4a06..b2dc85d 100644 ---- a/gdb/testsuite/gdb.python/python-prettyprint.exp -+++ b/gdb/testsuite/gdb.python/python-prettyprint.exp +diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp +index d2db5bc..287a5d3 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} # Start with a fresh gdb. gdb_exit @@ -26783,10 +28055,10 @@ index 01d4a06..b2dc85d 100644 gdb_test "continue" "Program exited normally\." } -diff --git a/gdb/testsuite/gdb.python/python-prettyprint.py b/gdb/testsuite/gdb.python/python-prettyprint.py -index bf009a1..c3e0dc4 100644 ---- a/gdb/testsuite/gdb.python/python-prettyprint.py -+++ b/gdb/testsuite/gdb.python/python-prettyprint.py +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 @@ -26801,7 +28073,24 @@ index bf009a1..c3e0dc4 100644 class pp_ns: "Print a std::basic_string of some kind" -@@ -109,7 +116,7 @@ def lookup_function (val): +@@ -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. @@ -26810,7 +28099,7 @@ index bf009a1..c3e0dc4 100644 # If it points to a reference, get the reference. if type.code == gdb.TYPE_CODE_REF: -@@ -148,6 +155,9 @@ def register_pretty_printers (): +@@ -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 @@ -26820,10 +28109,21 @@ index bf009a1..c3e0dc4 100644 # Note that we purposely omit the typedef names here. # Printer lookup is based on canonical name. -diff --git a/gdb/testsuite/gdb.python/python-template.exp b/gdb/testsuite/gdb.python/python-template.exp -index 1ace5d6..b80f56e 100644 ---- a/gdb/testsuite/gdb.python/python-template.exp -+++ b/gdb/testsuite/gdb.python/python-template.exp +@@ -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 ++++ b/gdb/testsuite/gdb.python/py-template.exp @@ -20,6 +20,17 @@ if $tracelevel then { strace $tracelevel } @@ -26839,7 +28139,7 @@ index 1ace5d6..b80f56e 100644 + return -1 +} + - set testfile "python-template" + set testfile "py-template" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} @@ -29,20 +40,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ @@ -26863,55 +28163,11 @@ index 1ace5d6..b80f56e 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/python-value.exp b/gdb/testsuite/gdb.python/python-value.exp -index 19cabeb..ccf438f 100644 ---- a/gdb/testsuite/gdb.python/python-value.exp -+++ b/gdb/testsuite/gdb.python/python-value.exp -@@ -20,43 +20,6 @@ if $tracelevel then { - strace $tracelevel - } - --set testfile "python-value" --set srcfile ${testfile}.c --set binfile ${objdir}/${subdir}/${testfile} --if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -- untested "Couldn't compile ${srcfile}" -- return -1 --} -- --# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}... --# Run a test named NAME, consisting of multiple lines of input. --# After each input line INPUT, search for result line RESULT. --# Succeed if all results are seen; fail otherwise. --proc gdb_py_test_multiple {name args} { -- global gdb_prompt -- foreach {input result} $args { -- if {[gdb_test_multiple $input "$name - $input" { -- -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" { -- pass "$name - $input" -- } -- }]} { -- return 1 -- } -- } -- return 0 --} -- --# 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 test_value_creation {} { - global gdb_prompt - -@@ -292,21 +255,37 @@ proc test_value_after_death {} { +diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp +index 9b4190d..93cddc7 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 {} { "print value's type" } @@ -26942,7 +28198,7 @@ index 19cabeb..ccf438f 100644 + return -1 } -+set testfile "python-value" ++set testfile "py-value" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + @@ -26956,7 +28212,7 @@ index 19cabeb..ccf438f 100644 test_value_creation test_value_numeric_ops test_value_boolean -@@ -322,3 +301,4 @@ if ![runto_main] then { +@@ -322,3 +338,4 @@ if ![runto_main] then { test_value_in_inferior test_value_after_death @@ -28318,17 +29574,17 @@ index a7ac3c8..815c82d 100644 } diff --git a/gdb/top.c b/gdb/top.c -index cb51e08..b126a8a 100644 +index 1b4aa9d..3cfe57e 100644 --- a/gdb/top.c +++ b/gdb/top.c -@@ -378,6 +378,7 @@ execute_command (char *p, int from_tty) - } - +@@ -349,6 +349,7 @@ void + prepare_execute_command (void) + { free_all_values (); + free_all_types (); - /* Force cleanup of any alloca areas if using C alloca instead of - a builtin alloca. */ + /* With multiple threads running while the one we're examining is stopped, + the dcache can get stale without us being able to detect it. diff --git a/gdb/typeprint.c b/gdb/typeprint.c index f090231..fc15ec1 100644 --- a/gdb/typeprint.c @@ -28590,7 +29846,7 @@ index a9c875d..12f6f07 100644 } diff --git a/gdb/valops.c b/gdb/valops.c -index 5e5c4ed..7aedbfd 100644 +index b64cb21..b7d31cc 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -38,6 +38,7 @@ @@ -28672,34 +29928,39 @@ index 5e5c4ed..7aedbfd 100644 + return 1; +} + - /* Return a value with type TYPE located at ADDR. + /* Helper function for value_at, value_at_lazy, and value_at_lazy_stack. */ - Call value_at only if the data needs to be fetched immediately; -@@ -652,11 +709,19 @@ value_fetch_lazy (struct value *val) + static struct value * +@@ -656,15 +713,21 @@ value_fetch_lazy (struct value *val) } else if (VALUE_LVAL (val) == lval_memory) { - CORE_ADDR addr = value_address (val); - int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); + CORE_ADDR addr = value_raw_address (val); -+ -+ if (object_address_get_data (value_type (val), &addr)) -+ { -+ struct type *type = value_enclosing_type (val); -+ int length = TYPE_LENGTH (check_typedef (type)); - if (length) -- read_memory (addr, value_contents_all_raw (val), length); ++ if (object_address_get_data (value_type (val), &addr)) + { +- if (value_stack (val)) +- read_stack (addr, value_contents_all_raw (val), length); +- else +- read_memory (addr, value_contents_all_raw (val), length); ++ struct type *type = value_enclosing_type (val); ++ int length = TYPE_LENGTH (check_typedef (type)); ++ + if (length) + { + addr += value_offset (val); -+ read_memory (addr, value_contents_all_raw (val), length); ++ if (value_stack (val)) ++ read_stack (addr, value_contents_all_raw (val), length); ++ else ++ read_memory (addr, value_contents_all_raw (val), length); + } -+ } + } } else if (VALUE_LVAL (val) == lval_register) - { -@@ -1061,7 +1126,18 @@ address_of_variable (struct symbol *var, struct block *b) +@@ -1070,7 +1133,18 @@ address_of_variable (struct symbol *var, struct block *b) if ((VALUE_LVAL (val) == lval_memory && value_lazy (val)) || TYPE_CODE (type) == TYPE_CODE_FUNC) { @@ -28719,7 +29980,7 @@ index 5e5c4ed..7aedbfd 100644 return value_from_pointer (lookup_pointer_type (type), addr); } -@@ -1167,6 +1243,7 @@ struct value * +@@ -1176,6 +1250,7 @@ struct value * value_coerce_array (struct value *arg1) { struct type *type = check_typedef (value_type (arg1)); @@ -28727,7 +29988,7 @@ index 5e5c4ed..7aedbfd 100644 /* If the user tries to do something requiring a pointer with an array that has not yet been pushed to the target, then this would -@@ -1176,8 +1253,12 @@ value_coerce_array (struct value *arg1) +@@ -1185,8 +1260,12 @@ value_coerce_array (struct value *arg1) if (VALUE_LVAL (arg1) != lval_memory) error (_("Attempt to take address of value not located in memory.")); @@ -28741,7 +30002,7 @@ index 5e5c4ed..7aedbfd 100644 } /* Given a value which is a function, return a value which is a pointer -@@ -2060,12 +2141,25 @@ find_overload_match (struct type **arg_types, int nargs, +@@ -2069,12 +2148,25 @@ find_overload_match (struct type **arg_types, int nargs, if (method) { gdb_assert (obj); @@ -28772,7 +30033,7 @@ index 5e5c4ed..7aedbfd 100644 fns_ptr = value_find_oload_method_list (&temp, name, 0, &num_fns, -@@ -2085,16 +2179,29 @@ find_overload_match (struct type **arg_types, int nargs, +@@ -2094,16 +2186,29 @@ find_overload_match (struct type **arg_types, int nargs, } else { @@ -28810,7 +30071,7 @@ index 5e5c4ed..7aedbfd 100644 if (func_name == NULL) { *symp = fsym; -@@ -2525,8 +2632,8 @@ check_field (struct type *type, const char *name) +@@ -2534,8 +2639,8 @@ check_field (struct type *type, const char *name) the comment before value_struct_elt_for_reference. */ struct value * @@ -28821,7 +30082,7 @@ index 5e5c4ed..7aedbfd 100644 enum noside noside) { switch (TYPE_CODE (curtype)) -@@ -2534,7 +2641,7 @@ value_aggregate_elt (struct type *curtype, +@@ -2543,7 +2648,7 @@ value_aggregate_elt (struct type *curtype, case TYPE_CODE_STRUCT: case TYPE_CODE_UNION: return value_struct_elt_for_reference (curtype, 0, curtype, @@ -28830,7 +30091,7 @@ index 5e5c4ed..7aedbfd 100644 want_address, noside); case TYPE_CODE_NAMESPACE: return value_namespace_elt (curtype, name, -@@ -2545,6 +2652,56 @@ value_aggregate_elt (struct type *curtype, +@@ -2554,6 +2659,56 @@ value_aggregate_elt (struct type *curtype, } } @@ -28887,7 +30148,7 @@ index 5e5c4ed..7aedbfd 100644 /* C++: Given an aggregate type CURTYPE, and a member name NAME, return the address of this member as a "pointer to member" type. If INTYPE is non-null, then it will be the type of the member we -@@ -2622,23 +2779,46 @@ value_struct_elt_for_reference (struct type *domain, int offset, +@@ -2631,23 +2786,46 @@ value_struct_elt_for_reference (struct type *domain, int offset, } if (t_field_name && strcmp (t_field_name, name) == 0) { @@ -28944,7 +30205,7 @@ index 5e5c4ed..7aedbfd 100644 if (TYPE_FN_FIELD_STATIC_P (f, j)) { -@@ -2752,7 +2932,7 @@ value_maybe_namespace_elt (const struct type *curtype, +@@ -2761,7 +2939,7 @@ value_maybe_namespace_elt (const struct type *curtype, struct symbol *sym; struct value *result; @@ -28953,7 +30214,7 @@ index 5e5c4ed..7aedbfd 100644 get_selected_block (0), VAR_DOMAIN); -@@ -2896,7 +3076,7 @@ value_of_local (const char *name, int complain) +@@ -2905,7 +3083,7 @@ value_of_local (const char *name, int complain) /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER symbol instead of the LOC_ARG one (if both exist). */ @@ -28962,7 +30223,7 @@ index 5e5c4ed..7aedbfd 100644 if (sym == NULL) { if (complain) -@@ -2950,8 +3130,6 @@ value_slice (struct value *array, int lowbound, int length) +@@ -2959,8 +3137,6 @@ value_slice (struct value *array, int lowbound, int length) || lowbound + length - 1 > upperbound) error (_("slice out of range")); @@ -29001,7 +30262,7 @@ index cbb5d94..f9634ea 100644 ++reps; ++rep1; diff --git a/gdb/value.c b/gdb/value.c -index 48fedfd..5c207e3 100644 +index 589e03b..66013b7 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -37,8 +37,10 @@ @@ -29030,7 +30291,7 @@ index 48fedfd..5c207e3 100644 /* Register number if the value is from a register. */ short regnum; -@@ -257,7 +267,9 @@ allocate_value_lazy (struct type *type) +@@ -261,7 +271,9 @@ allocate_value_lazy (struct type *type) val->next = all_values; all_values = val; val->type = type; @@ -29040,7 +30301,7 @@ index 48fedfd..5c207e3 100644 VALUE_LVAL (val) = not_lval; val->location.address = 0; VALUE_FRAME_ID (val) = null_frame_id; -@@ -342,6 +354,8 @@ value_type (struct value *value) +@@ -346,6 +358,8 @@ value_type (struct value *value) void deprecated_set_value_type (struct value *value, struct type *type) { @@ -29049,7 +30310,7 @@ index 48fedfd..5c207e3 100644 value->type = type; } -@@ -608,6 +622,9 @@ value_free (struct value *val) +@@ -624,6 +638,9 @@ value_free (struct value *val) if (val->parent != NULL) value_free (val->parent); @@ -29059,7 +30320,7 @@ index 48fedfd..5c207e3 100644 if (VALUE_LVAL (val) == lval_computed) { struct lval_funcs *funcs = val->location.computed.funcs; -@@ -711,6 +728,9 @@ value_copy (struct value *arg) +@@ -728,6 +745,9 @@ value_copy (struct value *arg) val = allocate_value_lazy (encl_type); else val = allocate_value (encl_type); @@ -29069,7 +30330,7 @@ index 48fedfd..5c207e3 100644 val->type = arg->type; VALUE_LVAL (val) = VALUE_LVAL (arg); val->location = arg->location; -@@ -746,12 +766,15 @@ value_copy (struct value *arg) +@@ -763,12 +783,15 @@ value_copy (struct value *arg) void set_value_component_location (struct value *component, struct value *whole) { @@ -29085,7 +30346,7 @@ index 48fedfd..5c207e3 100644 if (VALUE_LVAL (whole) == lval_computed) { struct lval_funcs *funcs = whole->location.computed.funcs; -@@ -759,6 +782,10 @@ set_value_component_location (struct value *component, struct value *whole) +@@ -776,6 +799,10 @@ set_value_component_location (struct value *component, struct value *whole) if (funcs->copy_closure) component->location.computed.closure = funcs->copy_closure (whole); } @@ -29096,7 +30357,7 @@ index 48fedfd..5c207e3 100644 } -@@ -889,6 +916,29 @@ show_values (char *num_exp, int from_tty) +@@ -906,6 +933,29 @@ show_values (char *num_exp, int from_tty) num_exp[1] = '\0'; } } @@ -29126,7 +30387,7 @@ index 48fedfd..5c207e3 100644 /* Internal variables. These are variables within the debugger that hold values assigned by debugger commands. -@@ -1364,6 +1414,40 @@ call_internal_function (struct gdbarch *gdbarch, +@@ -1381,6 +1431,40 @@ call_internal_function (struct gdbarch *gdbarch, return (*ifn->handler) (gdbarch, language, ifn->cookie, argc, argv); } @@ -29167,7 +30428,7 @@ index 48fedfd..5c207e3 100644 /* The 'function' command. This does nothing -- it is just a placeholder to let "help function NAME" work. This is also used as the implementation of the sub-command that is created when -@@ -1411,11 +1495,10 @@ preserve_one_value (struct value *value, struct objfile *objfile, +@@ -1428,11 +1512,10 @@ preserve_one_value (struct value *value, struct objfile *objfile, htab_t copied_types) { if (TYPE_OBJFILE (value->type) == objfile) @@ -29181,7 +30442,7 @@ index 48fedfd..5c207e3 100644 copied_types); } -@@ -1430,13 +1513,13 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile, +@@ -1447,13 +1530,13 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile, case INTERNALVAR_INTEGER: if (var->u.integer.type && TYPE_OBJFILE (var->u.integer.type) == objfile) var->u.integer.type @@ -29197,7 +30458,7 @@ index 48fedfd..5c207e3 100644 break; case INTERNALVAR_VALUE: -@@ -1838,6 +1921,8 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type) +@@ -1855,6 +1938,8 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type) val->contents = (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type)); @@ -29206,7 +30467,7 @@ index 48fedfd..5c207e3 100644 val->enclosing_type = new_encl_type; return val; } -@@ -1902,6 +1987,8 @@ value_primitive_field (struct value *arg1, int offset, +@@ -1919,6 +2004,8 @@ value_primitive_field (struct value *arg1, int offset, memcpy (value_contents_all_raw (v), value_contents_all_raw (arg1), TYPE_LENGTH (value_enclosing_type (arg1))); } @@ -29215,7 +30476,7 @@ index 48fedfd..5c207e3 100644 v->type = type; v->offset = value_offset (arg1); v->embedded_offset = (offset + value_embedded_offset (arg1) -@@ -2152,6 +2239,42 @@ pack_long (gdb_byte *buf, struct type *type, LONGEST num) +@@ -2177,6 +2264,42 @@ pack_long (gdb_byte *buf, struct type *type, LONGEST num) } @@ -29258,7 +30519,7 @@ index 48fedfd..5c207e3 100644 /* Convert C numbers into newly allocated values. */ struct value * -@@ -2165,6 +2288,19 @@ value_from_longest (struct type *type, LONGEST num) +@@ -2190,6 +2313,19 @@ value_from_longest (struct type *type, LONGEST num) } @@ -29278,7 +30539,7 @@ index 48fedfd..5c207e3 100644 /* Create a value representing a pointer of type TYPE to the address ADDR. */ struct value * -@@ -2323,4 +2459,8 @@ VARIABLE is already initialized.")); +@@ -2348,4 +2484,8 @@ VARIABLE is already initialized.")); add_prefix_cmd ("function", no_class, function_command, _("\ Placeholder command for showing help on convenience functions."), &functionlist, "function ", 0, &cmdlist); @@ -29288,10 +30549,10 @@ index 48fedfd..5c207e3 100644 + observer_attach_mark_used (value_types_mark_used); } diff --git a/gdb/value.h b/gdb/value.h -index 6f6b756..b9ca650 100644 +index 51e6960..48b30e4 100644 --- a/gdb/value.h +++ b/gdb/value.h -@@ -339,11 +339,16 @@ extern LONGEST unpack_field_as_long (struct type *type, +@@ -342,11 +342,16 @@ extern LONGEST unpack_field_as_long (struct type *type, extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); extern struct value *value_from_longest (struct type *type, LONGEST num); @@ -29308,7 +30569,7 @@ index 6f6b756..b9ca650 100644 extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); -@@ -433,6 +438,7 @@ extern struct value *value_struct_elt (struct value **argp, +@@ -436,6 +441,7 @@ extern struct value *value_struct_elt (struct value **argp, extern struct value *value_aggregate_elt (struct type *curtype, char *name, @@ -29316,7 +30577,7 @@ index 6f6b756..b9ca650 100644 int want_address, enum noside noside); -@@ -678,7 +684,7 @@ extern struct value *value_allocate_space_in_inferior (int); +@@ -681,7 +687,7 @@ extern struct value *value_allocate_space_in_inferior (int); extern struct value *value_of_local (const char *name, int complain); extern struct value *value_subscripted_rvalue (struct value *array, @@ -29326,7 +30587,7 @@ index 6f6b756..b9ca650 100644 /* User function handler. */ diff --git a/gdb/varobj.c b/gdb/varobj.c -index fbe8ff8..490ca33 100644 +index 603071f..f1ce89f 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -26,9 +26,12 @@ @@ -29417,7 +30678,7 @@ index fbe8ff8..490ca33 100644 return ensure_python_env (var->root->exp->gdbarch, var->root->exp->language_defn); } -@@ -614,9 +650,9 @@ varobj_create (char *objname, +@@ -621,9 +657,9 @@ varobj_create (char *objname, do_cleanups (old_chain); return NULL; } @@ -29428,7 +30689,7 @@ index fbe8ff8..490ca33 100644 discard_cleanups (old_chain); return var; } -@@ -731,15 +767,8 @@ instantiate_pretty_printer (PyObject *constructor, struct value *value) +@@ -738,15 +774,8 @@ instantiate_pretty_printer (PyObject *constructor, struct value *value) #if HAVE_PYTHON PyObject *val_obj = NULL; PyObject *printer; @@ -29444,7 +30705,7 @@ index fbe8ff8..490ca33 100644 if (! val_obj) return NULL; -@@ -792,7 +821,12 @@ varobj_get_display_hint (struct varobj *var) +@@ -799,7 +828,12 @@ varobj_get_display_hint (struct varobj *var) char *result = NULL; #if HAVE_PYTHON @@ -29458,7 +30719,7 @@ index fbe8ff8..490ca33 100644 if (var->pretty_printer) result = gdbpy_get_display_hint (var->pretty_printer); -@@ -803,6 +837,17 @@ varobj_get_display_hint (struct varobj *var) +@@ -810,6 +844,17 @@ varobj_get_display_hint (struct varobj *var) return result; } @@ -29476,7 +30737,7 @@ index fbe8ff8..490ca33 100644 /* 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 -@@ -835,22 +880,90 @@ varobj_get_frozen (struct varobj *var) +@@ -842,22 +887,94 @@ varobj_get_frozen (struct varobj *var) return var->frozen; } @@ -29511,6 +30772,7 @@ index fbe8ff8..490ca33 100644 +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, @@ -29532,6 +30794,8 @@ index fbe8ff8..490ca33 100644 + if (changed) + VEC_safe_push (varobj_p, *changed, existing); + } ++ else if (unchanged) ++ VEC_safe_push (varobj_p, *unchanged, existing); + } +} + @@ -29559,6 +30823,7 @@ index fbe8ff8..490ca33 100644 - int *cchanged) - + VEC (varobj_p) **new, ++ VEC (varobj_p) **unchanged, + int *cchanged, + int update_children, + int to) @@ -29575,7 +30840,7 @@ index fbe8ff8..490ca33 100644 PyObject *printer = var->pretty_printer; back_to = varobj_ensure_python_env (var); -@@ -862,87 +975,103 @@ update_dynamic_varobj_children (struct varobj *var, +@@ -869,87 +986,103 @@ update_dynamic_varobj_children (struct varobj *var, return 0; } @@ -29680,7 +30945,7 @@ index fbe8ff8..490ca33 100644 + error (_("Invalid item from the child list")); + + v = convert_value_from_python (py_v); -+ install_dynamic_child (var, changed, new, ++ install_dynamic_child (var, changed, new, unchanged, + cchanged, i, name, v); + do_cleanups (inner); } @@ -29736,7 +31001,7 @@ index fbe8ff8..490ca33 100644 return 1; #else gdb_assert (0 && "should never be called if Python is not enabled"); -@@ -954,20 +1083,26 @@ varobj_get_num_children (struct varobj *var) +@@ -961,20 +1094,26 @@ varobj_get_num_children (struct varobj *var) { if (var->num_children == -1) { @@ -29749,7 +31014,7 @@ index fbe8ff8..490ca33 100644 + + /* 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, &dummy, 0, 0); ++ update_dynamic_varobj_children (var, NULL, NULL, NULL, &dummy, 0, 0); + } + else var->num_children = number_of_children (var); @@ -29768,7 +31033,7 @@ index fbe8ff8..490ca33 100644 { struct varobj *child; char *name; -@@ -975,12 +1110,16 @@ varobj_list_children (struct varobj *var) +@@ -982,12 +1121,16 @@ varobj_list_children (struct varobj *var) var->children_requested = 1; @@ -29780,7 +31045,7 @@ index fbe8ff8..490ca33 100644 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, &children_changed, ++ update_dynamic_varobj_children (var, NULL, NULL, NULL, &children_changed, + 0, *to); + restrict_range (var->children, from, to); + return var->children; @@ -29788,7 +31053,7 @@ index fbe8ff8..490ca33 100644 if (var->num_children == -1) var->num_children = number_of_children (var); -@@ -1006,10 +1145,10 @@ varobj_list_children (struct varobj *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); @@ -29800,7 +31065,7 @@ index fbe8ff8..490ca33 100644 return var->children; } -@@ -1020,7 +1159,6 @@ varobj_add_child (struct varobj *var, const char *name, struct value *value) +@@ -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); @@ -29808,7 +31073,7 @@ index fbe8ff8..490ca33 100644 return v; } -@@ -1082,6 +1220,12 @@ varobj_get_attributes (struct varobj *var) +@@ -1089,6 +1231,12 @@ varobj_get_attributes (struct varobj *var) return attributes; } @@ -29821,7 +31086,7 @@ index fbe8ff8..490ca33 100644 char * varobj_get_formatted_value (struct varobj *var, enum varobj_display_formats format) -@@ -1159,6 +1303,116 @@ varobj_set_value (struct varobj *var, char *expression) +@@ -1166,6 +1314,116 @@ varobj_set_value (struct varobj *var, char *expression) return 1; } @@ -29938,7 +31203,7 @@ index fbe8ff8..490ca33 100644 /* 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 -@@ -1199,10 +1453,7 @@ install_new_value (struct varobj *var, struct value *value, int initial) +@@ -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) @@ -29950,7 +31215,7 @@ index fbe8ff8..490ca33 100644 if (var->type && TYPE_CODE (var->type) == TYPE_CODE_UNION) /* For unions, we need to fetch the value implicitly because -@@ -1249,7 +1500,7 @@ install_new_value (struct varobj *var, struct value *value, int initial) +@@ -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. */ @@ -29959,7 +31224,7 @@ index fbe8ff8..490ca33 100644 print_value = value_get_print_value (value, var->format, var); /* If the type is changeable, compare the old and the new values. -@@ -1265,7 +1516,7 @@ install_new_value (struct varobj *var, struct value *value, int initial) +@@ -1272,7 +1527,7 @@ install_new_value (struct varobj *var, struct value *value, int initial) { changed = 1; } @@ -29968,7 +31233,7 @@ index fbe8ff8..490ca33 100644 { /* Try to compare the values. That requires that both values are non-lazy. */ -@@ -1310,74 +1561,53 @@ install_new_value (struct varobj *var, struct value *value, int initial) +@@ -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; @@ -30075,7 +31340,7 @@ index fbe8ff8..490ca33 100644 } void -@@ -1395,31 +1625,19 @@ varobj_set_visualizer (struct varobj *var, const char *visualizer) +@@ -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); @@ -30113,7 +31378,7 @@ index fbe8ff8..490ca33 100644 do_cleanups (back_to); #else -@@ -1530,44 +1748,63 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit) +@@ -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 @@ -30123,7 +31388,7 @@ index fbe8ff8..490ca33 100644 if (v->pretty_printer) { - VEC (varobj_p) *changed = 0, *new_and_unchanged = 0; -+ VEC (varobj_p) *changed = 0, *new = 0; ++ VEC (varobj_p) *changed = 0, *new = 0, *unchanged = 0; int i, children_changed; varobj_p tmp; @@ -30145,7 +31410,8 @@ index fbe8ff8..490ca33 100644 + it. */ + if (!varobj_has_more (v, 0)) + { -+ update_dynamic_varobj_children (v, NULL, NULL, &dummy, 0, 0); ++ update_dynamic_varobj_children (v, NULL, NULL, NULL, ++ &dummy, 0, 0); + if (varobj_has_more (v, 0)) + r.changed = 1; + } @@ -30160,7 +31426,7 @@ index fbe8ff8..490ca33 100644 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, ++ if (update_dynamic_varobj_children (v, &changed, &new, &unchanged, + &children_changed, 1, v->to)) { - if (children_changed) @@ -30185,17 +31451,27 @@ index fbe8ff8..490ca33 100644 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, but not NEW, because NEW has been put -+ into the result vector. */ ++ /* 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; } } -@@ -1855,7 +2092,12 @@ new_variable (void) +@@ -1862,7 +2114,12 @@ new_variable (void) var->frozen = 0; var->not_fetched = 0; var->children_requested = 0; @@ -30208,7 +31484,7 @@ index fbe8ff8..490ca33 100644 return var; } -@@ -1885,7 +2127,10 @@ free_variable (struct varobj *var) +@@ -1892,7 +2149,10 @@ free_variable (struct varobj *var) if (var->pretty_printer) { struct cleanup *cleanup = varobj_ensure_python_env (var); @@ -30220,7 +31496,7 @@ index fbe8ff8..490ca33 100644 do_cleanups (cleanup); } #endif -@@ -1918,6 +2163,18 @@ make_cleanup_free_variable (struct varobj *var) +@@ -1925,6 +2185,18 @@ make_cleanup_free_variable (struct varobj *var) return make_cleanup (do_free_variable_cleanup, var); } @@ -30239,7 +31515,7 @@ index fbe8ff8..490ca33 100644 /* This returns the type of the variable. It also skips past typedefs to return the real type of the variable. -@@ -2132,6 +2389,8 @@ value_of_root (struct varobj **var_handle, int *type_changed) +@@ -2139,6 +2411,8 @@ value_of_root (struct varobj **var_handle, int *type_changed) else { tmp_var->obj_name = xstrdup (var->obj_name); @@ -30248,7 +31524,7 @@ index fbe8ff8..490ca33 100644 varobj_delete (var, NULL, 0); install_variable (tmp_var); -@@ -2166,7 +2425,11 @@ static char * +@@ -2173,7 +2447,11 @@ static char * my_value_of_variable (struct varobj *var, enum varobj_display_formats format) { if (var->root->is_valid) @@ -30261,7 +31537,7 @@ index fbe8ff8..490ca33 100644 else return NULL; } -@@ -2189,43 +2452,51 @@ value_get_print_value (struct value *value, enum varobj_display_formats format, +@@ -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; @@ -30344,7 +31620,7 @@ index fbe8ff8..490ca33 100644 } do_cleanups (back_to); } -@@ -2954,10 +3225,7 @@ cplus_describe_child (struct varobj *parent, int index, +@@ -2961,10 +3247,7 @@ cplus_describe_child (struct varobj *parent, int index, *cname = xstrdup (TYPE_FIELD_NAME (type, index)); if (cvalue && value) @@ -30356,7 +31632,7 @@ index fbe8ff8..490ca33 100644 if (ctype) { -@@ -3163,6 +3431,19 @@ java_value_of_variable (struct varobj *var, enum varobj_display_formats format) +@@ -3170,6 +3453,19 @@ java_value_of_variable (struct varobj *var, enum varobj_display_formats format) return cplus_value_of_variable (var, format); } @@ -30376,7 +31652,7 @@ index fbe8ff8..490ca33 100644 /* Iterate all the existing _root_ VAROBJs and call the FUNC callback for them with an arbitrary caller supplied DATA pointer. */ -@@ -3180,6 +3461,43 @@ all_root_varobjs (void (*func) (struct varobj *var, void *data), void *data) +@@ -3187,6 +3483,43 @@ all_root_varobjs (void (*func) (struct varobj *var, void *data), void *data) (*func) (var_root->rootvar, data); } } diff --git a/gdb-bz520129-drow-bitfields.patch b/gdb-bz520129-drow-bitfields.patch deleted file mode 100644 index 81ecf1b..0000000 --- a/gdb-bz520129-drow-bitfields.patch +++ /dev/null @@ -1,245 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2009-07/msg00143.html - -2009-07-21 Daniel Jacobowitz - Vladimir Prus - - * valops.c (value_fetch_lazy): Handle bitfields explicitly. - (value_assign): Remove unnecessary FIXME. Honor the container - type of bitfields if possible. - * value.c (struct value): Add parent field. - (value_parent): New function. - (value_free): Free the parent also. - (value_copy): Copy the parent also. - (value_primitive_field): Do not read the contents of a lazy - value to create a child bitfield value. Set bitpos and offset - according to the container type if possible. - (unpack_bits_as_long): Rename from unpack_field_as_long. Take - field_type, bitpos, and bitsize instead of type and fieldno. - (unpack_field_as_long): Use unpack_bits_as_long. - * value.h (value_parent, unpack_bits_as_long): New prototypes. - -[ Reverted, backported for Fedora. ] - ---- ./gdb/valops.c 2009-08-28 19:27:30.000000000 +0200 -+++ ./gdb/valops.c 2009-08-28 19:27:59.000000000 +0200 -@@ -689,25 +689,7 @@ value_fetch_lazy (struct value *val) - { - gdb_assert (value_lazy (val)); - allocate_value_contents (val); -- if (value_bitsize (val)) -- { -- /* To read a lazy bitfield, read the entire enclosing value. This -- prevents reading the same block of (possibly volatile) memory once -- per bitfield. It would be even better to read only the containing -- word, but we have no way to record that just specific bits of a -- value have been fetched. */ -- struct type *type = check_typedef (value_type (val)); -- enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); -- struct value *parent = value_parent (val); -- LONGEST offset = value_offset (val); -- LONGEST num = unpack_bits_as_long (value_type (val), -- value_contents (parent) + offset, -- value_bitpos (val), -- value_bitsize (val)); -- int length = TYPE_LENGTH (type); -- store_signed_integer (value_contents_raw (val), length, byte_order, num); -- } -- else if (VALUE_LVAL (val) == lval_memory) -+ if (VALUE_LVAL (val) == lval_memory) - { - CORE_ADDR addr = value_raw_address (val); - -@@ -883,20 +865,13 @@ value_assign (struct value *toval, struc - - if (value_bitsize (toval)) - { -+ /* We assume that the argument to read_memory is in units -+ of host chars. FIXME: Is that correct? */ - changed_len = (value_bitpos (toval) - + value_bitsize (toval) - + HOST_CHAR_BIT - 1) - / HOST_CHAR_BIT; - -- /* If we can read-modify-write exactly the size of the -- containing type (e.g. short or int) then do so. This -- is safer for volatile bitfields mapped to hardware -- registers. */ -- if (changed_len < TYPE_LENGTH (type) -- && TYPE_LENGTH (type) <= (int) sizeof (LONGEST) -- && ((LONGEST) value_address (toval) % TYPE_LENGTH (type)) == 0) -- changed_len = TYPE_LENGTH (type); -- - if (changed_len > (int) sizeof (LONGEST)) - error (_("Can't handle bitfields which don't fit in a %d bit word."), - (int) sizeof (LONGEST) * HOST_CHAR_BIT); ---- ./gdb/value.c 2009-08-28 19:27:29.000000000 +0200 -+++ ./gdb/value.c 2009-08-28 19:28:34.000000000 +0200 -@@ -110,11 +110,6 @@ struct value - gdbarch_bits_big_endian=1 targets, it is the position of the MSB. */ - int bitpos; - -- /* Only used for bitfields; the containing value. This allows a -- single read from the target when displaying multiple -- bitfields. */ -- struct value *parent; -- - /* Frame register value is relative to. This will be described in - the lval enum above as "lval_register". */ - struct frame_id frame_id; -@@ -392,12 +387,6 @@ set_value_bitsize (struct value *value, - value->bitsize = bit; - } - --struct value * --value_parent (struct value *value) --{ -- return value->parent; --} -- - gdb_byte * - value_contents_raw (struct value *value) - { -@@ -617,11 +606,6 @@ value_free (struct value *val) - if (val->reference_count > 0) - return; - -- /* If there's an associated parent value, drop our reference to -- it. */ -- if (val->parent != NULL) -- value_free (val->parent); -- - type_decref (val->type); - type_decref (val->enclosing_type); - -@@ -750,9 +734,6 @@ value_copy (struct value *arg) - TYPE_LENGTH (value_enclosing_type (arg))); - - } -- val->parent = arg->parent; -- if (val->parent) -- value_incref (val->parent); - if (VALUE_LVAL (val) == lval_computed) - { - struct lval_funcs *funcs = val->location.computed.funcs; -@@ -1946,28 +1927,15 @@ value_primitive_field (struct value *arg - - if (TYPE_FIELD_BITSIZE (arg_type, fieldno)) - { -- /* Create a new value for the bitfield, with bitpos and bitsize -- set. If possible, arrange offset and bitpos so that we can -- do a single aligned read of the size of the containing type. -- Otherwise, adjust offset to the byte containing the first -- bit. Assume that the address, offset, and embedded offset -- are sufficiently aligned. */ -- int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); -- int container_bitsize = TYPE_LENGTH (type) * 8; -- -- v = allocate_value_lazy (type); -+ v = value_from_longest (type, -+ unpack_field_as_long (arg_type, -+ value_contents (arg1) -+ + offset, -+ fieldno)); -+ v->bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno) % 8; - v->bitsize = TYPE_FIELD_BITSIZE (arg_type, fieldno); -- if ((bitpos % container_bitsize) + v->bitsize <= container_bitsize -- && TYPE_LENGTH (type) <= (int) sizeof (LONGEST)) -- v->bitpos = bitpos % container_bitsize; -- else -- v->bitpos = bitpos % 8; -- v->offset = value_offset (arg1) + value_embedded_offset (arg1) -- + (bitpos - v->bitpos) / 8; -- v->parent = arg1; -- value_incref (v->parent); -- if (!value_lazy (arg1)) -- value_fetch_lazy (v); -+ v->offset = value_offset (arg1) + offset -+ + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; - } - else if (fieldno < TYPE_N_BASECLASSES (arg_type)) - { -@@ -2094,9 +2062,8 @@ value_fn_field (struct value **arg1p, st - } - - --/* Unpack a bitfield of the specified FIELD_TYPE, from the anonymous -- object at VALADDR. The bitfield starts at BITPOS bits and contains -- BITSIZE bits. -+/* Unpack a field FIELDNO of the specified TYPE, from the anonymous object at -+ VALADDR. - - Extracting bits depends on endianness of the machine. Compute the - number of least significant bits to discard. For big endian machines, -@@ -2110,21 +2077,24 @@ value_fn_field (struct value **arg1p, st - If the field is signed, we also do sign extension. */ - - LONGEST --unpack_bits_as_long (struct type *field_type, const gdb_byte *valaddr, -- int bitpos, int bitsize) -+unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno) - { -- enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (field_type)); -+ enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); - ULONGEST val; - ULONGEST valmask; -+ int bitpos = TYPE_FIELD_BITPOS (type, fieldno); -+ int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); - int lsbcount; -+ struct type *field_type; - - val = extract_unsigned_integer (valaddr + bitpos / 8, - sizeof (val), byte_order); -+ field_type = TYPE_FIELD_TYPE (type, fieldno); - CHECK_TYPEDEF (field_type); - - /* Extract bits. See comment above. */ - -- if (gdbarch_bits_big_endian (get_type_arch (field_type))) -+ if (gdbarch_bits_big_endian (get_type_arch (type))) - lsbcount = (sizeof val * 8 - bitpos % 8 - bitsize); - else - lsbcount = (bitpos % 8); -@@ -2148,19 +2118,6 @@ unpack_bits_as_long (struct type *field_ - return (val); - } - --/* Unpack a field FIELDNO of the specified TYPE, from the anonymous object at -- VALADDR. See unpack_bits_as_long for more details. */ -- --LONGEST --unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno) --{ -- int bitpos = TYPE_FIELD_BITPOS (type, fieldno); -- int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); -- struct type *field_type = TYPE_FIELD_TYPE (type, fieldno); -- -- return unpack_bits_as_long (field_type, valaddr, bitpos, bitsize); --} -- - /* Modify the value of a bitfield. ADDR points to a block of memory in - target byte order; the bitfield starts in the byte pointed to. FIELDVAL - is the desired value of the field, in host byte order. BITPOS and BITSIZE ---- ./gdb/value.h 2009-08-28 19:27:29.000000000 +0200 -+++ ./gdb/value.h 2009-08-28 19:27:59.000000000 +0200 -@@ -71,12 +71,6 @@ extern void set_value_bitsize (struct va - extern int value_bitpos (struct value *); - extern void set_value_bitpos (struct value *, int bit); - --/* Only used for bitfields; the containing value. This allows a -- single read from the target when displaying multiple -- bitfields. */ -- --struct value *value_parent (struct value *); -- - /* Describes offset of a value within lval of a structure in bytes. - If lval == lval_memory, this is an offset to the address. If lval - == lval_register, this is a further offset from location.address -@@ -330,8 +324,6 @@ extern LONGEST unpack_long (struct type - extern DOUBLEST unpack_double (struct type *type, const gdb_byte *valaddr, - int *invp); - extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr); --LONGEST unpack_bits_as_long (struct type *field_type, const gdb_byte *valaddr, -- int bitpos, int bitsize); - extern LONGEST unpack_field_as_long (struct type *type, - const gdb_byte *valaddr, - int fieldno); diff --git a/gdb-readline-6.0.patch b/gdb-readline-6.0.patch index 26d9405..2d0060b 100644 --- a/gdb-readline-6.0.patch +++ b/gdb-readline-6.0.patch @@ -7,9 +7,11 @@ gdb/ * config.in: Regenerate. * configure: Regenerate. ---- a/gdb/configure.ac -+++ b/gdb/configure.ac -@@ -536,6 +536,21 @@ if test "$with_system_readline" = yes; then +Index: gdb-6.8.50.20090909/gdb/configure.ac +=================================================================== +--- gdb-6.8.50.20090909.orig/gdb/configure.ac 2009-09-09 20:11:04.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/configure.ac 2009-09-09 20:11:54.000000000 +0200 +@@ -773,6 +773,21 @@ if test "$with_system_readline" = yes; t READLINE=-lreadline READLINE_DEPS= READLINE_CFLAGS= @@ -31,9 +33,11 @@ gdb/ else READLINE='$(READLINE_DIR)/libreadline.a' READLINE_DEPS='$(READLINE)' ---- a/gdb/config.in -+++ b/gdb/config.in -@@ -790,6 +790,9 @@ +Index: gdb-6.8.50.20090909/gdb/config.in +=================================================================== +--- gdb-6.8.50.20090909.orig/gdb/config.in 2009-09-09 20:11:33.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/config.in 2009-09-09 20:12:00.000000000 +0200 +@@ -815,6 +815,9 @@ /* Define to `int' if does not define. */ #undef pid_t @@ -43,9 +47,11 @@ gdb/ /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ ---- a/gdb/configure -+++ b/gdb/configure -@@ -10763,6 +10763,69 @@ if test "$with_system_readline" = yes; then +Index: gdb-6.8.50.20090909/gdb/configure +=================================================================== +--- gdb-6.8.50.20090909.orig/gdb/configure 2009-09-09 20:11:07.000000000 +0200 ++++ gdb-6.8.50.20090909/gdb/configure 2009-09-09 20:11:54.000000000 +0200 +@@ -9197,6 +9197,69 @@ if test "$with_system_readline" = yes; t READLINE=-lreadline READLINE_DEPS= READLINE_CFLAGS= diff --git a/gdb.spec b/gdb.spec index 0ebb2ce..bcd7b31 100644 --- a/gdb.spec +++ b/gdb.spec @@ -10,11 +10,11 @@ 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.20090818 +Version: 6.8.50.20090910 # 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. -Release: 8%{?_with_upstream:.upstream}%{?dist} +Release: 1%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ Group: Development/Debuggers @@ -218,8 +218,8 @@ Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch # Testcase for exec() from threaded program (BZ 202689). Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch -# Backported post gdb-6.8.50.20090818 snapshot fixups. -Patch232: gdb-6.8.50.20090818-upstream.patch +# Backported post gdb-6.8.50.20090910 snapshot fixups. +#Patch232: gdb-6.8.50.20090910-upstream.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch @@ -363,9 +363,6 @@ Patch375: gdb-readline-6.0.patch # Temporarily disable assertion checks crashing in qsort_cmp (BZ 515434). Patch378: gdb-bz515434-qsort_cmp.patch -# Revert bitfields regression (BZ 520129). -Patch380: gdb-bz520129-drow-bitfields.patch - BuildRequires: ncurses-devel texinfo gettext flex bison expat-devel Requires: readline BuildRequires: readline-devel @@ -450,7 +447,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %if 0%{!?_with_upstream:1} -%patch232 -p1 +#patch232 -p1 %patch349 -p1 %patch1 -p1 %patch3 -p1 @@ -555,7 +552,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch360 -p1 %patch375 -p1 %patch378 -p1 -%patch380 -p1 %patch124 -p1 find -name "*.orig" | xargs rm -f @@ -829,6 +825,12 @@ fi %endif %changelog +* 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 + - [next-over-throw] Fix exceptions thrown during next (Tom Tromey). + - [bp_location-accel] Do not (much) slow down on 500+ breakpoints (me). + * Thu Sep 3 2009 Jan Kratochvil - 6.8.50.20090818-8 - archer-jankratochvil-fedora12 commit: a081d2f12945e9468edd5f4341d3e945bd0fefe9 - [expr] Fix too slow lookups in large C++ programs (Sami Wagiaalla). diff --git a/sources b/sources index 6ef6b1e..991dfb0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -63d848cfdd9a43a9b2b412a220d00366 gdb-6.8.50.20090818.tar.bz2 +476e005b8bb33c5c3b3f0b7bd93988bc gdb-6.8.50.20090910.tar.bz2