From 81783d0ff22e482b3f443128d48d7241c8481c7c Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Feb 11 2009 00:04:48 +0000 Subject: - Upgrade to the FSF GDB gdb-6.8.50 snapshot. --- diff --git a/.cvsignore b/.cvsignore index 09434f8..eaf8f2d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gdb-6.8.50.20081214.tar.bz2 +gdb-6.8.50.20090209.tar.bz2 diff --git a/gdb-6.3-large-core-20051206.patch b/gdb-6.3-large-core-20051206.patch index ee7f4cb..369144f 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.20081128/gdb/symfile-mem.c +Index: gdb-6.8.50.20090209/gdb/symfile-mem.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/symfile-mem.c 2008-01-01 23:53:13.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/symfile-mem.c 2008-12-02 22:15:53.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/symfile-mem.c 2009-01-03 06:57:53.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/symfile-mem.c 2009-02-09 15:49:25.000000000 +0100 @@ -56,6 +56,14 @@ #include "elf/common.h" @@ -53,10 +53,10 @@ Index: gdb-6.8.50.20081128/gdb/symfile-mem.c if (nbfd == NULL) error (_("Failed to read a valid object file image from memory.")); -Index: gdb-6.8.50.20081128/gdb/target.c +Index: gdb-6.8.50.20090209/gdb/target.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/target.c 2008-11-09 12:27:18.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/target.c 2008-12-02 22:17:28.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/target.c 2009-02-06 23:21:26.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/target.c 2009-02-09 15:50:39.000000000 +0100 @@ -57,7 +57,7 @@ static int nosymbol (char *, CORE_ADDR * static void tcomplain (void) ATTR_NORETURN; @@ -66,7 +66,7 @@ Index: gdb-6.8.50.20081128/gdb/target.c static int return_zero (void); -@@ -299,7 +299,7 @@ void target_create_inferior (char *exec_ +@@ -294,7 +294,7 @@ target_create_inferior (char *exec_file, } @@ -75,7 +75,7 @@ Index: gdb-6.8.50.20081128/gdb/target.c nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write, struct target_ops *t) { -@@ -530,7 +530,7 @@ update_current_target (void) +@@ -522,7 +522,7 @@ update_current_target (void) (void (*) (struct regcache *)) noprocess); de_fault (deprecated_xfer_memory, @@ -84,7 +84,7 @@ Index: gdb-6.8.50.20081128/gdb/target.c nomemory); de_fault (to_files_info, (void (*) (struct target_ops *)) -@@ -1250,7 +1250,7 @@ target_xfer_partial (struct target_ops * +@@ -1252,7 +1252,7 @@ target_xfer_partial (struct target_ops * it makes no progress, and then return how much was transferred). */ int @@ -93,7 +93,7 @@ Index: gdb-6.8.50.20081128/gdb/target.c { if (target_read (¤t_target, TARGET_OBJECT_MEMORY, NULL, myaddr, memaddr, len) == len) -@@ -1260,7 +1260,7 @@ target_read_memory (CORE_ADDR memaddr, g +@@ -1262,7 +1262,7 @@ target_read_memory (CORE_ADDR memaddr, g } int @@ -102,7 +102,7 @@ Index: gdb-6.8.50.20081128/gdb/target.c { if (target_write (¤t_target, TARGET_OBJECT_MEMORY, NULL, myaddr, memaddr, len) == len) -@@ -2690,8 +2690,8 @@ debug_to_prepare_to_store (struct regcac +@@ -2723,8 +2723,8 @@ debug_to_prepare_to_store (struct regcac fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n"); } @@ -113,23 +113,22 @@ Index: gdb-6.8.50.20081128/gdb/target.c int write, struct mem_attrib *attrib, struct target_ops *target) { -@@ -2701,9 +2701,9 @@ deprecated_debug_xfer_memory (CORE_ADDR +@@ -2734,8 +2734,8 @@ deprecated_debug_xfer_memory (CORE_ADDR attrib, target); fprintf_unfiltered (gdb_stdlog, -- "target_xfer_memory (0x%x, xxx, %d, %s, xxx) = %d", -+ "target_xfer_memory (0x%x, xxx, %ld, %s, xxx) = %d", - (unsigned int) memaddr, /* possable truncate long long */ -- len, write ? "write" : "read", retval); -+ (long)len, write ? "write" : "read", retval); +- "target_xfer_memory (%s, xxx, %d, %s, xxx) = %d", +- paddress (memaddr), len, write ? "write" : "read", ++ "target_xfer_memory (%s, xxx, %ld, %s, xxx) = %d", ++ paddress (memaddr), (long) len, write ? "write" : "read", + retval); if (retval > 0) - { -Index: gdb-6.8.50.20081128/gdb/target.h +Index: gdb-6.8.50.20090209/gdb/target.h =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/target.h 2008-11-09 12:27:18.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/target.h 2008-12-02 22:15:53.000000000 +0100 -@@ -358,10 +358,10 @@ struct target_ops +--- gdb-6.8.50.20090209.orig/gdb/target.h 2009-02-06 23:59:01.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/target.h 2009-02-09 15:49:25.000000000 +0100 +@@ -360,10 +360,10 @@ struct target_ops NOTE: cagney/2004-10-01: This has been entirely superseeded by to_xfer_partial and inferior inheritance. */ @@ -144,7 +143,7 @@ Index: gdb-6.8.50.20081128/gdb/target.h void (*to_files_info) (struct target_ops *); int (*to_insert_breakpoint) (struct bp_target_info *); -@@ -661,13 +661,14 @@ extern DCACHE *target_dcache; +@@ -663,13 +663,14 @@ extern DCACHE *target_dcache; extern int target_read_string (CORE_ADDR, char **, int, int *); @@ -163,10 +162,10 @@ Index: gdb-6.8.50.20081128/gdb/target.h /* 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.20081128/gdb/dcache.c +Index: gdb-6.8.50.20090209/gdb/dcache.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/dcache.c 2008-09-23 20:35:29.000000000 +0200 -+++ gdb-6.8.50.20081128/gdb/dcache.c 2008-12-02 22:15:53.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/dcache.c 2009-01-03 06:57:51.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/dcache.c 2009-02-09 15:49:25.000000000 +0100 @@ -524,9 +524,9 @@ dcache_free (DCACHE *dcache) This routine is indended to be called by remote_xfer_ functions. */ @@ -179,10 +178,10 @@ Index: gdb-6.8.50.20081128/gdb/dcache.c { int i; int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr); -Index: gdb-6.8.50.20081128/gdb/dcache.h +Index: gdb-6.8.50.20090209/gdb/dcache.h =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/dcache.h 2008-01-01 23:53:09.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/dcache.h 2008-12-02 22:15:53.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/dcache.h 2009-01-03 06:57:51.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/dcache.h 2009-02-09 15:49:25.000000000 +0100 @@ -35,7 +35,7 @@ void dcache_free (DCACHE *); /* Simple to call from _xfer_memory */ @@ -193,11 +192,11 @@ Index: gdb-6.8.50.20081128/gdb/dcache.h + LONGEST len, int should_write); #endif /* DCACHE_H */ -Index: gdb-6.8.50.20081128/gdb/exec.c +Index: gdb-6.8.50.20090209/gdb/exec.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/exec.c 2008-10-30 19:42:28.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/exec.c 2008-12-02 22:15:53.000000000 +0100 -@@ -459,8 +459,8 @@ map_vmap (bfd *abfd, bfd *arch) +--- gdb-6.8.50.20090209.orig/gdb/exec.c 2009-01-08 17:32:29.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/exec.c 2009-02-09 15:49:25.000000000 +0100 +@@ -466,8 +466,8 @@ map_vmap (bfd *abfd, bfd *arch) The same routine is used to handle both core and exec files; we just tail-call it with more arguments to select between them. */ @@ -208,11 +207,11 @@ Index: gdb-6.8.50.20081128/gdb/exec.c struct mem_attrib *attrib, struct target_ops *target) { int res; -Index: gdb-6.8.50.20081128/gdb/linux-nat.c +Index: gdb-6.8.50.20090209/gdb/linux-nat.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/linux-nat.c 2008-12-02 21:11:11.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/linux-nat.c 2008-12-02 22:15:53.000000000 +0100 -@@ -4053,7 +4053,7 @@ linux_xfer_partial (struct target_ops *o +--- gdb-6.8.50.20090209.orig/gdb/linux-nat.c 2009-02-09 15:48:46.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/linux-nat.c 2009-02-09 15:49:25.000000000 +0100 +@@ -4283,7 +4283,7 @@ linux_xfer_partial (struct target_ops *o Revert when Bugzilla 147436 is fixed. */ if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL) { /* This region contains ia64 rse registers, we have to re-read. */ @@ -221,10 +220,10 @@ Index: gdb-6.8.50.20081128/gdb/linux-nat.c /* Re-read register stack area. */ xxfer = super_xfer_partial (ops, object, annex, -Index: gdb-6.8.50.20081128/gdb/remote.c +Index: gdb-6.8.50.20090209/gdb/remote.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/remote.c 2008-11-24 17:53:44.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/remote.c 2008-12-02 22:17:00.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/remote.c 2009-02-06 23:59:00.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/remote.c 2009-02-09 15:49:25.000000000 +0100 @@ -25,6 +25,7 @@ #include "gdb_string.h" #include @@ -233,7 +232,7 @@ Index: gdb-6.8.50.20081128/gdb/remote.c #include "inferior.h" #include "bfd.h" #include "symfile.h" -@@ -5687,12 +5688,19 @@ handle_notification (char *buf, size_t l +@@ -5688,12 +5689,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. */ @@ -255,7 +254,7 @@ Index: gdb-6.8.50.20081128/gdb/remote.c set_general_thread (inferior_ptid); -@@ -5701,7 +5709,7 @@ remote_xfer_memory (CORE_ADDR mem_addr, +@@ -5702,7 +5710,7 @@ remote_xfer_memory (CORE_ADDR mem_addr, else res = remote_read_bytes (mem_addr, buffer, mem_len); @@ -264,11 +263,11 @@ Index: gdb-6.8.50.20081128/gdb/remote.c } /* Sends a packet with content determined by the printf format string -Index: gdb-6.8.50.20081128/gdb/remote-sim.c +Index: gdb-6.8.50.20090209/gdb/remote-sim.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/remote-sim.c 2008-11-13 02:26:43.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/remote-sim.c 2008-12-02 22:15:53.000000000 +0100 -@@ -763,11 +763,14 @@ gdbsim_prepare_to_store (struct regcache +--- gdb-6.8.50.20090209.orig/gdb/remote-sim.c 2009-02-06 23:21:26.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/remote-sim.c 2009-02-09 15:49:25.000000000 +0100 +@@ -757,11 +757,14 @@ gdbsim_prepare_to_store (struct regcache Returns the number of bytes transferred. */ @@ -285,7 +284,7 @@ Index: gdb-6.8.50.20081128/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. */ -@@ -783,22 +786,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m +@@ -777,22 +780,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x"); gdb_print_host_address (myaddr, gdb_stdout); printf_filtered (", memaddr 0x%s, len %d, write %d\n", diff --git a/gdb-6.3-pie-20050110.patch b/gdb-6.3-pie-20050110.patch index e18b462..0b15498 100644 --- a/gdb-6.3-pie-20050110.patch +++ b/gdb-6.3-pie-20050110.patch @@ -26,11 +26,11 @@ Fix scan_dyntag() for binaries provided by valgrind (BZ 460319). -Index: gdb-6.8.50.20081209/gdb/amd64-tdep.c +Index: gdb-6.8.50.20090209/gdb/amd64-tdep.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/amd64-tdep.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/amd64-tdep.c 2008-12-14 14:56:49.000000000 +0100 -@@ -34,6 +34,7 @@ +--- gdb-6.8.50.20090209.orig/gdb/amd64-tdep.c 2009-02-09 16:02:28.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/amd64-tdep.c 2009-02-09 16:21:55.000000000 +0100 +@@ -36,6 +36,7 @@ #include "regcache.h" #include "regset.h" #include "symfile.h" @@ -38,7 +38,7 @@ Index: gdb-6.8.50.20081209/gdb/amd64-tdep.c #include "gdb_assert.h" -@@ -906,16 +907,28 @@ amd64_analyze_stack_align (CORE_ADDR pc, +@@ -1597,16 +1598,28 @@ amd64_analyze_stack_align (CORE_ADDR pc, Any function that doesn't start with this sequence will be assumed to have no prologue and thus no valid frame pointer in %rbp. */ @@ -71,7 +71,7 @@ Index: gdb-6.8.50.20081209/gdb/amd64-tdep.c pc = amd64_analyze_stack_align (pc, current_pc, cache); -@@ -930,18 +943,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO +@@ -1621,18 +1634,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO /* If that's all, return now. */ if (current_pc <= pc + 1) @@ -132,11 +132,11 @@ Index: gdb-6.8.50.20081209/gdb/amd64-tdep.c return pc; } -Index: gdb-6.8.50.20081209/gdb/auxv.c +Index: gdb-6.8.50.20090209/gdb/auxv.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/auxv.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/auxv.c 2008-12-14 14:57:58.000000000 +0100 -@@ -80,7 +80,7 @@ procfs_xfer_auxv (struct target_ops *ops +--- gdb-6.8.50.20090209.orig/gdb/auxv.c 2009-01-03 06:57:50.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/auxv.c 2009-02-09 16:21:55.000000000 +0100 +@@ -81,7 +81,7 @@ procfs_xfer_auxv (struct target_ops *ops Return 1 if an entry was read into *TYPEP and *VALP. */ int default_auxv_parse (struct target_ops *ops, gdb_byte **readptr, @@ -145,7 +145,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c { const int sizeof_auxv_field = gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT; -@@ -107,7 +107,7 @@ default_auxv_parse (struct target_ops *o +@@ -108,7 +108,7 @@ default_auxv_parse (struct target_ops *o Return 1 if an entry was read into *TYPEP and *VALP. */ int target_auxv_parse (struct target_ops *ops, gdb_byte **readptr, @@ -154,7 +154,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c { struct target_ops *t; for (t = ops; t != NULL; t = t->beneath) -@@ -122,9 +122,10 @@ target_auxv_parse (struct target_ops *op +@@ -123,9 +123,10 @@ target_auxv_parse (struct target_ops *op an error getting the information. On success, return 1 after storing the entry's value field in *VALP. */ int @@ -167,7 +167,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c gdb_byte *data; LONGEST n = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data); gdb_byte *ptr = data; -@@ -134,10 +135,10 @@ target_auxv_search (struct target_ops *o +@@ -135,10 +136,10 @@ target_auxv_search (struct target_ops *o return n; while (1) @@ -180,7 +180,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c { xfree (data); *valp = val; -@@ -160,7 +161,8 @@ target_auxv_search (struct target_ops *o +@@ -161,7 +162,8 @@ target_auxv_search (struct target_ops *o int fprint_target_auxv (struct ui_file *file, struct target_ops *ops) { @@ -190,7 +190,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c gdb_byte *data; LONGEST len = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data); -@@ -170,13 +172,13 @@ fprint_target_auxv (struct ui_file *file +@@ -171,13 +173,13 @@ fprint_target_auxv (struct ui_file *file if (len <= 0) return len; @@ -206,7 +206,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c { #define TAG(tag, text, kind) \ case tag: name = #tag; description = text; flavor = kind; break -@@ -231,7 +233,7 @@ fprint_target_auxv (struct ui_file *file +@@ -232,7 +234,7 @@ fprint_target_auxv (struct ui_file *file } fprintf_filtered (file, "%-4s %-20s %-30s ", @@ -215,7 +215,7 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c switch (flavor) { case dec: -@@ -252,7 +254,7 @@ fprint_target_auxv (struct ui_file *file +@@ -253,7 +255,7 @@ fprint_target_auxv (struct ui_file *file break; } ++ents; @@ -224,11 +224,11 @@ Index: gdb-6.8.50.20081209/gdb/auxv.c break; } -Index: gdb-6.8.50.20081209/gdb/auxv.h +Index: gdb-6.8.50.20090209/gdb/auxv.h =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/auxv.h 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/auxv.h 2008-12-14 14:56:49.000000000 +0100 -@@ -35,14 +35,14 @@ struct target_ops; /* Forward declarati +--- gdb-6.8.50.20090209.orig/gdb/auxv.h 2009-01-03 06:57:50.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/auxv.h 2009-02-09 16:21:55.000000000 +0100 +@@ -36,14 +36,14 @@ struct target_ops; /* Forward declarati Return 1 if an entry was read into *TYPEP and *VALP. */ extern int target_auxv_parse (struct target_ops *ops, gdb_byte **readptr, gdb_byte *endptr, @@ -245,11 +245,11 @@ Index: gdb-6.8.50.20081209/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.20081209/gdb/breakpoint.c +Index: gdb-6.8.50.20090209/gdb/breakpoint.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/breakpoint.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/breakpoint.c 2008-12-14 14:56:49.000000000 +0100 -@@ -3861,7 +3861,8 @@ describe_other_breakpoints (CORE_ADDR pc +--- gdb-6.8.50.20090209.orig/gdb/breakpoint.c 2009-02-09 16:12:23.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/breakpoint.c 2009-02-09 16:21:55.000000000 +0100 +@@ -3894,7 +3894,8 @@ describe_other_breakpoints (CORE_ADDR pc printf_filtered (" (thread %d)", b->thread); printf_filtered ("%s%s ", ((b->enable_state == bp_disabled || @@ -259,7 +259,7 @@ Index: gdb-6.8.50.20081209/gdb/breakpoint.c ? " (disabled)" : b->enable_state == bp_permanent ? " (permanent)" -@@ -4692,6 +4693,61 @@ create_catchpoint (int tempflag, char *c +@@ -4725,6 +4726,61 @@ create_catchpoint (int tempflag, char *c return b; } @@ -321,10 +321,10 @@ Index: gdb-6.8.50.20081209/gdb/breakpoint.c static void create_fork_vfork_event_catchpoint (int tempflag, char *cond_string, struct breakpoint_ops *ops) -Index: gdb-6.8.50.20081209/gdb/breakpoint.h +Index: gdb-6.8.50.20090209/gdb/breakpoint.h =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/breakpoint.h 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/breakpoint.h 2008-12-14 14:56:49.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/breakpoint.h 2009-01-30 19:28:00.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/breakpoint.h 2009-02-09 16:21:55.000000000 +0100 @@ -126,6 +126,7 @@ enum enable_state automatically enabled and reset when the call "lands" (either completes, or stops at another @@ -333,7 +333,7 @@ Index: gdb-6.8.50.20081209/gdb/breakpoint.h bp_permanent /* There is a breakpoint instruction hard-wired into the target's code. Don't try to write another breakpoint instruction on top of it, or restore -@@ -818,6 +819,10 @@ extern void remove_thread_event_breakpoi +@@ -819,6 +820,10 @@ extern void remove_thread_event_breakpoi extern void disable_breakpoints_in_shlibs (void); @@ -344,11 +344,11 @@ Index: gdb-6.8.50.20081209/gdb/breakpoint.h /* This function returns TRUE if ep is a catchpoint. */ extern int ep_is_catchpoint (struct breakpoint *); -Index: gdb-6.8.50.20081209/gdb/dwarf2read.c +Index: gdb-6.8.50.20090209/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/dwarf2read.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/dwarf2read.c 2008-12-14 14:56:49.000000000 +0100 -@@ -1295,7 +1295,7 @@ dwarf2_build_psymtabs (struct objfile *o +--- gdb-6.8.50.20090209.orig/gdb/dwarf2read.c 2009-02-09 16:12:23.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/dwarf2read.c 2009-02-09 16:21:55.000000000 +0100 +@@ -1296,7 +1296,7 @@ dwarf2_build_psymtabs (struct objfile *o else dwarf2_per_objfile->loc_buffer = NULL; @@ -357,10 +357,10 @@ Index: gdb-6.8.50.20081209/gdb/dwarf2read.c || (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)) { -Index: gdb-6.8.50.20081209/gdb/elfread.c +Index: gdb-6.8.50.20090209/gdb/elfread.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/elfread.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/elfread.c 2008-12-14 14:56:49.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/elfread.c 2009-01-03 06:57:51.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/elfread.c 2009-02-09 16:21:55.000000000 +0100 @@ -680,7 +680,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 @@ -370,11 +370,11 @@ Index: gdb-6.8.50.20081209/gdb/elfread.c { init_psymbol_list (objfile, 0); mainline = 0; -Index: gdb-6.8.50.20081209/gdb/infrun.c +Index: gdb-6.8.50.20090209/gdb/infrun.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/infrun.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/infrun.c 2008-12-14 14:56:49.000000000 +0100 -@@ -3229,6 +3229,11 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( +--- gdb-6.8.50.20090209.orig/gdb/infrun.c 2009-02-09 16:12:23.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/infrun.c 2009-02-09 16:21:55.000000000 +0100 +@@ -3278,6 +3278,11 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( #endif target_terminal_inferior (); @@ -386,10 +386,10 @@ Index: gdb-6.8.50.20081209/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.20081209/gdb/objfiles.c +Index: gdb-6.8.50.20090209/gdb/objfiles.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/objfiles.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/objfiles.c 2008-12-14 14:56:49.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/objfiles.c 2009-01-15 17:35:22.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/objfiles.c 2009-02-09 16:21:55.000000000 +0100 @@ -51,6 +51,9 @@ #include "arch-utils.h" #include "exec.h" @@ -421,11 +421,21 @@ Index: gdb-6.8.50.20081209/gdb/objfiles.c } /* Create the terminating entry of OBJFILE's minimal symbol table. -Index: gdb-6.8.50.20081209/gdb/solib-svr4.c +@@ -458,6 +458,9 @@ free_objfile (struct objfile *objfile) + if (objfile == rt_common_objfile) + rt_common_objfile = NULL; + ++ if (objfile == symfile_objfile) ++ symfile_objfile = NULL; ++ + /* 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.20090209/gdb/solib-svr4.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/solib-svr4.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/solib-svr4.c 2008-12-14 14:56:49.000000000 +0100 -@@ -44,6 +44,7 @@ +--- gdb-6.8.50.20090209.orig/gdb/solib-svr4.c 2009-02-09 16:02:35.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/solib-svr4.c 2009-02-09 16:21:55.000000000 +0100 +@@ -45,6 +45,7 @@ #include "exec.h" #include "auxv.h" #include "exceptions.h" @@ -433,7 +443,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c static struct link_map_offsets *svr4_fetch_link_map_offsets (void); static int svr4_have_link_map_offsets (void); -@@ -286,7 +287,9 @@ static CORE_ADDR main_lm_addr; +@@ -287,7 +288,9 @@ static CORE_ADDR main_lm_addr; /* Local function prototypes */ @@ -443,7 +453,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c static CORE_ADDR bfd_lookup_symbol (bfd *, char *); -@@ -520,10 +523,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE +@@ -521,10 +524,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE int arch_size, step, sect_size; long dyn_tag; CORE_ADDR dyn_ptr, dyn_addr; @@ -456,7 +466,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c if (abfd == NULL) return 0; -@@ -531,19 +536,81 @@ scan_dyntag (int dyntag, bfd *abfd, CORE +@@ -532,19 +537,81 @@ scan_dyntag (int dyntag, bfd *abfd, CORE if (arch_size == -1) return 0; @@ -540,7 +550,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c /* Iterate over BUF and scan for DYNTAG. If found, set PTR and return. */ step = (arch_size == 32) ? sizeof (Elf32_External_Dyn) -@@ -564,26 +631,105 @@ scan_dyntag (int dyntag, bfd *abfd, CORE +@@ -565,26 +632,105 @@ scan_dyntag (int dyntag, bfd *abfd, CORE dyn_tag = bfd_h_get_64 (abfd, (bfd_byte *) x_dynp_64->d_tag); dyn_ptr = bfd_h_get_64 (abfd, (bfd_byte *) x_dynp_64->d_un.d_ptr); } @@ -665,7 +675,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c } return 0; -@@ -773,6 +919,10 @@ solib_svr4_r_map (void) +@@ -774,6 +920,10 @@ solib_svr4_r_map (void) struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; @@ -676,7 +686,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c return read_memory_typed_address (debug_base + lmo->r_map_offset, ptr_type); } -@@ -944,6 +1094,11 @@ svr4_current_sos (void) +@@ -945,6 +1095,11 @@ svr4_current_sos (void) struct so_list *head = 0; struct so_list **link_ptr = &head; CORE_ADDR ldsomap = 0; @@ -688,7 +698,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c /* Always locate the debug struct, in case it has moved. */ debug_base = 0; -@@ -952,10 +1107,19 @@ svr4_current_sos (void) +@@ -953,10 +1108,19 @@ svr4_current_sos (void) /* If we can't find the dynamic linker's base structure, this must not be a dynamically linked executable. Hmm. */ if (! debug_base) @@ -709,7 +719,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c lm = solib_svr4_r_map (); while (lm) -@@ -972,26 +1136,104 @@ svr4_current_sos (void) +@@ -973,26 +1137,104 @@ svr4_current_sos (void) new->lm_info->lm = xzalloc (lmo->link_map_size); make_cleanup (xfree, new->lm_info->lm); @@ -818,7 +828,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c target_read_string (LM_NAME (new), &buffer, SO_NAME_MAX_PATH_SIZE - 1, &errcode); if (errcode != 0) -@@ -999,47 +1241,60 @@ svr4_current_sos (void) +@@ -1000,47 +1242,60 @@ svr4_current_sos (void) safe_strerror (errcode)); else { @@ -912,7 +922,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c } /* On Solaris, the dynamic linker is not in the normal list of -@@ -1055,6 +1310,9 @@ svr4_current_sos (void) +@@ -1056,6 +1311,9 @@ svr4_current_sos (void) if (head == NULL) return svr4_default_sos (); @@ -922,7 +932,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c return head; } -@@ -1086,7 +1344,7 @@ svr4_fetch_objfile_link_map (struct objf +@@ -1087,7 +1345,7 @@ svr4_fetch_objfile_link_map (struct objf /* On some systems, the only way to recognize the link map entry for the main executable file is by looking at its name. Return non-zero iff SONAME matches one of the known main executable names. */ @@ -931,7 +941,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c static int match_main (char *soname) { -@@ -1100,6 +1358,7 @@ match_main (char *soname) +@@ -1101,6 +1359,7 @@ match_main (char *soname) return (0); } @@ -939,7 +949,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c /* Return 1 if PC lies in the dynamic symbol resolution code of the SVR4 run time loader. */ -@@ -1250,15 +1509,29 @@ enable_break (void) +@@ -1251,15 +1510,29 @@ enable_break (void) /* Find the program interpreter; if not found, warn the user and drop into the old breakpoint at symbol code. */ interp_name = find_program_interpreter (); @@ -969,7 +979,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c sym_addr = 0; -@@ -1275,6 +1548,9 @@ enable_break (void) +@@ -1276,6 +1549,9 @@ enable_break (void) { tmp_bfd = solib_bfd_open (interp_name); } @@ -979,7 +989,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c if (tmp_bfd == NULL) goto bkpt_at_symbol; -@@ -1328,16 +1604,16 @@ enable_break (void) +@@ -1329,16 +1605,16 @@ enable_break (void) interp_sect = bfd_get_section_by_name (tmp_bfd, ".text"); if (interp_sect) { @@ -1000,7 +1010,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c interp_plt_sect_high = interp_plt_sect_low + bfd_section_size (tmp_bfd, interp_sect); } -@@ -1372,7 +1648,11 @@ enable_break (void) +@@ -1373,7 +1649,11 @@ enable_break (void) if (sym_addr != 0) { @@ -1013,7 +1023,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c xfree (interp_name); return 1; } -@@ -1638,6 +1918,8 @@ svr4_solib_create_inferior_hook (void) +@@ -1639,6 +1919,8 @@ svr4_solib_create_inferior_hook (void) while (tp->stop_signal != TARGET_SIGNAL_TRAP); inf->stop_soon = NO_STOP_QUIETLY; #endif /* defined(_SCO_DS) */ @@ -1022,7 +1032,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c } static void -@@ -1819,6 +2101,75 @@ svr4_lp64_fetch_link_map_offsets (void) +@@ -1820,6 +2102,75 @@ svr4_lp64_fetch_link_map_offsets (void) return lmp; } @@ -1098,7 +1108,7 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c struct target_so_ops svr4_so_ops; -@@ -1858,4 +2209,7 @@ _initialize_svr4_solib (void) +@@ -1859,4 +2210,7 @@ _initialize_svr4_solib (void) svr4_so_ops.in_dynsym_resolve_code = svr4_in_dynsym_resolve_code; svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol; svr4_so_ops.same = svr4_same; @@ -1106,10 +1116,10 @@ Index: gdb-6.8.50.20081209/gdb/solib-svr4.c + add_info ("linkmap", info_linkmap_command, + "Display the inferior's linkmap."); } -Index: gdb-6.8.50.20081209/gdb/solib.c +Index: gdb-6.8.50.20090209/gdb/solib.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/solib.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/solib.c 2008-12-14 14:56:49.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/solib.c 2009-01-15 17:35:22.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/solib.c 2009-02-09 16:26:02.000000000 +0100 @@ -80,6 +80,8 @@ set_solib_ops (struct gdbarch *gdbarch, /* external data declarations */ @@ -1128,67 +1138,79 @@ Index: gdb-6.8.50.20081209/gdb/solib.c /* GLOBAL FUNCTION -@@ -405,7 +409,6 @@ free_so (struct so_list *so) - xfree (so); - } - -- - /* Return address of first so_list entry in master shared object list. */ - struct so_list * - master_so_list (void) -@@ -413,7 +416,6 @@ master_so_list (void) - return so_list_head; - } - -- - /* A small stub to get us past the arg-passing pinhole of catch_errors. */ +@@ -425,10 +429,23 @@ free_so (struct so_list *so) + + if (so->abfd) + { +- bfd_filename = bfd_get_filename (so->abfd); +- if (! bfd_close (so->abfd)) +- warning (_("cannot close \"%s\": %s"), +- bfd_filename, bfd_errmsg (bfd_get_error ())); ++ struct objfile *objfile; ++ ++ ALL_OBJFILES (objfile) ++ if (objfile->obfd == so->abfd) ++ { ++ gdb_assert (objfile->flags & OBJF_KEEPBFD); ++ objfile->flags &= ~OBJF_KEEPBFD; ++ break; ++ } ++ ++ if (!objfile) ++ { ++ bfd_filename = bfd_get_filename (so->abfd); ++ if (! bfd_close (so->abfd)) ++ warning (_("cannot close \"%s\": %s"), ++ bfd_filename, bfd_errmsg (bfd_get_error ())); ++ } + } - static int -@@ -425,15 +427,40 @@ symbol_add_stub (void *arg) + if (bfd_filename) +@@ -459,15 +461,40 @@ symbol_add_stub (void *arg) /* Have we already loaded this shared object? */ ALL_OBJFILES (so->objfile) { - if (strcmp (so->objfile->name, so->so_name) == 0) + /* Found an already loaded shared library. */ + if (strcmp (so->objfile->name, so->so_name) == 0 -+ && !so->main) - return 1; ++ && !so->main) ++ return 1; + /* Found an already loaded main executable. This could happen in -+ two circumstances. -+ First case: the main file has already been read in -+ as the first thing that gdb does at startup, and the file -+ hasn't been relocated properly yet. Therefor we need to read -+ it in with the proper section info. -+ Second case: it has been read in with the correct relocation, -+ and therefore we need to skip it. */ ++ two circumstances. ++ First case: the main file has already been read in ++ as the first thing that gdb does at startup, and the file ++ hasn't been relocated properly yet. Therefor we need to read ++ it in with the proper section info. ++ Second case: it has been read in with the correct relocation, ++ and therefore we need to skip it. */ + if (strcmp (so->objfile->name, so->so_name) == 0 -+ && so->main -+ && so->main_relocated) -+ return 1; ++ && so->main ++ && so->main_relocated) + return 1; } sap = build_section_addr_info_from_section_table (so->sections, so->sections_end); -- so->objfile = symbol_file_add (so->so_name, so->from_tty, -- sap, 0, OBJF_SHARED); +- so->objfile = symbol_file_add_from_bfd (so->abfd, so->from_tty, +- sap, 0, OBJF_SHARED | OBJF_KEEPBFD); + if (so->main) + { + if (debug_solib) + fprintf_unfiltered (gdb_stdlog, + "symbol_add_stub: adding symbols for main\n"); -+ so->objfile = symbol_file_add (so->so_name, /*so->from_tty*/ 0, -+ sap, 1, 0); ++ so->objfile = symbol_file_add_from_bfd (so->abfd, /*so->from_tty*/ 0, ++ sap, 1, OBJF_KEEPBFD); + so->main_relocated = 1; + } + else -+ so->objfile = symbol_file_add (so->so_name, so->from_tty, -+ sap, 0, OBJF_SHARED); ++ so->objfile = symbol_file_add_from_bfd (so->abfd, so->from_tty, ++ sap, 0, OBJF_SHARED | OBJF_KEEPBFD); + free_section_addr_info (sap); return (1); -@@ -565,6 +592,10 @@ update_solib_list (int from_tty, struct +@@ -599,6 +626,10 @@ update_solib_list (int from_tty, struct } else { @@ -1199,7 +1221,7 @@ Index: gdb-6.8.50.20081209/gdb/solib.c if (! strcmp (gdb->so_original_name, i->so_original_name)) break; } -@@ -619,28 +650,7 @@ update_solib_list (int from_tty, struct +@@ -653,28 +684,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) { @@ -1229,7 +1251,7 @@ Index: gdb-6.8.50.20081209/gdb/solib.c /* Notify any observer that the shared object has been loaded now that we've added it to GDB's tables. */ -@@ -736,6 +746,41 @@ solib_add (char *pattern, int from_tty, +@@ -770,6 +780,41 @@ solib_add (char *pattern, int from_tty, } } @@ -1271,7 +1293,7 @@ Index: gdb-6.8.50.20081209/gdb/solib.c /* -@@ -1053,4 +1098,12 @@ This takes precedence over the environme +@@ -1087,4 +1132,12 @@ This takes precedence over the environme reload_shared_libraries, show_solib_search_path, &setlist, &showlist); @@ -1284,10 +1306,10 @@ Index: gdb-6.8.50.20081209/gdb/solib.c + NULL, NULL, + &setdebuglist, &showdebuglist); } -Index: gdb-6.8.50.20081209/gdb/solist.h +Index: gdb-6.8.50.20090209/gdb/solist.h =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/solist.h 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/solist.h 2008-12-14 14:56:49.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/solist.h 2009-02-04 09:42:11.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/solist.h 2009-02-09 16:21:55.000000000 +0100 @@ -61,6 +61,8 @@ struct so_list bfd *abfd; char symbols_loaded; /* flag: symbols read in yet? */ @@ -1297,7 +1319,7 @@ Index: gdb-6.8.50.20081209/gdb/solist.h struct objfile *objfile; /* objfile for loaded lib */ struct section_table *sections; struct section_table *sections_end; -@@ -138,4 +140,10 @@ struct symbol *solib_global_lookup (cons +@@ -149,4 +151,10 @@ struct symbol *solib_global_lookup (cons const char *linkage_name, const domain_enum domain); @@ -1308,10 +1330,10 @@ Index: gdb-6.8.50.20081209/gdb/solist.h +extern int debug_solib; + #endif -Index: gdb-6.8.50.20081209/gdb/symfile-mem.c +Index: gdb-6.8.50.20090209/gdb/symfile-mem.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/symfile-mem.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/symfile-mem.c 2008-12-14 14:56:49.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/symfile-mem.c 2009-02-09 15:49:25.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/symfile-mem.c 2009-02-09 16:21:55.000000000 +0100 @@ -116,7 +116,7 @@ symbol_file_add_from_memory (struct bfd } @@ -1321,10 +1343,10 @@ Index: gdb-6.8.50.20081209/gdb/symfile-mem.c /* This might change our ideas about frames already looked at. */ reinit_frame_cache (); -Index: gdb-6.8.50.20081209/gdb/symfile.c +Index: gdb-6.8.50.20090209/gdb/symfile.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/symfile.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/symfile.c 2008-12-14 14:56:49.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/symfile.c 2009-02-09 16:03:45.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/symfile.c 2009-02-09 16:21:55.000000000 +0100 @@ -47,6 +47,7 @@ #include "readline/readline.h" #include "gdb_assert.h" @@ -1351,7 +1373,7 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c { asection *lower_sect; asection *sect; -@@ -916,17 +917,21 @@ new_symfile_objfile (struct objfile *obj +@@ -917,17 +918,21 @@ 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. */ @@ -1375,7 +1397,7 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c /* We're done reading the symbol file; finish off complaints. */ clear_complaints (&symfile_complaints, 0, verbo); -@@ -969,7 +974,7 @@ symbol_file_add_with_addrs_or_offsets (b +@@ -970,7 +975,7 @@ symbol_file_add_with_addrs_or_offsets (b interactively wiping out any existing symbols. */ if ((have_full_symbols () || have_partial_symbols ()) @@ -1384,7 +1406,7 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c && from_tty && !query ("Load new symbol table from \"%s\"? ", name)) error (_("Not confirmed.")); -@@ -1160,6 +1165,10 @@ symbol_file_clear (int from_tty) +@@ -1161,6 +1166,10 @@ symbol_file_clear (int from_tty) symfile_objfile->name) : !query (_("Discard symbol table? ")))) error (_("Not confirmed.")); @@ -1395,7 +1417,7 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c free_all_objfiles (); /* solib descriptors may have handles to objfiles. Since their -@@ -3259,6 +3268,8 @@ reread_symbols (void) +@@ -3260,6 +3269,8 @@ reread_symbols (void) /* Discard cleanups as symbol reading was successful. */ discard_cleanups (old_cleanups); @@ -1404,7 +1426,7 @@ Index: gdb-6.8.50.20081209/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. */ -@@ -3628,6 +3639,7 @@ clear_symtab_users (void) +@@ -3629,6 +3640,7 @@ clear_symtab_users (void) breakpoint_re_set (); set_default_breakpoint (0, 0, 0, 0); clear_pc_function_cache (); @@ -1412,11 +1434,11 @@ Index: gdb-6.8.50.20081209/gdb/symfile.c observer_notify_new_objfile (NULL); /* Clear globals which might have pointed into a removed objfile. -Index: gdb-6.8.50.20081209/gdb/varobj.c +Index: gdb-6.8.50.20090209/gdb/varobj.c =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/varobj.c 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/varobj.c 2008-12-14 14:56:49.000000000 +0100 -@@ -1116,6 +1116,62 @@ install_new_value (struct varobj *var, s +--- gdb-6.8.50.20090209.orig/gdb/varobj.c 2009-02-05 18:28:21.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/varobj.c 2009-02-09 16:21:55.000000000 +0100 +@@ -1123,6 +1123,62 @@ install_new_value (struct varobj *var, s return changed; } @@ -1479,10 +1501,10 @@ Index: gdb-6.8.50.20081209/gdb/varobj.c /* Update the values for a variable and its children. This is a two-pronged attack. First, re-parse the value for the root's expression to see if it's changed. Then go all the way -Index: gdb-6.8.50.20081209/gdb/varobj.h +Index: gdb-6.8.50.20090209/gdb/varobj.h =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/varobj.h 2008-12-14 14:55:58.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/varobj.h 2008-12-14 14:56:49.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/varobj.h 2009-01-03 06:57:54.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/varobj.h 2009-02-09 16:21:55.000000000 +0100 @@ -141,4 +141,6 @@ extern int varobj_editable_p (struct var extern int varobj_floating_p (struct varobj *var); @@ -1490,10 +1512,10 @@ Index: gdb-6.8.50.20081209/gdb/varobj.h +extern void varobj_refresh(void); + #endif /* VAROBJ_H */ -Index: gdb-6.8.50.20081209/gdb/target.h +Index: gdb-6.8.50.20090209/gdb/target.h =================================================================== ---- gdb-6.8.50.20081209.orig/gdb/target.h 2008-12-14 11:52:54.000000000 +0100 -+++ gdb-6.8.50.20081209/gdb/target.h 2008-12-14 14:57:21.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/target.h 2009-02-09 16:02:42.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/target.h 2009-02-09 16:21:55.000000000 +0100 @@ -524,7 +524,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. */ diff --git a/gdb-6.3-security-errata-20050610.patch b/gdb-6.3-security-errata-20050610.patch index 07544ad..b86973d 100644 --- a/gdb-6.3-security-errata-20050610.patch +++ b/gdb-6.3-security-errata-20050610.patch @@ -19,10 +19,10 @@ Proposed upstream but never committed upstream. (source_command): Update documentation. Check permissions if FROM_TTY is -1. -Index: gdb-6.8.50.20081128/gdb/cli/cli-cmds.c +Index: gdb-6.8.50.20090209/gdb/cli/cli-cmds.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/cli/cli-cmds.c 2008-12-07 10:12:24.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/cli/cli-cmds.c 2008-12-07 13:04:06.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/cli/cli-cmds.c 2009-01-14 21:40:07.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/cli/cli-cmds.c 2009-02-09 15:45:39.000000000 +0100 @@ -36,6 +36,7 @@ #include "objfiles.h" #include "source.h" @@ -31,7 +31,7 @@ Index: gdb-6.8.50.20081128/gdb/cli/cli-cmds.c #include "ui-out.h" -@@ -460,7 +461,7 @@ source_script (char *file, int from_tty) +@@ -462,7 +463,7 @@ source_script (char *file, int from_tty) if (fd == -1) { @@ -40,7 +40,7 @@ Index: gdb-6.8.50.20081128/gdb/cli/cli-cmds.c perror_with_name (file); else { -@@ -469,9 +470,33 @@ source_script (char *file, int from_tty) +@@ -471,9 +472,33 @@ source_script (char *file, int from_tty) } } @@ -74,10 +74,10 @@ Index: gdb-6.8.50.20081128/gdb/cli/cli-cmds.c do_cleanups (old_cleanups); } -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/gdbinit.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.base/gdbinit.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/gdbinit.exp 2008-12-07 10:13:01.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/gdbinit.exp 2009-02-09 15:45:39.000000000 +0100 @@ -0,0 +1,98 @@ +# Copyright 2005 +# Free Software Foundation, Inc. @@ -177,31 +177,31 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/gdbinit.exp +} + +remote_exec build "rm .gdbinit" -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/gdbinit.sample +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.base/gdbinit.sample =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/gdbinit.sample 2008-12-07 10:13:01.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/gdbinit.sample 2009-02-09 15:45:39.000000000 +0100 @@ -0,0 +1 @@ +echo "\nin gdbinit" -Index: gdb-6.8.50.20081128/gdb/main.c +Index: gdb-6.8.50.20090209/gdb/main.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/main.c 2008-12-07 10:12:24.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/main.c 2008-12-07 12:58:37.000000000 +0100 -@@ -690,7 +690,7 @@ Excess command line arguments ignored. ( +--- gdb-6.8.50.20090209.orig/gdb/main.c 2009-01-28 16:01:00.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/main.c 2009-02-09 15:46:33.000000000 +0100 +@@ -783,7 +783,7 @@ Excess command line arguments ignored. ( + debugging or what directory you are in. */ - if (!inhibit_gdbinit) - { -- catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL); -+ catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL); - } + if (home_gdbinit && !inhibit_gdbinit) +- catch_command_errors (source_script, home_gdbinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, home_gdbinit, -1, RETURN_MASK_ALL); - /* Do stats; no need to do them elsewhere since we'll only -@@ -778,7 +778,7 @@ Can't attach to process and specify a co - || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) - if (!inhibit_gdbinit) - { -- catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL); -+ catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL); - } + /* Now perform all the actions indicated by the arguments. */ + if (cdarg != NULL) +@@ -852,7 +852,7 @@ Can't attach to process and specify a co + /* Read the .gdbinit file in the current directory, *if* it isn't + the same as the $HOME/.gdbinit file (it should exist, also). */ + if (local_gdbinit && !inhibit_gdbinit) +- catch_command_errors (source_script, local_gdbinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, local_gdbinit, -1, RETURN_MASK_ALL); for (i = 0; i < ncmd; i++) + { diff --git a/gdb-6.3-warnings-20050317.patch b/gdb-6.3-warnings-20050317.patch deleted file mode 100644 index 0504da7..0000000 --- a/gdb-6.3-warnings-20050317.patch +++ /dev/null @@ -1,234 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2008-12/msg00243.html - - Check return values of functions declared with warn_unused_result - attribute in GLIBC 2.8. - * cli/cli-cmds.c (pwd_command): Check return value from getcwd. - * inflow.c (check_syscall): New function. - (new_tty): Use check_syscall to check return values from open and dup. - * linux-nat.c (linux_nat_info_proc_cmd): Check return value from fgets. - * main.c (captured_main): Call cwd after setting up gdb_stderr; - check for errors from getcwd. - * mi/mi-cmd-env.c (mi_cmd_env_pwd): Check return value from getcwd. - * ui-file.c (stdio_file_write): Check return value from fwrite. - (stdio_file_fputs): Check return value from fputs. - * utils.c (internal_vproblem): abort if last-ditch error message - write fails. - -[ +linespec.c: Fedora patch. ] -[ +top.c: Fedora patch. ] - -ui-file.c replaced by: -http://sourceware.org/ml/gdb-patches/2008-12/msg00260.html - ---- - gdb/ChangeLog | 14 ++++++++++++++ - gdb/cli/cli-cmds.c | 4 +++- - gdb/inflow.c | 22 ++++++++++++++-------- - gdb/linux-nat.c | 6 ++++-- - gdb/main.c | 12 +++++++++--- - gdb/mi/mi-cmd-env.c | 5 ++++- - gdb/ui-file.c | 6 ++++-- - gdb/utils.c | 8 +++++++- - 8 files changed, 59 insertions(+), 18 deletions(-) - -diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c -index 806a68a..b80bdfc 100644 ---- a/gdb/cli/cli-cmds.c -+++ b/gdb/cli/cli-cmds.c -@@ -323,7 +323,9 @@ pwd_command (char *args, int from_tty) - { - if (args) - error (_("The \"pwd\" command does not take an argument: %s"), args); -- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); -+ if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) -+ error (_("Error finding name of working directory: %s"), -+ safe_strerror (errno)); - - if (strcmp (gdb_dirbuf, current_directory) != 0) - printf_unfiltered (_("Working directory %s\n (canonically %s).\n"), -diff --git a/gdb/inflow.c b/gdb/inflow.c -index e82514e..7ecb5ab 100644 ---- a/gdb/inflow.c -+++ b/gdb/inflow.c -@@ -523,6 +523,16 @@ new_tty_prefork (const char *ttyname) - inferior_thisrun_terminal = ttyname; - } - -+static void -+check_syscall (const char *msg, int result) -+{ -+ if (result < 0) -+ { -+ print_sys_errmsg (msg, errno); -+ _exit (1); -+ } -+} -+ - void - new_tty (void) - { -@@ -549,27 +559,23 @@ new_tty (void) - - /* Now open the specified new terminal. */ - tty = open (inferior_thisrun_terminal, O_RDWR | O_NOCTTY); -- if (tty == -1) -- { -- print_sys_errmsg (inferior_thisrun_terminal, errno); -- _exit (1); -- } -+ check_syscall (inferior_thisrun_terminal, tty); - - /* Avoid use of dup2; doesn't exist on all systems. */ - if (tty != 0) - { - close (0); -- dup (tty); -+ check_syscall ("dup'ing tty into fd 0", dup (tty)); - } - if (tty != 1) - { - close (1); -- dup (tty); -+ check_syscall ("dup'ing tty into fd 1", dup (tty)); - } - if (tty != 2) - { - close (2); -- dup (tty); -+ check_syscall ("dup'ing tty into fd 2", dup (tty)); - } - - #ifdef TIOCSCTTY -diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c -index 913bfec..a829eb8 100644 ---- a/gdb/linux-nat.c -+++ b/gdb/linux-nat.c -@@ -3666,8 +3666,10 @@ linux_nat_info_proc_cmd (char *args, int from_tty) - if ((procfile = fopen (fname1, "r")) != NULL) - { - struct cleanup *cleanup = make_cleanup_fclose (procfile); -- fgets (buffer, sizeof (buffer), procfile); -- printf_filtered ("cmdline = '%s'\n", buffer); -+ if (fgets (buffer, sizeof (buffer), procfile)) -+ printf_filtered ("cmdline = '%s'\n", buffer); -+ else -+ warning (_("unable to read '/proc/%lld/cmdline'"), pid); - do_cleanups (cleanup); - } - else -diff --git a/gdb/main.c b/gdb/main.c -index a53002d..a9fd988 100644 ---- a/gdb/main.c -+++ b/gdb/main.c -@@ -195,9 +195,6 @@ captured_main (void *data) - line[0] = '\0'; /* Terminate saved (now empty) cmd line */ - instream = stdin; - -- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); -- current_directory = gdb_dirbuf; -- - gdb_stdout = stdio_fileopen (stdout); - gdb_stderr = stdio_fileopen (stderr); - gdb_stdlog = gdb_stderr; /* for moment */ -@@ -206,6 +203,15 @@ captured_main (void *data) - gdb_stdtargerr = gdb_stderr; /* for moment */ - gdb_stdtargin = gdb_stdin; /* for moment */ - -+ if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) -+ /* Don't use *_filtered or warning() (which relies on -+ current_target) until after initialize_all_files(). */ -+ fprintf_unfiltered (gdb_stderr, -+ _("%s: warning: error finding working directory: %s\n"), -+ argv[0], safe_strerror (errno)); -+ -+ current_directory = gdb_dirbuf; -+ - /* Set the sysroot path. */ - #ifdef TARGET_SYSTEM_ROOT_RELOCATABLE - gdb_sysroot = make_relative_prefix (argv[0], BINDIR, TARGET_SYSTEM_ROOT); -diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c -index 327ddc5..0103153 100644 ---- a/gdb/mi/mi-cmd-env.c -+++ b/gdb/mi/mi-cmd-env.c -@@ -78,7 +78,10 @@ mi_cmd_env_pwd (char *command, char **argv, int argc) - - /* Otherwise the mi level is 2 or higher. */ - -- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); -+ if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) -+ error (_("mi_cmd_env_pwd: error finding name of working directory: %s"), -+ safe_strerror (errno)); -+ - ui_out_field_string (uiout, "cwd", gdb_dirbuf); - } - -diff --git a/gdb/utils.c b/gdb/utils.c -index d14009f..725f00b 100644 ---- a/gdb/utils.c -+++ b/gdb/utils.c -@@ -865,7 +865,13 @@ internal_vproblem (struct internal_problem *problem, - abort (); /* NOTE: GDB has only three calls to abort(). */ - default: - dejavu = 3; -- write (STDERR_FILENO, msg, sizeof (msg)); -+ /* Newer GLIBC versions put the warn_unused_result attribute -+ on write, but this is one of those rare cases where -+ ignoring the return value is correct. Casting to (void) -+ does not fix this problem. This is the solution suggested -+ at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509. */ -+ if (write (STDERR_FILENO, msg, sizeof (msg)) != sizeof (msg)) -+ abort (); - exit (1); - } - } -Index: gdb-6.7/gdb/linespec.c -=================================================================== ---- gdb-6.7.orig/gdb/linespec.c 2007-10-14 23:31:03.000000000 +0200 -+++ gdb-6.7/gdb/linespec.c 2007-10-14 23:53:57.000000000 +0200 -@@ -1654,7 +1654,7 @@ static struct symtabs_and_lines - find_method (int funfirstline, char ***canonical, char *saved_arg, - char *copy, struct type *t, struct symbol *sym_class) - { -- struct symtabs_and_lines values; -+ struct symtabs_and_lines values = { NULL }; - struct symbol *sym = NULL; - int i1; /* Counter for the symbol array. */ - struct symbol **sym_arr = alloca (total_number_of_methods (t) -Index: gdb-6.7/gdb/top.c -=================================================================== ---- gdb-6.7.orig/gdb/top.c 2007-10-14 23:38:27.000000000 +0200 -+++ gdb-6.7/gdb/top.c 2007-10-14 23:42:39.000000000 +0200 -@@ -1636,7 +1636,8 @@ gdb_init (char *argv0) - - /* Run the init function of each source file */ - -- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); -+ /* Unused result. */ -+ 1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); - current_directory = gdb_dirbuf; - - #ifdef __MSDOS__ ---- ./gdb/ui-file.c 1 Jan 2008 22:53:13 -0000 1.15 -+++ ./gdb/ui-file.c 14 Dec 2008 18:16:56 -0000 -@@ -481,7 +481,9 @@ stdio_file_write (struct ui_file *file, - if (stdio->magic != &stdio_file_magic) - internal_error (__FILE__, __LINE__, - _("stdio_file_write: bad magic number")); -- fwrite (buf, length_buf, 1, stdio->file); -+ /* Calling error crashes when we are called from the exception framework. */ -+ if (fwrite (buf, length_buf, 1, stdio->file)) -+ ; - } - - static void -@@ -491,7 +493,9 @@ stdio_file_fputs (const char *linebuffer - if (stdio->magic != &stdio_file_magic) - internal_error (__FILE__, __LINE__, - _("stdio_file_fputs: bad magic number")); -- fputs (linebuffer, stdio->file); -+ /* Calling error crashes when we are called from the exception framework. */ -+ if (fputs (linebuffer, stdio->file)) -+ ; - } - - static int diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch index eeb6b3c..a8a82a4 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -30,11 +30,11 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: <81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location <81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location -Index: gdb-6.8.50.20081128/gdb/dwarf2read.c +Index: gdb-6.8.50.20090209/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/dwarf2read.c 2008-12-04 10:26:18.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/dwarf2read.c 2008-12-04 10:26:40.000000000 +0100 -@@ -5886,8 +5886,8 @@ read_partial_die (struct partial_die_inf +--- gdb-6.8.50.20090209.orig/gdb/dwarf2read.c 2009-02-09 15:50:59.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/dwarf2read.c 2009-02-09 15:51:57.000000000 +0100 +@@ -6031,8 +6031,8 @@ read_partial_die (struct partial_die_inf { case DW_AT_name: @@ -45,7 +45,7 @@ Index: gdb-6.8.50.20081128/gdb/dwarf2read.c part_die->name = DW_STRING (&attr); break; case DW_AT_comp_dir: -@@ -5895,7 +5895,9 @@ read_partial_die (struct partial_die_inf +@@ -6040,7 +6040,9 @@ read_partial_die (struct partial_die_inf part_die->dirname = DW_STRING (&attr); break; case DW_AT_MIPS_linkage_name: @@ -56,7 +56,7 @@ Index: gdb-6.8.50.20081128/gdb/dwarf2read.c break; case DW_AT_low_pc: has_low_pc_attr = 1; -@@ -8129,9 +8131,13 @@ dwarf2_linkage_name (struct die_info *di +@@ -8278,9 +8280,13 @@ dwarf2_linkage_name (struct die_info *di { struct attribute *attr; @@ -73,36 +73,37 @@ Index: gdb-6.8.50.20081128/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_name, cu); if (attr && DW_STRING (attr)) return DW_STRING (attr); -Index: gdb-6.8.50.20081128/gdb/gdbtypes.c +Index: gdb-6.8.50.20090209/gdb/gdbtypes.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/gdbtypes.c 2008-11-10 21:53:43.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/gdbtypes.c 2008-12-04 10:26:40.000000000 +0100 -@@ -3141,6 +3141,8 @@ gdbtypes_post_init (struct gdbarch *gdba +--- gdb-6.8.50.20090209.orig/gdb/gdbtypes.c 2009-02-09 15:38:54.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/gdbtypes.c 2009-02-09 15:56:14.000000000 +0100 +@@ -3643,6 +3643,8 @@ gdbtypes_post_init (struct gdbarch *gdba init_type (TYPE_CODE_INT, gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT, - 0, "int", (struct objfile *) NULL); + 0, "int", OBJFILE_INTERNAL); + builtin_type->builtin_int_ptr = + make_pointer_type (builtin_type->builtin_int, NULL); builtin_type->builtin_unsigned_int = init_type (TYPE_CODE_INT, gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT, -@@ -3250,6 +3252,11 @@ gdbtypes_post_init (struct gdbarch *gdba - "", NULL); +@@ -3752,6 +3754,12 @@ gdbtypes_post_init (struct gdbarch *gdba + "", OBJFILE_INTERNAL); TYPE_TARGET_TYPE (builtin_type->nodebug_text_symbol) = builtin_type->builtin_int; + builtin_type->nodebug_text_symbol_errno_location = + init_type (TYPE_CODE_FUNC, 1, 0, -+ "", NULL); ++ "", ++ OBJFILE_INTERNAL); + TYPE_TARGET_TYPE (builtin_type->nodebug_text_symbol_errno_location) = + builtin_type->builtin_int_ptr; builtin_type->nodebug_data_symbol = init_type (TYPE_CODE_INT, gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0, -Index: gdb-6.8.50.20081128/gdb/gdbtypes.h +Index: gdb-6.8.50.20090209/gdb/gdbtypes.h =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/gdbtypes.h 2008-10-28 18:19:56.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/gdbtypes.h 2008-12-04 10:26:40.000000000 +0100 -@@ -975,6 +975,7 @@ struct builtin_type +--- gdb-6.8.50.20090209.orig/gdb/gdbtypes.h 2009-02-09 15:38:54.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/gdbtypes.h 2009-02-09 15:51:57.000000000 +0100 +@@ -1050,6 +1050,7 @@ struct builtin_type /* Types used for symbols with no debug information. */ struct type *nodebug_text_symbol; @@ -110,7 +111,7 @@ Index: gdb-6.8.50.20081128/gdb/gdbtypes.h struct type *nodebug_data_symbol; struct type *nodebug_unknown_symbol; struct type *nodebug_tls_symbol; -@@ -987,6 +988,7 @@ struct builtin_type +@@ -1062,6 +1063,7 @@ struct builtin_type struct type *builtin_char; struct type *builtin_short; struct type *builtin_int; @@ -118,10 +119,10 @@ Index: gdb-6.8.50.20081128/gdb/gdbtypes.h struct type *builtin_long; struct type *builtin_signed_char; struct type *builtin_unsigned_char; -Index: gdb-6.8.50.20081128/gdb/parse.c +Index: gdb-6.8.50.20090209/gdb/parse.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/parse.c 2008-11-24 18:05:43.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/parse.c 2008-12-04 10:26:40.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/parse.c 2009-01-03 06:57:52.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/parse.c 2009-02-09 15:51:57.000000000 +0100 @@ -449,7 +449,12 @@ write_exp_msymbol (struct minimal_symbol case mst_text: case mst_file_text: @@ -136,11 +137,11 @@ Index: gdb-6.8.50.20081128/gdb/parse.c break; case mst_data: -Index: gdb-6.8.50.20081128/gdb/target.c +Index: gdb-6.8.50.20090209/gdb/target.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/target.c 2008-12-04 10:24:58.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/target.c 2008-12-04 10:29:07.000000000 +0100 -@@ -850,6 +850,25 @@ pop_all_targets (int quitting) +--- gdb-6.8.50.20090209.orig/gdb/target.c 2009-02-09 15:50:39.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/target.c 2009-02-09 15:51:57.000000000 +0100 +@@ -842,6 +842,25 @@ pop_all_targets (int quitting) pop_all_targets_above (dummy_stratum, quitting); } @@ -166,7 +167,7 @@ Index: gdb-6.8.50.20081128/gdb/target.c /* Using the objfile specified in OBJFILE, find the address for the current thread's thread-local storage with offset OFFSET. */ CORE_ADDR -@@ -931,7 +950,28 @@ target_translate_tls_address (struct obj +@@ -932,7 +951,28 @@ target_translate_tls_address (struct obj /* It wouldn't be wrong here to try a gdbarch method, too; finding TLS is an ABI-specific thing. But we don't do that yet. */ else @@ -196,10 +197,10 @@ Index: gdb-6.8.50.20081128/gdb/target.c return addr; } -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-errno.c +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.dwarf2/dw2-errno.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2008-12-04 10:26:40.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2009-02-09 15:51:57.000000000 +0100 @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -229,10 +230,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-errno.c + + return 0; /* breakpoint */ +} -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.dwarf2/dw2-errno.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2008-12-04 10:26:40.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2009-02-09 15:51:57.000000000 +0100 @@ -0,0 +1,67 @@ +# Copyright 2007 Free Software Foundation, Inc. + diff --git a/gdb-6.5-sharedlibrary-path.patch b/gdb-6.5-sharedlibrary-path.patch index 1fa213b..3e0c101 100644 --- a/gdb-6.5-sharedlibrary-path.patch +++ b/gdb-6.5-sharedlibrary-path.patch @@ -80,11 +80,9 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c + bug-gdb@prep.ai.mit.edu */ + +__thread int var = 42; -Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2008-02-27 09:00:15.000000000 +0100 -@@ -0,0 +1,81 @@ +--- /dev/null 2009-02-10 00:19:00.494289687 +0100 ++++ gdb-6.8.50.20090209-x/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2009-02-10 00:49:38.000000000 +0100 +@@ -0,0 +1,86 @@ +# Copyright 2006 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -109,14 +107,17 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug.exp +set srcmainfile ${testfile}-main.c +set srcsharedfile ${testfile}-shared.c + -+# DO NOT use ${objdir} obsolute reference here as we test relative directories -+# below and the absolute pathnames must not get encoded to the binaries. ++set binmainfile ${objdir}/${subdir}/${testfile}-main ++set binsharedbase ${testfile}-shared.so ++set binsharedfile ${objdir}/${subdir}/${binsharedbase} ++set binshareddebugfile ${objdir}/${subdir}/${binsharedbase}.debug + -+set binmainfile ${testfile}-main -+set binsharedfile ${testfile}-shared.so -+set binshareddebugfile ${testfile}-shared.so.debug ++# Use explicit -soname as otherwise the full path to the library would get ++# encoded into ${binmainfile} making LD_LIBRARY_PATH tests useless. + -+if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcsharedfile}" "${binsharedfile}" {debug}] != "" } { ++# FIXME: gcc dependency (-Wl,-soname). ++ ++if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcsharedfile}" "${binsharedfile}" [list debug additional_flags=-Wl,-soname=${binsharedbase}]] != "" } { + untested "Couldn't compile test library" + return -1 +} @@ -130,7 +131,9 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug.exp + remote_exec build "objcopy --add-gnu-debuglink=${binshareddebugfile} ${binsharedfile}" +} + -+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcmainfile}" "${binmainfile}" executable [list debug shlib=${binsharedfile}]] != "" } { ++# Do not use `shlib=' as it will automatically add also -rpath for gcc. ++ ++if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcmainfile} ${binsharedfile}" "${binmainfile}" executable {debug}] != "" } { + untested "Couldn't compile test program" + return -1 +} @@ -141,7 +144,7 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug.exp +# \$PWD is easy - it is the absolute way +# ${subdir} would fail on "print var" + -+foreach ld_library_path { \$PWD ${subdir} } name { absolute relative } { ++foreach ld_library_path [list [pwd]/${subdir} ./${subdir}] name { absolute relative } { + + gdb_exit + gdb_start diff --git a/gdb-6.6-multifork-debugreg.patch b/gdb-6.6-multifork-debugreg.patch index d5914ca..8e8bca5 100644 --- a/gdb-6.6-multifork-debugreg.patch +++ b/gdb-6.6-multifork-debugreg.patch @@ -28,10 +28,10 @@ http://sourceware.org/ml/gdb-patches/2008-01/msg00042.html * s390-nat.c (s390_fix_watch_points): Fix its compilation failure - rename it to S390_FIX_WATCH_POINTS_LIST. -Index: gdb-6.8.50.20081128/gdb/amd64-linux-nat.c +Index: gdb-6.8.50.20090209/gdb/amd64-linux-nat.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/amd64-linux-nat.c 2008-12-07 10:09:19.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/amd64-linux-nat.c 2008-12-07 10:10:20.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/amd64-linux-nat.c 2009-02-09 16:02:27.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/amd64-linux-nat.c 2009-02-09 16:03:30.000000000 +0100 @@ -408,25 +408,43 @@ amd64_linux_dr_set (ptid_t ptid, int reg void amd64_linux_dr_set_control (unsigned long control) @@ -128,11 +128,10 @@ Index: gdb-6.8.50.20081128/gdb/amd64-linux-nat.c /* This function is called by libthread_db as part of its handling of -@@ -520,6 +573,43 @@ amd64_linux_child_post_startup_inferior - i386_cleanup_dregs (); - super_post_startup_inferior (ptid); +@@ -755,6 +808,42 @@ amd64_linux_siginfo_fixup (struct siginf + return 0; } -+ + +static int (*amd64_linux_super_follow_fork) (struct target_ops *ops, + int follow_child); + @@ -169,10 +168,10 @@ Index: gdb-6.8.50.20081128/gdb/amd64-linux-nat.c + return (*amd64_linux_super_follow_fork) (ops, follow_child); +} + - - /* Provide a prototype to silence -Wmissing-prototypes. */ -@@ -558,6 +648,9 @@ _initialize_amd64_linux_nat (void) + void _initialize_amd64_linux_nat (void); + +@@ -791,6 +880,9 @@ _initialize_amd64_linux_nat (void) linux_elfcore_write_prstatus = amd64_linux_elfcore_write_prstatus; linux_elfcore_write_prfpreg = amd64_linux_elfcore_write_prfpreg; @@ -182,10 +181,10 @@ Index: gdb-6.8.50.20081128/gdb/amd64-linux-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, amd64_linux_new_thread); -Index: gdb-6.8.50.20081128/gdb/config/i386/nm-i386.h +Index: gdb-6.8.50.20090209/gdb/config/i386/nm-i386.h =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/config/i386/nm-i386.h 2008-03-01 05:39:36.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/config/i386/nm-i386.h 2008-12-07 10:09:20.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/config/i386/nm-i386.h 2009-01-03 06:57:54.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/config/i386/nm-i386.h 2009-02-09 16:02:42.000000000 +0100 @@ -120,6 +120,8 @@ extern int i386_stopped_by_watchpoint (v #endif /* I386_WATCHPOINTS_IN_TARGET_VECTOR */ @@ -195,10 +194,10 @@ Index: gdb-6.8.50.20081128/gdb/config/i386/nm-i386.h #endif /* I386_USE_GENERIC_WATCHPOINTS */ #endif /* NM_I386_H */ -Index: gdb-6.8.50.20081128/gdb/i386-linux-nat.c +Index: gdb-6.8.50.20090209/gdb/i386-linux-nat.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/i386-linux-nat.c 2008-03-13 13:22:13.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/i386-linux-nat.c 2008-12-07 10:09:20.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/i386-linux-nat.c 2009-01-03 06:57:51.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/i386-linux-nat.c 2009-02-09 16:02:42.000000000 +0100 @@ -634,21 +634,42 @@ i386_linux_dr_set_control (unsigned long ptid_t ptid; @@ -342,11 +341,11 @@ Index: gdb-6.8.50.20081128/gdb/i386-linux-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, i386_linux_new_thread); -Index: gdb-6.8.50.20081128/gdb/i386-nat.c +Index: gdb-6.8.50.20090209/gdb/i386-nat.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/i386-nat.c 2008-03-01 05:39:36.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/i386-nat.c 2008-12-07 10:09:20.000000000 +0100 -@@ -545,6 +545,17 @@ i386_remove_watchpoint (CORE_ADDR addr, +--- gdb-6.8.50.20090209.orig/gdb/i386-nat.c 2009-01-03 06:57:51.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/i386-nat.c 2009-02-09 16:02:42.000000000 +0100 +@@ -546,6 +546,17 @@ i386_remove_watchpoint (CORE_ADDR addr, return retval; } @@ -364,10 +363,10 @@ Index: gdb-6.8.50.20081128/gdb/i386-nat.c /* Return non-zero if we can watch a memory region that starts at address ADDR and whose length is LEN bytes. */ -Index: gdb-6.8.50.20081128/gdb/ia64-linux-nat.c +Index: gdb-6.8.50.20090209/gdb/ia64-linux-nat.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/ia64-linux-nat.c 2008-12-07 10:06:03.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/ia64-linux-nat.c 2008-12-07 10:09:20.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/ia64-linux-nat.c 2009-02-09 15:48:43.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/ia64-linux-nat.c 2009-02-09 16:02:42.000000000 +0100 @@ -583,6 +583,12 @@ ia64_linux_insert_watchpoint (CORE_ADDR return 0; } @@ -467,10 +466,10 @@ Index: gdb-6.8.50.20081128/gdb/ia64-linux-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, ia64_linux_new_thread); -Index: gdb-6.8.50.20081128/gdb/ppc-linux-nat.c +Index: gdb-6.8.50.20090209/gdb/ppc-linux-nat.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/ppc-linux-nat.c 2008-11-18 22:39:47.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/ppc-linux-nat.c 2008-12-07 10:09:20.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/ppc-linux-nat.c 2009-01-03 06:57:52.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/ppc-linux-nat.c 2009-02-09 16:02:42.000000000 +0100 @@ -1118,6 +1118,12 @@ ppc_linux_insert_watchpoint (CORE_ADDR a return 0; } @@ -563,10 +562,10 @@ Index: gdb-6.8.50.20081128/gdb/ppc-linux-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, ppc_linux_new_thread); -Index: gdb-6.8.50.20081128/gdb/s390-nat.c +Index: gdb-6.8.50.20090209/gdb/s390-nat.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/s390-nat.c 2007-11-07 07:36:57.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/s390-nat.c 2008-12-07 10:09:20.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/s390-nat.c 2007-11-07 07:36:57.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/s390-nat.c 2009-02-09 16:02:42.000000000 +0100 @@ -283,21 +283,15 @@ s390_stopped_by_watchpoint (void) } @@ -721,10 +720,10 @@ Index: gdb-6.8.50.20081128/gdb/s390-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, s390_fix_watch_points); -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c 2008-12-07 10:09:20.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c 2009-02-09 16:02:42.000000000 +0100 @@ -0,0 +1,172 @@ +/* Test case for forgotten hw-watchpoints after fork()-off of a process. + @@ -898,10 +897,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c +#else +# error "!FOLLOW_PARENT && !FOLLOW_CHILD" +#endif -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c 2008-12-07 10:09:20.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c 2009-02-09 16:02:42.000000000 +0100 @@ -0,0 +1,154 @@ +/* Test case for forgotten hw-watchpoints after fork()-off of a process. + @@ -1057,10 +1056,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c + + return 0; +} -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.c +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.c 2008-12-07 10:09:20.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork.c 2009-02-09 16:02:42.000000000 +0100 @@ -0,0 +1,56 @@ +/* Test case for forgotten hw-watchpoints after fork()-off of a process. + @@ -1118,10 +1117,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.c + + return 0; +} -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.exp 2008-12-07 10:09:20.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/watchpoint-fork.exp 2009-02-09 16:02:42.000000000 +0100 @@ -0,0 +1,140 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -1263,11 +1262,11 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.exp +if {[istarget "*-*-linux*"]} { + test child FOLLOW_CHILD +} -Index: gdb-6.8.50.20081128/gdb/doc/gdb.texinfo +Index: gdb-6.8.50.20090209/gdb/doc/gdb.texinfo =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/doc/gdb.texinfo 2008-12-07 10:09:20.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/doc/gdb.texinfo 2008-12-07 10:10:20.000000000 +0100 -@@ -3587,6 +3587,14 @@ confident that no other thread can becom +--- gdb-6.8.50.20090209.orig/gdb/doc/gdb.texinfo 2009-02-09 16:02:35.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/doc/gdb.texinfo 2009-02-09 16:02:42.000000000 +0100 +@@ -3588,6 +3588,14 @@ confident that no other thread can becom software watchpoints as usual. However, @value{GDBN} may not notice when a non-current thread's activity changes the expression. (Hardware watchpoints, in contrast, watch an expression in all threads.) @@ -1282,11 +1281,11 @@ Index: gdb-6.8.50.20081128/gdb/doc/gdb.texinfo @end quotation @xref{set remote hardware-watchpoint-limit}. -Index: gdb-6.8.50.20081128/gdb/config/i386/nm-linux.h +Index: gdb-6.8.50.20090209/gdb/config/i386/nm-linux.h =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/config/i386/nm-linux.h 2008-03-01 05:39:36.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/config/i386/nm-linux.h 2008-12-07 10:09:20.000000000 +0100 -@@ -45,6 +45,16 @@ extern void i386_linux_dr_reset_addr (in +--- gdb-6.8.50.20090209.orig/gdb/config/i386/nm-linux.h 2009-01-03 06:57:54.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/config/i386/nm-linux.h 2009-02-09 16:02:42.000000000 +0100 +@@ -46,6 +46,16 @@ extern void i386_linux_dr_reset_addr (in extern unsigned long i386_linux_dr_get_status (void); #define I386_DR_LOW_GET_STATUS() \ i386_linux_dr_get_status () @@ -1303,10 +1302,10 @@ Index: gdb-6.8.50.20081128/gdb/config/i386/nm-linux.h #ifdef HAVE_PTRACE_GETFPXREGS -Index: gdb-6.8.50.20081128/gdb/config/i386/nm-linux64.h +Index: gdb-6.8.50.20090209/gdb/config/i386/nm-linux64.h =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/config/i386/nm-linux64.h 2008-03-01 05:39:36.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/config/i386/nm-linux64.h 2008-12-07 10:09:20.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/config/i386/nm-linux64.h 2009-01-03 06:57:54.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/config/i386/nm-linux64.h 2009-02-09 16:02:42.000000000 +0100 @@ -51,4 +51,14 @@ extern unsigned long amd64_linux_dr_get_ #define I386_DR_LOW_GET_STATUS() \ amd64_linux_dr_get_status () @@ -1322,11 +1321,11 @@ Index: gdb-6.8.50.20081128/gdb/config/i386/nm-linux64.h + amd64_linux_remove_watchpoint (addr, len, type) + #endif /* nm-linux64.h */ -Index: gdb-6.8.50.20081128/gdb/target.h +Index: gdb-6.8.50.20090209/gdb/target.h =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/target.h 2008-12-07 10:09:19.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/target.h 2008-12-07 10:10:38.000000000 +0100 -@@ -1123,7 +1123,9 @@ extern char *normal_pid_to_str (ptid_t p +--- gdb-6.8.50.20090209.orig/gdb/target.h 2009-02-09 15:49:25.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/target.h 2009-02-09 16:02:42.000000000 +0100 +@@ -1113,7 +1113,9 @@ extern char *normal_pid_to_str (ptid_t p #ifndef target_insert_watchpoint #define target_insert_watchpoint(addr, len, type) \ (*current_target.to_insert_watchpoint) (addr, len, type) diff --git a/gdb-6.7-testsuite-stable-results.patch b/gdb-6.7-testsuite-stable-results.patch index 2952d78..50273e4 100644 --- a/gdb-6.7-testsuite-stable-results.patch +++ b/gdb-6.7-testsuite-stable-results.patch @@ -1,3 +1,5 @@ +gdb/testsuite/gdb.base/fileio.c: +gdb/testsuite/gdb.base/fileio.exp: 2007-12-08 Jan Kratochvil * gdb.base/fileio.c (ROOTSUBDIR): New macro. @@ -6,6 +8,18 @@ * gdb.base/fileio.exp: Change the startup and finish cleanup. Change the test file reference to be into the `fileio.dir' directory. + +sources/gdb/testsuite/gdb.base/dump.exp: +Found on RHEL-5.s390x. + + +gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp: +random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore + + +gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp: +frames-invalid can happen asynchronously. + --- ./gdb/testsuite/gdb.base/fileio.c 13 Jun 2006 08:55:22 -0000 1.10 +++ ./gdb/testsuite/gdb.base/fileio.c 8 Dec 2007 16:04:10 -0000 @@ -58,6 +58,8 @@ system (const char * string); @@ -88,11 +102,6 @@ set timeout $oldtimeout return 0 - - - -Found on RHEL-5.s390x. - --- sources/gdb/testsuite/gdb.base/dump.exp-orig 2008-08-28 11:44:40.000000000 +0200 +++ sources/gdb/testsuite/gdb.base/dump.exp 2008-08-28 11:44:49.000000000 +0200 @@ -493,8 +493,10 @@ if ![string compare $is64bitonly "no"] t @@ -107,3 +116,93 @@ Found on RHEL-5.s390x. "array partial with expressions" 4 "intarray2\[3\]" gdb_test "print intarray2\[2\] == 0" " = 1" "element 2 not changed, == 4" +--- gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp-orig 2009-02-09 16:31:11.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp 2009-02-09 21:27:38.000000000 +0100 +@@ -286,7 +286,7 @@ if [target_info exists gdb,nosignals] { + } else { + send_gdb "signal SIGUSR1\n" + gdb_expect { +- -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${escapedsrcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ ++ -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n(\r\n\032\032frames-invalid\r\n)*\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${escapedsrcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ + { pass "send SIGUSR1" } + -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ + { setup_xfail "*-*-*" 1270 +--- ./gdb/testsuite/gdb.base/auxv.exp 2009-02-11 00:54:54.000000000 +0100 ++++ ./gdb/testsuite/gdb.base/auxv.exp 2009-02-11 00:51:30.000000000 +0100 +@@ -78,8 +78,10 @@ proc fetch_auxv {test} { + + set auxv_lines {} + set bad -1 ++ # Former trailing `\[\r\n\]+' may eat just \r leaving \n in the buffer ++ # corrupting the next matches. + if {[gdb_test_multiple "info auxv" $test { +- -re "info auxv\[\r\n\]+" { ++ -re "info auxv\r\n" { + exp_continue + } + -ex "The program has no auxiliary information now" { +@@ -94,20 +96,20 @@ proc fetch_auxv {test} { + set bad 1 + exp_continue + } +- -re "^\[0-9\]+\[ \t\]+(AT_\[^ \t\]+)\[^\r\n\]+\[\r\n\]+" { ++ -re "^\[0-9\]+\[ \t\]+(AT_\[^ \t\]+)\[^\r\n\]+\r\n" { + lappend auxv_lines $expect_out(0,string) + exp_continue + } +- -re "^\[0-9\]+\[ \t\]+\\?\\?\\?\[^\r\n\]+\[\r\n\]+" { ++ -re "^\[0-9\]+\[ \t\]+\\?\\?\\?\[^\r\n\]+\r\n" { + warning "Unrecognized tag value: $expect_out(0,string)" + set bad 1 + lappend auxv_lines $expect_out(0,string) + exp_continue + } +- -re ".*$gdb_prompt $" { ++ -re "$gdb_prompt $" { + incr bad + } +- -re "^\[^\r\n\]+\[\r\n\]+" { ++ -re "^\[^\r\n\]+\r\n" { + if {!$bad} { + warning "Unrecognized output: $expect_out(0,string)" + set bad 1 +--- ./gdb/testsuite/gdb.base/callfuncs.exp 2009-01-03 06:58:03.000000000 +0100 ++++ ./gdb/testsuite/gdb.base/callfuncs.exp 2009-02-11 00:51:42.000000000 +0100 +@@ -249,15 +249,17 @@ proc fetch_all_registers {test} { + + set all_registers_lines {} + set bad -1 ++ # Former trailing `\[\r\n\]+' may eat just \r leaving \n in the buffer ++ # corrupting the next matches. + if {[gdb_test_multiple "info all-registers" $test { +- -re "info all-registers\[\r\n\]+" { ++ -re "info all-registers\r\n" { + exp_continue + } + -ex "The program has no registers now" { + set bad 1 + exp_continue + } +- -re "^bspstore\[ \t\]+\[^\r\n\]+\[\r\n\]+" { ++ -re "^bspstore\[ \t\]+\[^\r\n\]+\r\n" { + if [istarget "ia64-*-*"] { + # Filter out bspstore which is specially tied to bsp, + # giving spurious differences. +@@ -266,14 +268,14 @@ proc fetch_all_registers {test} { + } + exp_continue + } +- -re "^\[^ \t\]+\[ \t\]+\[^\r\n\]+\[\r\n\]+" { ++ -re "^\[^ \t\]+\[ \t\]+\[^\r\n\]+\r\n" { + lappend all_registers_lines $expect_out(0,string) + exp_continue + } +- -re ".*$gdb_prompt $" { ++ -re "$gdb_prompt $" { + incr bad + } +- -re "^\[^\r\n\]+\[\r\n\]+" { ++ -re "^\[^\r\n\]+\r\n" { + if {!$bad} { + warning "Unrecognized output: $expect_out(0,string)" + set bad 1 diff --git a/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb-6.8-attach-signalled-detach-stopped.patch index 4b94ca5..a297ec4 100644 --- a/gdb-6.8-attach-signalled-detach-stopped.patch +++ b/gdb-6.8-attach-signalled-detach-stopped.patch @@ -1,8 +1,8 @@ -Index: gdb-6.8.50.20081128/gdb/linux-nat.c +Index: gdb-6.8.50.20090209/gdb/linux-nat.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/linux-nat.c 2008-12-06 21:48:18.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/linux-nat.c 2008-12-06 22:00:42.000000000 +0100 -@@ -199,6 +199,9 @@ blocked. */ +--- gdb-6.8.50.20090209.orig/gdb/linux-nat.c 2009-02-09 16:12:23.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/linux-nat.c 2009-02-09 16:15:30.000000000 +0100 +@@ -204,6 +204,9 @@ blocked. */ static struct target_ops *linux_ops; static struct target_ops linux_ops_saved; @@ -12,7 +12,7 @@ Index: gdb-6.8.50.20081128/gdb/linux-nat.c /* The method to call, if any, when a new thread is attached. */ static void (*linux_nat_new_thread) (ptid_t); -@@ -871,7 +874,14 @@ linux_child_follow_fork (struct target_o +@@ -902,7 +905,14 @@ linux_child_follow_fork (struct target_o fork_save_infrun_state (fp, 0); } else @@ -27,8 +27,8 @@ Index: gdb-6.8.50.20081128/gdb/linux-nat.c + } inferior_ptid = ptid_build (child_pid, child_pid, 0); - add_inferior (child_pid); -@@ -1203,6 +1213,7 @@ linux_nat_post_attach_wait (ptid_t ptid, + +@@ -1229,6 +1239,7 @@ linux_nat_post_attach_wait (ptid_t ptid, if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNPAW: Attaching to a stopped process\n"); @@ -36,7 +36,7 @@ Index: gdb-6.8.50.20081128/gdb/linux-nat.c /* The process is definitely stopped. It is in a job control stop, unless the kernel predates the TASK_STOPPED / -@@ -1535,6 +1546,9 @@ GPT: lwp %s had signal %s, but it is in +@@ -1561,6 +1572,9 @@ GPT: lwp %s had signal %s, but it is in *status = lp->status; } @@ -46,16 +46,16 @@ Index: gdb-6.8.50.20081128/gdb/linux-nat.c return 0; } -@@ -1631,6 +1645,8 @@ linux_nat_detach (struct target_ops *ops - inferior_ptid = pid_to_ptid (pid); - linux_ops->to_detach (ops, args, from_tty); - -+ pid_was_stopped = 0; +@@ -1671,6 +1685,8 @@ linux_nat_detach (struct target_ops *ops + } + else + linux_ops->to_detach (ops, args, from_tty); + - if (target_can_async_p ()) - drain_queued_events (pid); ++ pid_was_stopped = 0; } -@@ -1787,6 +1803,14 @@ linux_nat_resume (ptid_t ptid, int step_ + + /* Resume LP. */ +@@ -1825,6 +1841,14 @@ linux_nat_resume (ptid_t ptid, int step_ resume_callback. */ lp->stopped = 0; @@ -70,7 +70,7 @@ Index: gdb-6.8.50.20081128/gdb/linux-nat.c if (resume_all) iterate_over_lwps (resume_callback, NULL); -@@ -3281,6 +3305,8 @@ linux_nat_mourn_inferior (struct target_ +@@ -3316,6 +3340,8 @@ linux_nat_mourn_inferior (struct target_ there are other viable forks to debug. Delete the exiting one and context-switch to the first available. */ linux_fork_mourn_inferior (); @@ -78,83 +78,12 @@ Index: gdb-6.8.50.20081128/gdb/linux-nat.c + pid_was_stopped = 0; } - static LONGEST -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-stopped.c + /* Convert a native/host siginfo object, into/from the siginfo in the +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/attach-stopped.exp =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attach-stopped.c 2008-05-01 20:50:14.000000000 +0200 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-stopped.c 2008-12-06 21:57:23.000000000 +0100 -@@ -1,19 +1,20 @@ - /* This testcase is part of GDB, the GNU debugger. - -- Copyright 2008 Free Software Foundation, Inc. -+ Copyright 2005-2007 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 -+ the Free Software Foundation; either version 2 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 . */ -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - /* This program is intended to be started outside of gdb, then - manually stopped via a signal. */ -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-stopped.exp -=================================================================== ---- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-05-01 20:50:14.000000000 +0200 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-12-06 21:57:23.000000000 +0100 -@@ -1,26 +1,33 @@ --# Copyright 2008 --# Free Software Foundation, Inc. -+# Copyright 2005-2007 - - # 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 -+# the Free Software Foundation; either version 2 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 . -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - # This test was created by modifying attach.exp. - # This file was created by Jeff Johnston . - # This file was updated by Jan Kratochvil . - -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set prms_id 0 -+set bug_id 0 -+ - # This test only works on Linux --if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { -- continue -+if { ![istarget "*-*-linux-gnu*"] } { -+ return 0 - } - - set testfile "attach-stopped" -@@ -63,7 +70,65 @@ proc corefunc { threadtype } { +--- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2009-01-03 06:58:07.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/attach-stopped.exp 2009-02-09 16:12:41.000000000 +0100 +@@ -62,7 +62,65 @@ proc corefunc { threadtype } { gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} @@ -221,39 +150,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-stopped.exp set test "$threadtype: attach2 to stopped, after setting file" gdb_test_multiple "attach $testpid" "$test" { -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attachstop-mt.c -=================================================================== ---- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-05-01 20:50:14.000000000 +0200 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-12-06 21:57:23.000000000 +0100 -@@ -1,19 +1,20 @@ - /* This testcase is part of GDB, the GNU debugger. - -- Copyright 2008 Free Software Foundation, Inc. -+ Copyright 2005 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 -+ the Free Software Foundation; either version 2 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 . */ -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - /* This program is intended to be started outside of gdb, then - manually stopped via a signal. */ -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attachstop-mt.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/attachstop-mt.exp =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-09-28 13:39:45.000000000 +0200 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-12-06 21:57:23.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.threads/attachstop-mt.exp 2009-01-03 06:58:07.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.threads/attachstop-mt.exp 2009-02-09 16:12:41.000000000 +0100 @@ -176,12 +176,23 @@ gdb_test "bt" ".*sleep.*(func|main).*" " # Exit and detach the process. gdb_exit diff --git a/gdb-6.8-bz377541-vla.patch b/gdb-6.8-bz377541-vla.patch index 8b36d50..a8842ff 100644 --- a/gdb-6.8-bz377541-vla.patch +++ b/gdb-6.8-bz377541-vla.patch @@ -1,5 +1,104 @@ +diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c +index a6d5757..5c44b52 100644 +--- a/gdb/ada-lang.c ++++ b/gdb/ada-lang.c +@@ -1666,8 +1666,8 @@ ada_type_of_array (struct value *arr, int bounds) + return NULL; + while (arity > 0) + { +- struct type *range_type = alloc_type (objf); +- struct type *array_type = alloc_type (objf); ++ struct type *range_type = alloc_type (objf, NULL); ++ struct type *array_type = alloc_type (objf, NULL); + struct value *low = desc_one_bound (descriptor, arity, 0); + struct value *high = desc_one_bound (descriptor, arity, 1); + arity -= 1; +@@ -1774,9 +1774,9 @@ packed_array_type (struct type *type, long *elt_bits) + if (TYPE_CODE (type) != TYPE_CODE_ARRAY) + return type; + +- new_type = alloc_type (TYPE_OBJFILE (type)); + new_elt_type = packed_array_type (ada_check_typedef (TYPE_TARGET_TYPE (type)), + elt_bits); ++ new_type = alloc_type (TYPE_OBJFILE (type), new_elt_type); + create_array_type (new_type, new_elt_type, TYPE_INDEX_TYPE (type)); + TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits; + TYPE_NAME (new_type) = ada_type_name (type); +@@ -6790,7 +6790,7 @@ variant_field_index (struct type *type) + static struct type * + empty_record (struct objfile *objfile) + { +- struct type *type = alloc_type (objfile); ++ struct type *type = alloc_type (objfile, NULL); + TYPE_CODE (type) = TYPE_CODE_STRUCT; + TYPE_NFIELDS (type) = 0; + TYPE_FIELDS (type) = NULL; +@@ -6847,7 +6847,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, + nfields++; + } + +- rtype = alloc_type (TYPE_OBJFILE (type)); ++ rtype = alloc_type (TYPE_OBJFILE (type), NULL); + TYPE_CODE (rtype) = TYPE_CODE_STRUCT; + INIT_CPLUS_SPECIFIC (rtype); + TYPE_NFIELDS (rtype) = nfields; +@@ -7034,7 +7034,8 @@ template_to_static_fixed_type (struct type *type0) + new_type = static_unwrap_type (field_type); + if (type == type0 && new_type != field_type) + { +- TYPE_TARGET_TYPE (type0) = type = alloc_type (TYPE_OBJFILE (type0)); ++ TYPE_TARGET_TYPE (type0) = type = alloc_type (TYPE_OBJFILE (type0), ++ NULL); + TYPE_CODE (type) = TYPE_CODE (type0); + INIT_CPLUS_SPECIFIC (type); + TYPE_NFIELDS (type) = nfields; +@@ -7079,7 +7080,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr, + else + dval = dval0; + +- rtype = alloc_type (TYPE_OBJFILE (type)); ++ rtype = alloc_type (TYPE_OBJFILE (type), NULL); + TYPE_CODE (rtype) = TYPE_CODE_STRUCT; + INIT_CPLUS_SPECIFIC (rtype); + TYPE_NFIELDS (rtype) = nfields; +@@ -7251,7 +7252,7 @@ to_fixed_array_type (struct type *type0, struct value *dval, + if (elt_type0 == elt_type) + result = type0; + else +- result = create_array_type (alloc_type (TYPE_OBJFILE (type0)), ++ result = create_array_type (alloc_type (TYPE_OBJFILE (type0), NULL), + elt_type, TYPE_INDEX_TYPE (type0)); + } + else +@@ -7281,7 +7282,7 @@ to_fixed_array_type (struct type *type0, struct value *dval, + struct type *range_type = + to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, i), + dval, TYPE_OBJFILE (type0)); +- result = create_array_type (alloc_type (TYPE_OBJFILE (type0)), ++ result = create_array_type (alloc_type (TYPE_OBJFILE (type0), NULL), + result, range_type); + } + if (!ignore_too_big && TYPE_LENGTH (result) > varsize_limit) +@@ -9546,7 +9547,7 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile) + if (L < INT_MIN || U > INT_MAX) + return raw_type; + else +- return create_range_type (alloc_type (objfile), raw_type, ++ return create_range_type (alloc_type (objfile, NULL), raw_type, + discrete_type_low_bound (raw_type), + discrete_type_high_bound (raw_type)); + } +@@ -9611,7 +9612,7 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile) + + if (objfile == NULL) + objfile = TYPE_OBJFILE (base_type); +- type = create_range_type (alloc_type (objfile), base_type, L, U); ++ type = create_range_type (alloc_type (objfile, NULL), base_type, L, U); + TYPE_NAME (type) = name; + return type; + } diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c -index b18e437..7095e46 100644 +index 0929516..2aaf9ad 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -559,7 +559,12 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream, @@ -16,11 +115,24 @@ index b18e437..7095e46 100644 && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) fprintf_filtered (stream, "%d", (TYPE_LENGTH (type) +diff --git a/gdb/coffread.c b/gdb/coffread.c +index 6059d68..6a24c2c 100644 +--- a/gdb/coffread.c ++++ b/gdb/coffread.c +@@ -346,7 +346,7 @@ coff_alloc_type (int index) + We will fill it in later if we find out how. */ + if (type == NULL) + { +- type = alloc_type (current_objfile); ++ type = alloc_type (current_objfile, NULL); + *type_addr = type; + } + return type; diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c -index 707c0de..9b4c726 100644 +index 75a4ec7..aa8ab33 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c -@@ -738,6 +738,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, +@@ -752,6 +752,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, ctx->initialized = 0; goto no_push; @@ -35,7 +147,7 @@ index 707c0de..9b4c726 100644 error (_("Unhandled dwarf expression opcode 0x%x"), op); } diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h -index 5d9581c..b79f811 100644 +index 7047922..a287b6f 100644 --- a/gdb/dwarf2expr.h +++ b/gdb/dwarf2expr.h @@ -67,10 +67,10 @@ struct dwarf_expr_context @@ -51,7 +163,7 @@ index 5d9581c..b79f811 100644 /* The current depth of dwarf expression recursion, via DW_OP_call*, DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index 080cd06..a70b2fc 100644 +index cad3db8..65751a4 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -107,6 +107,9 @@ struct dwarf_expr_baton @@ -226,9 +338,9 @@ index 080cd06..a70b2fc 100644 /* Evaluate a location description, starting at DATA and with length SIZE, to find the current location of variable VAR in the context of FRAME. */ -@@ -201,8 +327,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -200,8 +326,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, + struct dwarf2_per_cu_data *per_cu) { - struct gdbarch *arch = get_frame_arch (frame); struct value *retval; - struct dwarf_expr_baton baton; struct dwarf_expr_context *ctx; @@ -236,7 +348,7 @@ index 080cd06..a70b2fc 100644 if (size == 0) { -@@ -212,19 +338,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -211,19 +337,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, return retval; } @@ -257,7 +369,7 @@ index 080cd06..a70b2fc 100644 if (ctx->num_pieces > 0) { int i; -@@ -262,6 +377,10 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -261,6 +376,10 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, { CORE_ADDR address = dwarf_expr_fetch (ctx, 0); @@ -268,7 +380,7 @@ index 080cd06..a70b2fc 100644 retval = allocate_value (SYMBOL_TYPE (var)); VALUE_LVAL (retval) = lval_memory; set_value_lazy (retval, 1); -@@ -270,7 +389,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, +@@ -269,7 +388,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, set_value_initialized (retval, ctx->initialized); @@ -277,7 +389,7 @@ index 080cd06..a70b2fc 100644 return retval; } -@@ -588,7 +707,7 @@ static int +@@ -587,7 +706,7 @@ static int loclist_describe_location (struct symbol *symbol, struct ui_file *stream) { /* FIXME: Could print the entire list of locations. */ @@ -286,7 +398,7 @@ index 080cd06..a70b2fc 100644 return 1; } -@@ -604,16 +723,56 @@ loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax, +@@ -603,16 +722,56 @@ loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax, data = find_location_expression (dlbaton, &size, ax->scope); if (data == NULL) @@ -347,7 +459,7 @@ index 080cd06..a70b2fc 100644 + missing_tracepoint_var_ref +}; diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h -index 632568e..a2e5abf 100644 +index 76577f1..bf46761 100644 --- a/gdb/dwarf2loc.h +++ b/gdb/dwarf2loc.h @@ -71,5 +71,11 @@ struct dwarf2_loclist_baton @@ -363,10 +475,10 @@ index 632568e..a2e5abf 100644 #endif /* dwarf2loc.h */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index a6584c4..829fa4e 100644 +index 925cfd0..481cdfc 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -1023,7 +1023,14 @@ static void store_in_ref_table (struct die_info *, +@@ -1024,7 +1024,14 @@ static void store_in_ref_table (struct die_info *, static unsigned int dwarf2_get_ref_die_offset (struct attribute *); @@ -382,7 +494,7 @@ index a6584c4..829fa4e 100644 static struct die_info *follow_die_ref (struct die_info *, struct attribute *, -@@ -1078,6 +1085,9 @@ static void age_cached_comp_units (void); +@@ -1079,6 +1086,9 @@ static void age_cached_comp_units (void); static void free_one_cached_comp_unit (void *); @@ -392,7 +504,7 @@ index a6584c4..829fa4e 100644 static struct type *set_die_type (struct die_info *, struct type *, struct dwarf2_cu *); -@@ -1097,6 +1107,9 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); +@@ -1098,6 +1108,9 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu); @@ -402,7 +514,43 @@ index a6584c4..829fa4e 100644 /* Try to locate the sections we need for DWARF 2 debugging information and return true if we have enough to do something. */ -@@ -4466,6 +4479,26 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3900,7 +3913,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 : ""; +- fnp->type = alloc_type (objfile); ++ fnp->type = alloc_type (objfile, NULL); + this_type = read_type_die (die, cu); + if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC) + { +@@ -4084,7 +4097,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)); +- type = alloc_type (objfile); ++ type = alloc_type (objfile, NULL); + smash_to_method_type (type, domain_type, TYPE_TARGET_TYPE (pfn_type), + TYPE_FIELDS (pfn_type), TYPE_NFIELDS (pfn_type), + TYPE_VARARGS (pfn_type)); +@@ -4121,7 +4134,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) + if (type) + return type; + +- type = alloc_type (objfile); ++ type = alloc_type (objfile, NULL); + INIT_CPLUS_SPECIFIC (type); + name = dwarf2_name (die, cu); + if (name != NULL) +@@ -4334,7 +4347,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) + struct attribute *attr; + const char *name; + +- type = alloc_type (objfile); ++ type = alloc_type (objfile, NULL); + + TYPE_CODE (type) = TYPE_CODE_ENUM; + name = dwarf2_full_name (die, cu); +@@ -4484,6 +4497,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) new_symbol (die, this_type, cu); } @@ -420,16 +568,19 @@ index a6584c4..829fa4e 100644 + /* These generic type attributes need to be fetched by + evaluate_subexp_standard 's call of + value_subscripted_rvalue only for the innermost array type. */ -+ + fetch_die_type_attrs (die, type, cu); + ++ /* These generic type attributes are checked for allocated/associated ++ validity while accessing FIELD_LOC_KIND_DWARF_BLOCK. */ ++ fetch_die_type_attrs (die, range_type, cu); ++ + return type; +} + /* 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. */ -@@ -4479,7 +4512,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4497,7 +4533,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; @@ -438,7 +589,7 @@ index a6584c4..829fa4e 100644 struct cleanup *back_to; char *name; -@@ -4526,16 +4559,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4544,16 +4580,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) @@ -460,7 +611,7 @@ index a6584c4..829fa4e 100644 /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -4891,29 +4919,93 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4909,29 +4940,95 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct objfile *objfile = cu->objfile; struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -468,8 +619,10 @@ index a6584c4..829fa4e 100644 + int length; + + index_type = builtin_type_int32; -+ range_type = create_range_type_nfields (NULL, index_type, 2); -+ TYPE_UNSIGNED (range_type) = 1; ++ /* RANGE_TYPE is allocated from OBJFILE, not OBJFILE_INTERNAL. */ ++ range_type = alloc_type (objfile, index_type); ++ /* LOW_BOUND and HIGH_BOUND are set for real below. */ ++ range_type = create_range_type (range_type, index_type, 0, -1); + + /* C/C++ should probably have the low bound 0 but C/C++ does not use + DW_TAG_string_type. */ @@ -572,7 +725,7 @@ index a6584c4..829fa4e 100644 type = create_string_type (NULL, range_type); return set_die_type (die, type, cu); -@@ -5007,7 +5099,6 @@ static struct type * +@@ -5025,7 +5122,6 @@ static struct type * read_typedef (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; @@ -580,20 +733,18 @@ index a6584c4..829fa4e 100644 const char *name = NULL; struct type *this_type; -@@ -5112,9 +5203,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - struct gdbarch *gdbarch = get_objfile_arch (cu->objfile); +@@ -5131,8 +5227,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type; struct type *range_type; -- struct attribute *attr; + struct attribute *attr; - int low = 0; - int high = -1; -+ struct attribute *attr, *byte_stride_attr; + int low, high, byte_stride_int; -+ enum dwarf2_get_attr_constant_value high_type, byte_stride_type; ++ enum dwarf2_get_attr_constant_value high_type; char *name; base_type = die_type (die, cu); -@@ -5127,42 +5218,89 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5145,42 +5241,90 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) 0, NULL, cu->objfile); } @@ -602,13 +753,8 @@ index a6584c4..829fa4e 100644 - /* FORTRAN implies a lower bound of 1, if not given. */ - low = 1; - } -+ /* DW_AT_bit_stride is currently unsupported as we count in bytes. */ -+ byte_stride_attr = dwarf2_attr (die, DW_AT_byte_stride, cu); -+ byte_stride_type = dwarf2_get_attr_constant_value (byte_stride_attr, -+ &byte_stride_int); -+ -+ range_type = create_range_type_nfields -+ (NULL, base_type, byte_stride_type == dwarf2_attr_unknown ? 2 : 3); ++ /* LOW_BOUND and HIGH_BOUND are set for real below. */ ++ range_type = create_range_type (NULL, base_type, 0, -1); - /* FIXME: For variable sized arrays either of these could be - a variable rather than a constant value. We'll allow it, @@ -673,7 +819,10 @@ index a6584c4..829fa4e 100644 + high_type = dwarf2_get_attr_constant_value (attr, &high); + /* It does not hurt but it is needlessly ineffective in check_typedef. */ + if (high_type != dwarf2_attr_unknown) -+ TYPE_RANGE_HIGH_BOUND_IS_COUNT (range_type) = 1; ++ { ++ TYPE_RANGE_HIGH_BOUND_IS_COUNT (range_type) = 1; ++ TYPE_DYNAMIC (range_type) = 1; ++ } + /* Pass it now as the regular DW_AT_upper_bound. */ + } + switch (high_type) @@ -694,26 +843,29 @@ index a6584c4..829fa4e 100644 } - range_type = create_range_type (NULL, base_type, low, high); -+ switch (byte_stride_type) ++ /* DW_AT_bit_stride is currently unsupported as we count in bytes. */ ++ attr = dwarf2_attr (die, DW_AT_byte_stride, cu); ++ switch (dwarf2_get_attr_constant_value (attr, &byte_stride_int)) + { + case dwarf2_attr_unknown: + break; + case dwarf2_attr_const: + if (byte_stride_int == 0) -+ warning (_("Found DW_AT_byte_stride with unsupported value 0")); -+ SET_TYPE_BYTE_STRIDE (range_type, byte_stride_int); ++ complaint (&symfile_complaints, ++ _("Found DW_AT_byte_stride with unsupported value 0")); ++ TYPE_BYTE_STRIDE (range_type) = byte_stride_int; + break; + case dwarf2_attr_block: + TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 2); + TYPE_FIELD_DWARF_BLOCK (range_type, 2) = dwarf2_attr_to_locexpr_baton -+ (byte_stride_attr, cu); ++ (attr, cu); + TYPE_DYNAMIC (range_type) = 1; + break; + } name = dwarf2_name (die, cu); if (name) -@@ -7450,10 +7588,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, +@@ -7468,10 +7612,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 @@ -728,7 +880,7 @@ index a6584c4..829fa4e 100644 } /* Given a pointer to a DWARF information entry, figure out if we need -@@ -7486,6 +7626,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -7504,6 +7650,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) sizeof (struct symbol)); OBJSTAT (objfile, n_syms++); memset (sym, 0, sizeof (struct symbol)); @@ -737,7 +889,7 @@ index a6584c4..829fa4e 100644 /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_LANGUAGE (sym) = cu->language; -@@ -9291,26 +9433,35 @@ dwarf2_get_ref_die_offset (struct attribute *attr) +@@ -9309,26 +9457,35 @@ dwarf2_get_ref_die_offset (struct attribute *attr) return result; } @@ -788,7 +940,7 @@ index a6584c4..829fa4e 100644 } /* THIS_CU has a reference to PER_CU. If necessary, load the new compilation -@@ -10088,6 +10239,34 @@ attr_form_is_constant (struct attribute *attr) +@@ -10106,6 +10263,34 @@ attr_form_is_constant (struct attribute *attr) } } @@ -823,7 +975,7 @@ index a6584c4..829fa4e 100644 static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu) -@@ -10117,35 +10296,24 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, +@@ -10135,35 +10320,24 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, SYMBOL_OPS (sym) = &dwarf2_loclist_funcs; SYMBOL_LOCATION_BATON (sym) = baton; } @@ -873,7 +1025,7 @@ index a6584c4..829fa4e 100644 } } -@@ -10420,6 +10588,27 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) +@@ -10438,6 +10612,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) return ofs_lhs->offset == ofs_rhs->offset; } @@ -887,21 +1039,25 @@ index a6584c4..829fa4e 100644 + + attr = dwarf2_attr (die, DW_AT_data_location, cu); + if (attr_form_is_block (attr)) -+ TYPE_DATA_LOCATION (type) = dwarf2_attr_to_locexpr_baton (attr, cu); ++ TYPE_DATA_LOCATION_DWARF_BLOCK (type) = dwarf2_attr_to_locexpr_baton (attr, ++ cu); ++ gdb_assert (!TYPE_DATA_LOCATION_IS_ADDR (type)); + + attr = dwarf2_attr (die, DW_AT_allocated, cu); + if (attr_form_is_block (attr)) + TYPE_ALLOCATED (type) = dwarf2_attr_to_locexpr_baton (attr, cu); ++ gdb_assert (!TYPE_NOT_ALLOCATED (type)); + + attr = dwarf2_attr (die, DW_AT_associated, cu); + if (attr_form_is_block (attr)) + TYPE_ASSOCIATED (type) = dwarf2_attr_to_locexpr_baton (attr, cu); ++ gdb_assert (!TYPE_NOT_ASSOCIATED (type)); +} + /* Set the type associated with DIE to TYPE. Save it in CU's hash table if necessary. For convenience, return TYPE. */ -@@ -10428,6 +10617,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -10446,6 +10645,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { struct dwarf2_offset_and_type **slot, ofs; @@ -911,7 +1067,7 @@ index a6584c4..829fa4e 100644 { gdb_assert (cu->per_cu != NULL); diff --git a/gdb/eval.c b/gdb/eval.c -index ccb6b74..e3221ef 100644 +index 038334b..3e2c320 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -40,6 +40,7 @@ @@ -1013,7 +1169,22 @@ index ccb6b74..e3221ef 100644 } case BINOP_LOGICAL_AND: -@@ -2686,9 +2708,12 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) +@@ -2624,12 +2646,13 @@ evaluate_subexp_with_coercion (struct expression *exp, + { + case OP_VAR_VALUE: + var = exp->elts[pc + 2].symbol; ++ /* address_of_variable will call object_address_set for check_typedef. */ ++ val = address_of_variable (var, exp->elts[pc + 1].block); + type = check_typedef (SYMBOL_TYPE (var)); + if (TYPE_CODE (type) == TYPE_CODE_ARRAY + && CAST_IS_CONVERSION) + { + (*pos) += 4; +- val = address_of_variable (var, exp->elts[pc + 1].block); + return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), + val); + } +@@ -2681,9 +2704,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) case OP_VAR_VALUE: (*pos) += 4; @@ -1024,13 +1195,14 @@ index ccb6b74..e3221ef 100644 + need to have executed object_address_set which needs valid + SYMBOL_VALUE_ADDRESS of the symbol. Still VALUE returned by + read_var_value we left as lazy. */ -+ type = value_type (read_var_value (exp->elts[pc + 2].symbol, NULL)); ++ type = value_type (read_var_value (exp->elts[pc + 2].symbol, ++ deprecated_safe_get_selected_frame ())); + return value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type)); default: val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); diff --git a/gdb/f-lang.h b/gdb/f-lang.h -index 3b3487e..4707603 100644 +index 711bdba..123a783 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h @@ -28,6 +28,10 @@ extern void f_error (char *); /* Defined in f-exp.y */ @@ -1045,7 +1217,7 @@ index 3b3487e..4707603 100644 struct ui_file *, int, const struct value_print_options *); diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c -index 081d24a..47ad0f3 100644 +index 6c9668f..852b9a8 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -31,7 +31,7 @@ @@ -1057,15 +1229,6 @@ index 081d24a..47ad0f3 100644 #include "gdb_string.h" #include -@@ -39,7 +39,7 @@ - static void f_type_print_args (struct type *, struct ui_file *); - #endif - --static void f_type_print_varspec_suffix (struct type *, struct ui_file *, -+static void f_type_print_varspec_suffix (struct type *, struct ui_file *, int, - int, int, int); - - void f_type_print_varspec_prefix (struct type *, struct ui_file *, @@ -48,6 +48,34 @@ void f_type_print_varspec_prefix (struct type *, struct ui_file *, void f_type_print_base (struct type *, struct ui_file *, int, int); @@ -1111,32 +1274,7 @@ index 081d24a..47ad0f3 100644 f_type_print_base (type, stream, show, level); code = TYPE_CODE (type); if ((varstring != NULL && *varstring != '\0') -@@ -80,7 +111,7 @@ f_print_type (struct type *type, char *varstring, struct ui_file *stream, - so don't print an additional pair of ()'s */ - - demangled_args = varstring[strlen (varstring) - 1] == ')'; -- f_type_print_varspec_suffix (type, stream, show, 0, demangled_args); -+ f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0); - } - } - -@@ -150,11 +181,13 @@ f_type_print_varspec_prefix (struct type *type, struct ui_file *stream, - - static void - f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, -- int show, int passed_a_ptr, int demangled_args) -+ int show, int passed_a_ptr, int demangled_args, -+ int arrayprint_recurse_level) - { - int upper_bound, lower_bound; -- static int arrayprint_recurse_level = 0; - int retcode; -+ /* No static variables (such as ARRAYPRINT_RECURSE_LEVEL) permitted as ERROR -+ may occur during the evaluation of DWARF_BLOCK values. */ - - if (type == 0) - return; -@@ -164,6 +197,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, +@@ -166,6 +197,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, QUIT; @@ -1146,54 +1284,8 @@ index 081d24a..47ad0f3 100644 switch (TYPE_CODE (type)) { case TYPE_CODE_ARRAY: -@@ -173,7 +209,8 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - fprintf_filtered (stream, "("); - - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) -- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0); -+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0, -+ arrayprint_recurse_level); - - lower_bound = f77_get_lowerbound (type); - if (lower_bound != 1) /* Not the default. */ -@@ -191,7 +228,8 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - } - - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) -- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0); -+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0, -+ arrayprint_recurse_level); - if (arrayprint_recurse_level == 1) - fprintf_filtered (stream, ")"); - else -@@ -201,13 +239,14 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - - case TYPE_CODE_PTR: - case TYPE_CODE_REF: -- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0); -+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0, -+ arrayprint_recurse_level); - fprintf_filtered (stream, ")"); - break; - - case TYPE_CODE_FUNC: - f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, -- passed_a_ptr, 0); -+ passed_a_ptr, 0, arrayprint_recurse_level); - if (passed_a_ptr) - fprintf_filtered (stream, ")"); - -@@ -362,7 +401,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, - fprintfi_filtered (level, stream, "%s", - TYPE_FIELD_NAME (type, index)); - f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index), -- stream, 0, 0, 0); -+ stream, 0, 0, 0, 0); - fputs_filtered ("\n", stream); - } - fprintfi_filtered (level, stream, "End Type "); diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c -index f893b49..3c15edb 100644 +index 5721041..a4d69fb 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -54,15 +54,17 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; @@ -1217,7 +1309,7 @@ index f893b49..3c15edb 100644 if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type)) error (_("Lower bound may not be '*' in F77")); -@@ -72,6 +74,8 @@ f77_get_lowerbound (struct type *type) +@@ -72,14 +74,17 @@ f77_get_lowerbound (struct type *type) int f77_get_upperbound (struct type *type) { @@ -1225,8 +1317,22 @@ index f893b49..3c15edb 100644 + if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) { - /* We have an assumed size array on our hands. Assume that -@@ -135,24 +139,29 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) +- /* We have an assumed size array on our hands. Assume that +- upper_bound == lower_bound so that we show at least 1 element. +- If the user wants to see more elements, let him manually ask for 'em +- and we'll subscript the array and show him. */ ++ /* We have an assumed size array on our hands. As type_length_get ++ already assumes a length zero of arrays with underfined bounds VALADDR ++ passed to the Fortran functions does not contained the real inferior ++ memory content. User should request printing of specific array ++ elements instead. */ + +- return f77_get_lowerbound (type); ++ return f77_get_lowerbound (type) - 1; + } + + return TYPE_ARRAY_UPPER_BOUND_VALUE (type); +@@ -135,24 +140,29 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) upper = f77_get_upperbound (tmp_type); lower = f77_get_lowerbound (tmp_type); @@ -1262,7 +1368,7 @@ index f893b49..3c15edb 100644 } } -@@ -172,34 +181,34 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, +@@ -172,34 +182,34 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, if (nss != ndimensions) { @@ -1306,7 +1412,7 @@ index f893b49..3c15edb 100644 fprintf_filtered (stream, "..."); } } -@@ -251,6 +260,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +@@ -251,6 +261,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR addr; int index; @@ -1316,18 +1422,8 @@ index f893b49..3c15edb 100644 CHECK_TYPEDEF (type); switch (TYPE_CODE (type)) { -@@ -567,8 +579,7 @@ info_common_command (char *comname, int from_tty) - while (entry != NULL) - { - printf_filtered ("%s = ", SYMBOL_PRINT_NAME (entry->symbol)); -- print_variable_value (entry->symbol, fi, gdb_stdout); -- printf_filtered ("\n"); -+ print_variable_value_nl (entry->symbol, fi, gdb_stdout); - entry = entry->next; - } - } diff --git a/gdb/findvar.c b/gdb/findvar.c -index f7b6e63..3989957 100644 +index 1048887..b9e7711 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -35,6 +35,7 @@ @@ -1338,12 +1434,12 @@ index f7b6e63..3989957 100644 /* Basic byte-swapping routines. GDB has needed these for a long time... All extract a target-format integer at ADDR which is LEN bytes long. */ -@@ -383,27 +384,16 @@ symbol_read_needs_frame (struct symbol *sym) +@@ -382,27 +383,16 @@ symbol_read_needs_frame (struct symbol *sym) + /* Given a struct symbol for a variable, and a stack frame id, read the value of the variable and return a (pointer to a) struct value containing the value. - If the variable cannot be found, return a zero pointer. -- If FRAME is NULL, use the selected frame. */ -+ If FRAME is NULL, use the selected frame. +- If the variable cannot be found, return a zero pointer. */ ++ If the variable cannot be found, return a zero pointer. + We have to first find the address of the variable before allocating struct + value to return as its size may depend on DW_OP_PUSH_OBJECT_ADDRESS possibly + used by its type. */ @@ -1368,9 +1464,9 @@ index f7b6e63..3989957 100644 - - len = TYPE_LENGTH (type); - /* FIXME drow/2003-09-06: this call to the selected frame should be - pushed upwards to the callers. */ -@@ -413,31 +403,39 @@ read_var_value (struct symbol *var, struct frame_info *frame) + if (symbol_read_needs_frame (var)) + gdb_assert (frame); +@@ -410,31 +400,39 @@ read_var_value (struct symbol *var, struct frame_info *frame) switch (SYMBOL_CLASS (var)) { case LOC_CONST: @@ -1429,7 +1525,7 @@ index f7b6e63..3989957 100644 return v; } -@@ -485,12 +483,23 @@ read_var_value (struct symbol *var, struct frame_info *frame) +@@ -476,12 +474,23 @@ read_var_value (struct symbol *var, struct frame_info *frame) break; case LOC_BLOCK: @@ -1459,7 +1555,7 @@ index f7b6e63..3989957 100644 case LOC_REGISTER: case LOC_REGPARM_ADDR: -@@ -511,7 +520,6 @@ read_var_value (struct symbol *var, struct frame_info *frame) +@@ -499,7 +508,6 @@ read_var_value (struct symbol *var, struct frame_info *frame) error (_("Value of register variable not available.")); addr = value_as_address (regval); @@ -1467,7 +1563,7 @@ index f7b6e63..3989957 100644 } else { -@@ -556,18 +564,33 @@ read_var_value (struct symbol *var, struct frame_info *frame) +@@ -542,18 +550,33 @@ read_var_value (struct symbol *var, struct frame_info *frame) break; case LOC_OPTIMIZED_OUT: @@ -1507,7 +1603,7 @@ index f7b6e63..3989957 100644 } /* Install default attributes for register values. */ -@@ -604,10 +627,11 @@ struct value * +@@ -590,10 +613,11 @@ struct value * value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -1521,7 +1617,7 @@ index f7b6e63..3989957 100644 { /* The ISA/ABI need to something weird when obtaining the specified value from this register. It might need to -@@ -621,7 +645,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) +@@ -607,7 +631,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) VALUE_FRAME_ID (v) = get_frame_id (frame); VALUE_REGNUM (v) = regnum; gdbarch_register_to_value (gdbarch, @@ -1531,7 +1627,7 @@ index f7b6e63..3989957 100644 else { diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index 5b9d0e8..f814ce3 100644 +index 8102321..e6190cf 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -38,6 +38,8 @@ @@ -1543,92 +1639,201 @@ index 5b9d0e8..f814ce3 100644 /* These variables point to the objects representing the predefined C data types. */ -@@ -478,11 +480,13 @@ make_qualified_type (struct type *type, int new_flags, - struct type *ntype; - - ntype = type; -- do { -- if (TYPE_INSTANCE_FLAGS (ntype) == new_flags) -- return ntype; -- ntype = TYPE_CHAIN (ntype); -- } while (ntype != type); -+ do +@@ -146,6 +148,23 @@ static void print_bit_vector (B_TYPE *, int); + static void print_arg_types (struct field *, int, int); + static void dump_fn_fieldlists (struct type *, int); + static void print_cplus_stuff (struct type *, int); ++static void type_init_refc (struct type *new_type, struct type *parent_type); ++ ++/* A reference count structure for the type reference count map. Each ++ type in a hierarchy of types is mapped to the same reference ++ count. */ ++struct type_refc_entry ++{ ++ /* One type in the hierarchy. Each type in the hierarchy gets its ++ own slot. */ ++ struct type *type; ++ ++ /* A pointer to the shared reference count. */ ++ int *refc; ++}; ++ ++/* The hash table holding all reference counts. */ ++static htab_t type_refc_table; + + + /* Alloc a new type structure and fill it with some defaults. If +@@ -154,23 +173,25 @@ static void print_cplus_stuff (struct type *, int); + structure by xmalloc () (for permanent types). */ + + struct type * +-alloc_type (struct objfile *objfile) ++alloc_type (struct objfile *objfile, struct type *parent) + { + struct type *type; + + /* Alloc the structure and start off with all fields zeroed. */ + +- if (objfile == NULL) ++ switch ((long) objfile) + { ++ case (long) OBJFILE_INTERNAL: ++ case (long) OBJFILE_MALLOC: + type = XZALLOC (struct type); + TYPE_MAIN_TYPE (type) = XZALLOC (struct main_type); +- } +- else +- { ++ break; ++ default: + type = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct type); + TYPE_MAIN_TYPE (type) = OBSTACK_ZALLOC (&objfile->objfile_obstack, + struct main_type); + OBJSTAT (objfile, n_types++); ++ break; + } + + /* Initialize the fields that might not be zero. */ +@@ -180,6 +201,9 @@ alloc_type (struct objfile *objfile) + TYPE_VPTR_FIELDNO (type) = -1; + TYPE_CHAIN (type) = type; /* Chain back to itself. */ + ++ if (objfile == NULL) ++ type_init_refc (type, parent); ++ + return (type); + } + +@@ -194,16 +218,24 @@ alloc_type_instance (struct type *oldtype) + + /* Allocate the structure. */ + +- if (TYPE_OBJFILE (oldtype) == NULL) +- type = XZALLOC (struct type); +- else +- type = OBSTACK_ZALLOC (&TYPE_OBJFILE (oldtype)->objfile_obstack, +- struct type); +- ++ switch ((long) TYPE_OBJFILE (oldtype)) + { -+ if (TYPE_INSTANCE_FLAGS (ntype) == new_flags) -+ return ntype; -+ ntype = TYPE_CHAIN (ntype); ++ case (long) OBJFILE_INTERNAL: ++ case (long) OBJFILE_MALLOC: ++ type = XZALLOC (struct type); ++ break; ++ default: ++ type = OBSTACK_ZALLOC (&TYPE_OBJFILE (oldtype)->objfile_obstack, ++ struct type); ++ break; + } -+ while (ntype != type); + TYPE_MAIN_TYPE (type) = TYPE_MAIN_TYPE (oldtype); - /* Create a new type instance. */ - if (storage == NULL) -@@ -690,16 +694,21 @@ allocate_stub_method (struct type *type) - RESULT_TYPE, or creating a new type, inheriting the objfile from - INDEX_TYPE. + TYPE_CHAIN (type) = type; /* Chain back to itself for now. */ -- Indices will be of type INDEX_TYPE, and will range from LOW_BOUND -- to HIGH_BOUND, inclusive. -+ Indices will be of type INDEX_TYPE. NFIELDS should be 2 for standard -+ arrays, 3 for custom TYPE_BYTE_STRIDE. Use CREATE_RANGE_TYPE for common -+ constant TYPE_LOW_BOUND/TYPE_HIGH_BOUND ranges instead. ++ if (TYPE_OBJFILE (oldtype) == NULL) ++ type_init_refc (type, oldtype); + -+ You must to decide TYPE_UNSIGNED yourself as being done in CREATE_RANGE_TYPE. + return (type); + } - FIXME: Maybe we should check the TYPE_CODE of RESULT_TYPE to make - sure it is TYPE_CODE_UNDEF before we bash it into a range type? */ +@@ -248,7 +280,7 @@ make_pointer_type (struct type *type, struct type **typeptr) - struct type * --create_range_type (struct type *result_type, struct type *index_type, -- int low_bound, int high_bound) -+create_range_type_nfields (struct type *result_type, struct type *index_type, -+ int nfields) - { -+ int fieldno; + if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */ + { +- ntype = alloc_type (TYPE_OBJFILE (type)); ++ ntype = alloc_type (TYPE_OBJFILE (type), type); + if (typeptr) + *typeptr = ntype; + } +@@ -260,6 +292,9 @@ make_pointer_type (struct type *type, struct type **typeptr) + smash_type (ntype); + TYPE_CHAIN (ntype) = chain; + TYPE_OBJFILE (ntype) = objfile; + - if (result_type == NULL) ++ /* Callers may only supply storage if there is an objfile. */ ++ gdb_assert (objfile); + } + + TYPE_TARGET_TYPE (ntype) = type; +@@ -328,7 +363,7 @@ make_reference_type (struct type *type, struct type **typeptr) + + if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */ { - result_type = alloc_type (TYPE_OBJFILE (index_type)); -@@ -710,17 +719,33 @@ create_range_type (struct type *result_type, struct type *index_type, +- ntype = alloc_type (TYPE_OBJFILE (type)); ++ ntype = alloc_type (TYPE_OBJFILE (type), type); + if (typeptr) + *typeptr = ntype; + } +@@ -340,6 +375,9 @@ make_reference_type (struct type *type, struct type **typeptr) + smash_type (ntype); + TYPE_CHAIN (ntype) = chain; + TYPE_OBJFILE (ntype) = objfile; ++ ++ /* Callers may only supply storage if there is an objfile. */ ++ gdb_assert (objfile); + } + + TYPE_TARGET_TYPE (ntype) = type; +@@ -388,7 +426,7 @@ make_function_type (struct type *type, struct type **typeptr) + + if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */ + { +- ntype = alloc_type (TYPE_OBJFILE (type)); ++ ntype = alloc_type (TYPE_OBJFILE (type), type); + if (typeptr) + *typeptr = ntype; + } +@@ -398,6 +436,9 @@ make_function_type (struct type *type, struct type **typeptr) + objfile = TYPE_OBJFILE (ntype); + smash_type (ntype); + TYPE_OBJFILE (ntype) = objfile; ++ ++ /* Callers may only supply storage if there is an objfile. */ ++ gdb_assert (objfile); + } + + TYPE_TARGET_TYPE (ntype) = type; +@@ -643,7 +684,7 @@ lookup_memberptr_type (struct type *type, struct type *domain) + { + struct type *mtype; + +- mtype = alloc_type (TYPE_OBJFILE (type)); ++ mtype = alloc_type (TYPE_OBJFILE (type), NULL); + smash_to_memberptr_type (mtype, domain, type); + return (mtype); + } +@@ -655,7 +696,7 @@ lookup_methodptr_type (struct type *to_type) + { + struct type *mtype; + +- mtype = alloc_type (TYPE_OBJFILE (to_type)); ++ mtype = alloc_type (TYPE_OBJFILE (to_type), NULL); + TYPE_TARGET_TYPE (mtype) = to_type; + TYPE_DOMAIN_TYPE (mtype) = TYPE_DOMAIN_TYPE (to_type); + TYPE_LENGTH (mtype) = cplus_method_ptr_size (to_type); +@@ -696,19 +737,20 @@ create_range_type (struct type *result_type, struct type *index_type, + int low_bound, int high_bound) + { + if (result_type == NULL) +- result_type = alloc_type (TYPE_OBJFILE (index_type)); ++ result_type = alloc_type (TYPE_OBJFILE (index_type), index_type); + TYPE_CODE (result_type) = TYPE_CODE_RANGE; + TYPE_TARGET_TYPE (result_type) = index_type; + if (TYPE_STUB (index_type)) TYPE_TARGET_STUB (result_type) = 1; else TYPE_LENGTH (result_type) = TYPE_LENGTH (check_typedef (index_type)); - TYPE_NFIELDS (result_type) = 2; -+ TYPE_NFIELDS (result_type) = nfields; - TYPE_FIELDS (result_type) = (struct field *) -- TYPE_ALLOC (result_type, 2 * sizeof (struct field)); -- memset (TYPE_FIELDS (result_type), 0, 2 * sizeof (struct field)); -- TYPE_FIELD_BITPOS (result_type, 0) = low_bound; -- TYPE_FIELD_BITPOS (result_type, 1) = high_bound; -+ TYPE_ALLOC (result_type, -+ TYPE_NFIELDS (result_type) * sizeof (struct field)); -+ memset (TYPE_FIELDS (result_type), 0, -+ TYPE_NFIELDS (result_type) * sizeof (struct field)); -+ -+ return (result_type); -+} -+ -+/* Simplified CREATE_RANGE_TYPE_NFIELDS for constant ranges from LOW_BOUND to -+ HIGH_BOUND, inclusive. TYPE_BYTE_STRIDE is always set to zero (default -+ native target type length). */ -+ -+struct type * -+create_range_type (struct type *result_type, struct type *index_type, -+ int low_bound, int high_bound) -+{ -+ result_type = create_range_type_nfields (result_type, index_type, 2); -+ -+ TYPE_LOW_BOUND (result_type) = low_bound; -+ TYPE_HIGH_BOUND (result_type) = high_bound; ++ TYPE_NFIELDS (result_type) = 3; + TYPE_FIELDS (result_type) = TYPE_ZALLOC (result_type, + TYPE_NFIELDS (result_type) + * sizeof (struct field)); + TYPE_LOW_BOUND (result_type) = low_bound; + TYPE_HIGH_BOUND (result_type) = high_bound; ++ TYPE_BYTE_STRIDE (result_type) = 0; if (low_bound >= 0) TYPE_UNSIGNED (result_type) = 1; - -- return (result_type); -+ return result_type; - } - - /* Set *LOWP and *HIGHP to the lower and upper bounds of discrete type -@@ -734,6 +759,9 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp) +@@ -727,6 +769,9 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp) switch (TYPE_CODE (type)) { case TYPE_CODE_RANGE: @@ -1638,8 +1843,19 @@ index 5b9d0e8..f814ce3 100644 *lowp = TYPE_LOW_BOUND (type); *highp = TYPE_HIGH_BOUND (type); return 1; -@@ -816,17 +844,6 @@ create_array_type (struct type *result_type, +@@ -805,30 +850,65 @@ create_array_type (struct type *result_type, + + if (result_type == NULL) + { +- result_type = alloc_type (TYPE_OBJFILE (range_type)); ++ result_type = alloc_type (TYPE_OBJFILE (range_type), range_type); } ++ else ++ { ++ /* Callers may only supply storage if there is an objfile. */ ++ gdb_assert (TYPE_OBJFILE (result_type)); ++ } ++ TYPE_CODE (result_type) = TYPE_CODE_ARRAY; TYPE_TARGET_TYPE (result_type) = element_type; - if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) @@ -1655,9 +1871,9 @@ index 5b9d0e8..f814ce3 100644 - TYPE_LENGTH (element_type) * (high_bound - low_bound + 1); TYPE_NFIELDS (result_type) = 1; TYPE_FIELDS (result_type) = - (struct field *) TYPE_ALLOC (result_type, sizeof (struct field)); -@@ -834,9 +851,48 @@ create_array_type (struct type *result_type, - TYPE_FIELD_TYPE (result_type, 0) = range_type; + (struct field *) TYPE_ZALLOC (result_type, sizeof (struct field)); ++ /* FIXME: type alloc. */ + TYPE_INDEX_TYPE (result_type) = range_type; TYPE_VPTR_FIELDNO (result_type) = -1; - /* TYPE_FLAG_TARGET_STUB will take care of zero length arrays */ @@ -1707,7 +1923,21 @@ index 5b9d0e8..f814ce3 100644 return (result_type); } -@@ -1380,6 +1436,65 @@ stub_noname_complaint (void) +@@ -865,7 +945,12 @@ create_set_type (struct type *result_type, struct type *domain_type) + { + if (result_type == NULL) + { +- result_type = alloc_type (TYPE_OBJFILE (domain_type)); ++ result_type = alloc_type (TYPE_OBJFILE (domain_type), domain_type); ++ } ++ else ++ { ++ /* Callers may only supply storage if there is an objfile. */ ++ gdb_assert (TYPE_OBJFILE (result_type)); + } + TYPE_CODE (result_type) = TYPE_CODE_SET; + TYPE_NFIELDS (result_type) = 1; +@@ -1368,6 +1453,65 @@ stub_noname_complaint (void) complaint (&symfile_complaints, _("stub type has NULL name")); } @@ -1773,7 +2003,7 @@ index 5b9d0e8..f814ce3 100644 /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989. If this is a stubbed struct (i.e. declared as struct foo *), see if -@@ -1396,7 +1511,8 @@ stub_noname_complaint (void) +@@ -1384,7 +1528,8 @@ stub_noname_complaint (void) /* Find the real type of TYPE. This function returns the real type, after removing all layers of typedefs and completing opaque or stub types. Completion changes the TYPE argument, but stripping of @@ -1783,73 +2013,32 @@ index 5b9d0e8..f814ce3 100644 struct type * check_typedef (struct type *type) -@@ -1506,34 +1622,87 @@ check_typedef (struct type *type) +@@ -1420,7 +1565,7 @@ check_typedef (struct type *type) + if (sym) + TYPE_TARGET_TYPE (type) = SYMBOL_TYPE (sym); + else /* TYPE_CODE_UNDEF */ +- TYPE_TARGET_TYPE (type) = alloc_type (NULL); ++ TYPE_TARGET_TYPE (type) = alloc_type (NULL, NULL); + } + type = TYPE_TARGET_TYPE (type); + } +@@ -1494,34 +1639,37 @@ check_typedef (struct type *type) } } - if (TYPE_TARGET_STUB (type)) -+ if (TYPE_DYNAMIC (type) || (TYPE_CODE (type) == TYPE_CODE_RANGE -+ && TYPE_RANGE_HIGH_BOUND_IS_COUNT (type))) ++ /* copy_type_recursive automatically makes the resulting type containing only ++ constant values expected by the callers of this function. */ ++ if (TYPE_DYNAMIC (type)) + { -+ struct type *ntype; -+ -+ /* make_cv_type does not copy the contents of TYPE_MAIN_TYPE while we are -+ changing fields in it below. Do a full TYPE_MAIN_TYPE copy. -+ Sure FIXME as it is at least a memory leak. */ ++ htab_t copied_types; ++ struct type *type_old = type; + -+ ntype = alloc_type (TYPE_OBJFILE (type)); -+ *TYPE_MAIN_TYPE (ntype) = *TYPE_MAIN_TYPE (type); -+ TYPE_LENGTH (ntype) = TYPE_LENGTH (type); -+ TYPE_INSTANCE_FLAGS (ntype) = TYPE_INSTANCE_FLAGS (type); -+ if (TYPE_NFIELDS (type)) -+ { -+ size_t size = sizeof (*TYPE_FIELDS (type)) * TYPE_NFIELDS (type); -+ -+ if (TYPE_OBJFILE (type)) -+ TYPE_FIELDS (ntype) = obstack_alloc -+ (&TYPE_OBJFILE (type)->objfile_obstack, size); -+ else -+ TYPE_FIELDS (ntype) = xzalloc (size); -+ memcpy (TYPE_FIELDS (ntype), TYPE_FIELDS (type), size); -+ } -+ type = ntype; -+ -+ if (TYPE_CODE (type) == TYPE_CODE_ARRAY -+ || TYPE_CODE (type) == TYPE_CODE_STRING) -+ { -+ struct type *range_type; ++ copied_types = create_copied_types_hash (NULL); ++ type = copy_type_recursive (type, copied_types); ++ htab_delete (copied_types); + -+ gdb_assert (TYPE_NFIELDS (type) == 1); -+ range_type = TYPE_INDEX_TYPE (type); -+ gdb_assert (TYPE_CODE (range_type) == TYPE_CODE_RANGE); -+ TYPE_INDEX_TYPE (type) = check_typedef (range_type); -+ } -+ else if (TYPE_CODE (type) == TYPE_CODE_RANGE) -+ { -+ int fieldno; -+ -+ /* Evaluate the DWARF ranges and set them statically. */ -+ for (fieldno = 0; fieldno < TYPE_NFIELDS (type); fieldno++) -+ if (TYPE_RANGE_BOUND_IS_DWARF_BLOCK (type, fieldno)) -+ { -+ struct dwarf2_locexpr_baton *dlbaton; -+ CORE_ADDR val; -+ -+ dlbaton = TYPE_FIELD_DWARF_BLOCK (type, fieldno); -+ val = dwarf_locexpr_baton_eval (dlbaton); -+ TYPE_RANGE_BOUND_UNSET_DWARF_BLOCK (type, fieldno); -+ TYPE_FIELD_BITPOS (type, fieldno) = val; -+ } -+ -+ /* Convert TYPE_RANGE_HIGH_BOUND_IS_COUNT-modified TYPE_HIGH_BOUND -+ meanint the count (not the high bound) into a regular bound. */ -+ if (TYPE_RANGE_HIGH_BOUND_IS_COUNT (type)) -+ { -+ TYPE_RANGE_HIGH_BOUND_IS_COUNT (type) = 0; -+ TYPE_HIGH_BOUND (type) = TYPE_LOW_BOUND (type) -+ + TYPE_HIGH_BOUND (type) - 1; -+ } -+ } ++ gdb_assert (TYPE_DYNAMIC (type) == 0); + } + + if (!currently_reading_symtab @@ -1866,7 +2055,7 @@ index 5b9d0e8..f814ce3 100644 } else if (TYPE_CODE (type) == TYPE_CODE_ARRAY - && TYPE_NFIELDS (type) == 1 -- && (TYPE_CODE (range_type = TYPE_FIELD_TYPE (type, 0)) +- && (TYPE_CODE (range_type = TYPE_INDEX_TYPE (type)) - == TYPE_CODE_RANGE)) + || TYPE_CODE (type) == TYPE_CODE_STRING) { @@ -1874,8 +2063,8 @@ index 5b9d0e8..f814ce3 100644 - number of elements and the target type's length. - Watch out for Ada null Ada arrays where the high bound - is smaller than the low bound. */ -- const int low_bound = TYPE_FIELD_BITPOS (range_type, 0); -- const int high_bound = TYPE_FIELD_BITPOS (range_type, 1); +- const int low_bound = TYPE_LOW_BOUND (range_type); +- const int high_bound = TYPE_HIGH_BOUND (range_type); - int nb_elements; - - if (high_bound < low_bound) @@ -1889,7 +2078,7 @@ index 5b9d0e8..f814ce3 100644 TYPE_TARGET_STUB (type) = 0; } else if (TYPE_CODE (type) == TYPE_CODE_RANGE) -@@ -1541,9 +1710,12 @@ check_typedef (struct type *type) +@@ -1529,9 +1677,12 @@ check_typedef (struct type *type) TYPE_LENGTH (type) = TYPE_LENGTH (target_type); TYPE_TARGET_STUB (type) = 0; } @@ -1902,135 +2091,975 @@ index 5b9d0e8..f814ce3 100644 return type; } -diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h -index 333eb31..a925dac 100644 ---- a/gdb/gdbtypes.h -+++ b/gdb/gdbtypes.h -@@ -209,6 +209,11 @@ enum type_instance_flag_value +@@ -1753,7 +1904,7 @@ init_type (enum type_code code, int length, int flags, + { + struct type *type; - #define TYPE_TARGET_STUB(t) (TYPE_MAIN_TYPE (t)->flag_target_stub) +- type = alloc_type (objfile); ++ type = alloc_type (objfile, NULL); + TYPE_CODE (type) = code; + TYPE_LENGTH (type) = length; -+/* Type needs to be evaluated on each CHECK_TYPEDEF and its results must not be -+ sticky. Used for TYPE_RANGE_BOUND_IS_DWARF_BLOCK. */ +@@ -1783,15 +1934,24 @@ init_type (enum type_code code, int length, int flags, + if (flags & TYPE_FLAG_FIXED_INSTANCE) + TYPE_FIXED_INSTANCE (type) = 1; + +- if ((name != NULL) && (objfile != NULL)) +- { +- TYPE_NAME (type) = obsavestring (name, strlen (name), +- &objfile->objfile_obstack); +- } +- else +- { +- TYPE_NAME (type) = name; +- } ++ if (name) ++ switch ((long) objfile) ++ { ++ case (long) OBJFILE_INTERNAL: ++ TYPE_NAME (type) = name; ++ break; ++ case (long) OBJFILE_MALLOC: ++ TYPE_NAME (type) = xstrdup (name); ++ break; ++#if 0 /* OBJFILE_MALLOC duplication now. */ ++ case (long) NULL: ++ internal_error (__FILE__, __LINE__, ++ _("OBJFILE pointer NULL should be OBJFILE_* instead")); ++#endif ++ default: ++ TYPE_NAME (type) = obsavestring (name, strlen (name), ++ &objfile->objfile_obstack); ++ } + + /* C++ fancies. */ + +@@ -1803,6 +1963,10 @@ init_type (enum type_code code, int length, int flags, + { + INIT_CPLUS_SPECIFIC (type); + } + -+#define TYPE_DYNAMIC(t) (TYPE_MAIN_TYPE (t)->flag_dynamic) ++ if (!objfile) ++ type_incref (type); + - /* Static type. If this is set, the corresponding type had - * a static modifier. - * Note: This may be unnecessary, since static data members -@@ -352,6 +357,8 @@ struct main_type - unsigned int flag_stub_supported : 1; - unsigned int flag_nottext : 1; - unsigned int flag_fixed_instance : 1; -+ unsigned int flag_dynamic : 1; -+ unsigned int flag_range_high_bound_is_count : 1; + return (type); + } - /* Number of fields described for this type. This field appears at - this location because it packs nicely here. */ -@@ -414,6 +421,15 @@ struct main_type +@@ -2916,33 +3080,47 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) + } - struct type *target_type; + /* Allocate the hash table used by copy_type_recursive to walk +- types without duplicates. We use OBJFILE's obstack, because +- OBJFILE is about to be deleted. */ ++ types without duplicates. */ + + htab_t + create_copied_types_hash (struct objfile *objfile) + { +- return htab_create_alloc_ex (1, type_pair_hash, type_pair_eq, +- NULL, &objfile->objfile_obstack, +- hashtab_obstack_allocate, +- dummy_obstack_deallocate); ++ if (objfile == NULL) ++ { ++ /* NULL OBJFILE is for TYPE_DYNAMIC types already contained in ++ OBJFILE_MALLOC memory, such as those from VALUE_HISTORY_CHAIN. Table ++ element entries get allocated by xmalloc - so use xfree. */ ++ return htab_create (1, type_pair_hash, type_pair_eq, xfree); ++ } ++ else ++ { ++ /* Use OBJFILE's obstack, because OBJFILE is about to be deleted. Table ++ element entries get allocated by xmalloc - so use xfree. */ ++ return htab_create_alloc_ex (1, type_pair_hash, type_pair_eq, ++ xfree, &objfile->objfile_obstack, ++ hashtab_obstack_allocate, ++ dummy_obstack_deallocate); ++ } + } -+ /* For DW_AT_data_location. FIXME: Support also its constant form. */ -+ struct dwarf2_locexpr_baton *data_location; +-/* Recursively copy (deep copy) TYPE, if it is associated with +- OBJFILE. Return a new type allocated using malloc, a saved type if +- we have already visited TYPE (using COPIED_TYPES), or TYPE if it is +- not associated with OBJFILE. */ ++/* A helper for copy_type_recursive. This does all the work. ++ REPRESENTATIVE is a pointer to a type. This is used to register ++ newly-created types in the type_refc_table. Initially it pointer ++ to a NULL pointer, but it is filled in the first time a type is ++ copied. OBJFILE is used only for an assertion checking. */ + +-struct type * +-copy_type_recursive (struct objfile *objfile, +- struct type *type, +- htab_t copied_types) ++static struct type * ++copy_type_recursive_1 (struct objfile *objfile, ++ struct type *type, ++ htab_t copied_types, ++ struct type **representative) + { + struct type_pair *stored, pair; + void **slot; + struct type *new_type; + +- if (TYPE_OBJFILE (type) == NULL) ++ if (TYPE_OBJFILE (type) == OBJFILE_INTERNAL ++ || (objfile == OBJFILE_MALLOC && !TYPE_DYNAMIC (type))) + return type; + + /* This type shouldn't be pointing to any types in other objfiles; +@@ -2954,11 +3132,15 @@ copy_type_recursive (struct objfile *objfile, + if (*slot != NULL) + return ((struct type_pair *) *slot)->new; + +- new_type = alloc_type (NULL); ++ new_type = alloc_type (OBJFILE_MALLOC, *representative); ++ if (!*representative) ++ *representative = new_type; + + /* We must add the new type to the hash table immediately, in case +- we encounter this type again during a recursive call below. */ +- stored = obstack_alloc (&objfile->objfile_obstack, sizeof (struct type_pair)); ++ we encounter this type again during a recursive call below. Memory could ++ be allocated from OBJFILE in the case we will be removing OBJFILE, this ++ optimization is missed and xfree is called for it from COPIED_TYPES. */ ++ stored = xmalloc (sizeof (*stored)); + stored->old = type; + stored->new = new_type; + *slot = stored; +@@ -2968,6 +3150,13 @@ copy_type_recursive (struct objfile *objfile, + *TYPE_MAIN_TYPE (new_type) = *TYPE_MAIN_TYPE (type); + TYPE_OBJFILE (new_type) = NULL; + ++ /* Pre-clear the fields processed by delete_main_type. If DWARF block ++ evaluations below call error we would leave an unfreeable TYPE. */ ++ TYPE_TARGET_TYPE (new_type) = NULL; ++ TYPE_VPTR_BASETYPE (new_type) = NULL; ++ TYPE_NFIELDS (new_type) = 0; ++ TYPE_FIELDS (new_type) = NULL; ++ + if (TYPE_NAME (type)) + TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type)); + if (TYPE_TAG_NAME (type)) +@@ -2976,12 +3165,45 @@ copy_type_recursive (struct objfile *objfile, + TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); + TYPE_LENGTH (new_type) = TYPE_LENGTH (type); + ++ if (TYPE_ALLOCATED (new_type)) ++ { ++ gdb_assert (!TYPE_NOT_ALLOCATED (new_type)); + -+ /* For DW_AT_allocated. FIXME: Support also its constant form. */ -+ struct dwarf2_locexpr_baton *allocated; ++ if (!dwarf_locexpr_baton_eval (TYPE_ALLOCATED (new_type))) ++ TYPE_NOT_ALLOCATED (new_type) = 1; ++ TYPE_ALLOCATED (new_type) = NULL; ++ } + -+ /* For DW_AT_associated. FIXME: Support also its constant form. */ -+ struct dwarf2_locexpr_baton *associated; ++ if (TYPE_ASSOCIATED (new_type)) ++ { ++ gdb_assert (!TYPE_NOT_ASSOCIATED (new_type)); + - /* For structure and union types, a description of each field. - For set and pascal array types, there is one "field", - whose type is the domain type of the set or array. -@@ -795,9 +811,9 @@ extern void allocate_cplus_struct_type (struct type *); - #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type - #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type - #define TYPE_CHAIN(thistype) (thistype)->chain --/* Note that if thistype is a TYPEDEF type, you have to call check_typedef. -- But check_typedef does set the TYPE_LENGTH of the TYPEDEF type, -- so you only have to call check_typedef once. Since allocate_value -+/* Note that if thistype is a TYPEDEF, ARRAY or STRING type, you have to call -+ check_typedef. But check_typedef does set the TYPE_LENGTH of the TYPEDEF -+ type, so you only have to call check_typedef once. Since allocate_value - calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */ - #define TYPE_LENGTH(thistype) (thistype)->length - #define TYPE_OBJFILE(thistype) TYPE_MAIN_TYPE(thistype)->objfile -@@ -807,23 +823,53 @@ extern void allocate_cplus_struct_type (struct type *); - #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields - #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->fields - #define TYPE_TEMPLATE_ARGS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->template_args -+#define TYPE_DATA_LOCATION(thistype) TYPE_MAIN_TYPE (thistype)->data_location -+#define TYPE_ALLOCATED(thistype) TYPE_MAIN_TYPE (thistype)->allocated -+#define TYPE_ASSOCIATED(thistype) TYPE_MAIN_TYPE (thistype)->associated ++ if (!dwarf_locexpr_baton_eval (TYPE_ASSOCIATED (new_type))) ++ TYPE_NOT_ASSOCIATED (new_type) = 1; ++ TYPE_ASSOCIATED (new_type) = NULL; ++ } ++ ++ if (!TYPE_DATA_LOCATION_IS_ADDR (new_type) ++ && TYPE_DATA_LOCATION_DWARF_BLOCK (new_type)) ++ { ++ if (TYPE_NOT_ALLOCATED (new_type) ++ || TYPE_NOT_ASSOCIATED (new_type)) ++ TYPE_DATA_LOCATION_DWARF_BLOCK (new_type) = NULL; ++ else ++ { ++ TYPE_DATA_LOCATION_IS_ADDR (new_type) = 1; ++ TYPE_DATA_LOCATION_ADDR (new_type) = dwarf_locexpr_baton_eval ++ (TYPE_DATA_LOCATION_DWARF_BLOCK (new_type)); ++ } ++ } ++ + /* Copy the fields. */ + if (TYPE_NFIELDS (type)) + { + int i, nfields; - #define TYPE_INDEX_TYPE(type) TYPE_FIELD_TYPE (type, 0) -+/* `TYPE_NFIELDS (range_type) >= 3' check is required before accessing it: */ -+#define SET_TYPE_BYTE_STRIDE(range_type, n) \ -+ (TYPE_FIELD_BITPOS (range_type, 2) = (n)) - #define TYPE_LOW_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 0) - #define TYPE_HIGH_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 1) -- --/* Moto-specific stuff for FORTRAN arrays */ -- --#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \ -- (TYPE_FIELD_ARTIFICIAL((TYPE_FIELD_TYPE((arraytype),0)),1)) -+#define TYPE_BYTE_STRIDE(range_type) \ -+ (TYPE_NFIELDS (range_type) < 3 ? 0 : TYPE_FIELD_BITPOS (range_type, 2)) + nfields = TYPE_NFIELDS (type); ++ TYPE_NFIELDS (new_type) = nfields; + TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field); + for (i = 0; i < nfields; i++) + { +@@ -2990,8 +3212,8 @@ copy_type_recursive (struct objfile *objfile, + TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i); + if (TYPE_FIELD_TYPE (type, i)) + TYPE_FIELD_TYPE (new_type, i) +- = copy_type_recursive (objfile, TYPE_FIELD_TYPE (type, i), +- copied_types); ++ = copy_type_recursive_1 (objfile, TYPE_FIELD_TYPE (type, i), ++ copied_types, representative); + if (TYPE_FIELD_NAME (type, i)) + TYPE_FIELD_NAME (new_type, i) = + xstrdup (TYPE_FIELD_NAME (type, i)); +@@ -3010,6 +3232,16 @@ copy_type_recursive (struct objfile *objfile, + xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type, + i))); + break; ++ case FIELD_LOC_KIND_DWARF_BLOCK: ++ /* `struct dwarf2_locexpr_baton' is too bound to its objfile so ++ it is expected to be made constant by CHECK_TYPEDEF. */ ++ if (TYPE_NOT_ALLOCATED (new_type) ++ || TYPE_NOT_ASSOCIATED (new_type)) ++ SET_FIELD_DWARF_BLOCK (TYPE_FIELD (new_type, i), NULL); ++ else ++ SET_FIELD_BITPOS (TYPE_FIELD (new_type, i), ++ dwarf_locexpr_baton_eval (TYPE_FIELD_DWARF_BLOCK (type, i))); ++ break; + default: + internal_error (__FILE__, __LINE__, + _("Unexpected type field location kind: %d"), +@@ -3018,17 +3250,32 @@ copy_type_recursive (struct objfile *objfile, + } + } + ++ /* Convert TYPE_RANGE_HIGH_BOUND_IS_COUNT into a regular bound. */ ++ if (TYPE_CODE (type) == TYPE_CODE_RANGE ++ && TYPE_RANGE_HIGH_BOUND_IS_COUNT (type)) ++ { ++ TYPE_RANGE_HIGH_BOUND_IS_COUNT (new_type) = 0; ++ TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (type) ++ + TYPE_HIGH_BOUND (type) - 1; ++ } + -+/* Whether we should use TYPE_FIELD_DWARF_BLOCK (and not TYPE_FIELD_BITPOS). */ -+#define TYPE_RANGE_BOUND_IS_DWARF_BLOCK(range_type, fieldno) \ -+ (TYPE_FIELD_LOC_KIND (range_type, fieldno) == FIELD_LOC_KIND_DWARF_BLOCK) -+#define TYPE_RANGE_BOUND_SET_DWARF_BLOCK(range_type, fieldno) \ -+ (TYPE_FIELD_LOC_KIND (range_type, fieldno) = FIELD_LOC_KIND_DWARF_BLOCK) -+#define TYPE_RANGE_BOUND_UNSET_DWARF_BLOCK(range_type, fieldno) \ -+ (TYPE_FIELD_LOC_KIND (range_type, fieldno) = FIELD_LOC_KIND_BITPOS) -+#define TYPE_ARRAY_BOUND_IS_DWARF_BLOCK(array_type, fieldno) \ -+ TYPE_RANGE_BOUND_IS_DWARF_BLOCK (TYPE_INDEX_TYPE (array_type), fieldno) ++ /* Both FIELD_LOC_KIND_DWARF_BLOCK and TYPE_RANGE_HIGH_BOUND_IS_COUNT were ++ possibly converted. */ ++ TYPE_DYNAMIC (new_type) = 0; ++ + /* Copy pointers to other types. */ + if (TYPE_TARGET_TYPE (type)) + TYPE_TARGET_TYPE (new_type) = +- copy_type_recursive (objfile, +- TYPE_TARGET_TYPE (type), +- copied_types); ++ copy_type_recursive_1 (objfile, ++ TYPE_TARGET_TYPE (type), ++ copied_types, ++ representative); + if (TYPE_VPTR_BASETYPE (type)) + TYPE_VPTR_BASETYPE (new_type) = +- copy_type_recursive (objfile, +- TYPE_VPTR_BASETYPE (type), +- copied_types); ++ copy_type_recursive_1 (objfile, ++ TYPE_VPTR_BASETYPE (type), ++ copied_types, ++ representative); + /* Maybe copy the type_specific bits. + + NOTE drow/2005-12-09: We do not copy the C++-specific bits like +@@ -3046,6 +3293,20 @@ copy_type_recursive (struct objfile *objfile, + return new_type; + } + ++/* Recursively copy (deep copy) TYPE. Return a new type allocated using ++ malloc, a saved type if we have already visited TYPE (using COPIED_TYPES), ++ or TYPE if it is not associated with OBJFILE. */ + -+/* Is HIGH_BOUND a low-bound relative count (1) or the high bound itself (0)? */ -+#define TYPE_RANGE_HIGH_BOUND_IS_COUNT(range_type) \ -+ (TYPE_MAIN_TYPE (range_type)->flag_range_high_bound_is_count) ++struct type * ++copy_type_recursive (struct type *type, ++ htab_t copied_types) ++{ ++ struct type *representative = NULL; + -+/* Unbound arrays, such as GCC array[]; at end of struct. */ ++ return copy_type_recursive_1 (TYPE_OBJFILE (type), type, copied_types, ++ &representative); ++} ++ + /* Make a copy of the given TYPE, except that the pointer & reference + types are not preserved. + +@@ -3059,7 +3320,7 @@ copy_type (const struct type *type) + + gdb_assert (TYPE_OBJFILE (type) != NULL); + +- new_type = alloc_type (TYPE_OBJFILE (type)); ++ new_type = alloc_type (TYPE_OBJFILE (type), NULL); + TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); + TYPE_LENGTH (new_type) = TYPE_LENGTH (type); + memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type), +@@ -3068,6 +3329,242 @@ copy_type (const struct type *type) + return new_type; + } + ++static void delete_type (struct type *type); ++ ++/* A helper for delete_type which deletes a main_type and the things to which ++ it refers. TYPE is a type whose main_type we wish to destroy. */ ++ ++static void ++delete_main_type (struct main_type *main_type) ++{ ++ int i; ++ void **slot; ++ struct ++ { ++ struct main_type *main_type; ++ } type_local = { main_type }, *type = &type_local; ++ ++ gdb_assert (TYPE_OBJFILE (type) == OBJFILE_MALLOC); ++ ++ xfree (TYPE_NAME (type)); ++ xfree (TYPE_TAG_NAME (type)); ++ ++ for (i = 0; i < TYPE_NFIELDS (type); ++i) ++ { ++ xfree (TYPE_FIELD_NAME (type, i)); ++ ++ if (TYPE_FIELD_LOC_KIND (type, i) == FIELD_LOC_KIND_PHYSNAME) ++ xfree (TYPE_FIELD_STATIC_PHYSNAME (type, i)); ++ } ++ xfree (TYPE_FIELDS (type)); ++ ++ /* Strangely, HAVE_CPLUS_STRUCT will return true when there isn't ++ one at all. */ ++ gdb_assert (!HAVE_CPLUS_STRUCT (type) || !TYPE_CPLUS_SPECIFIC (type)); ++ ++ xfree (TYPE_MAIN_TYPE (type)); ++} ++ ++/* Store `struct main_type *' entries which got `struct type *' deleted. */ ++ ++static htab_t deleted_main_types_hash; ++ ++/* To be called before any call of delete_type. */ ++ ++static void ++delete_type_begin (void) ++{ ++ gdb_assert (deleted_main_types_hash == NULL); ++ ++ deleted_main_types_hash = htab_create_alloc (10, htab_hash_pointer, ++ htab_eq_pointer, NULL, xcalloc, xfree); ++} ++ ++/* Helper for delete_type_finish. */ ++ ++static int ++delete_type_finish_traverse (void **slot, void *unused) ++{ ++ struct main_type *main_type = *slot; ++ ++ delete_main_type (main_type); ++ ++ return 1; ++} ++ ++/* To be called after all the calls of delete_type. Each MAIN_TYPE must have ++ either none or all of its TYPE entries deleted. */ ++ ++static void ++delete_type_finish (void) ++{ ++ htab_traverse (deleted_main_types_hash, delete_type_finish_traverse, NULL); ++ ++ htab_delete (deleted_main_types_hash); ++ deleted_main_types_hash = NULL; ++} ++ ++/* Delete TYPE and remember MAIN_TYPE it references. TYPE must have been ++ allocated using xmalloc -- not using an objfile. You must wrap calls of ++ this function by delete_type_begin and delete_type_finish. */ ++ ++static void ++delete_type (struct type *type) ++{ ++ void **slot; ++ ++ if (!type) ++ return; ++ ++ if (TYPE_OBJFILE (type) == OBJFILE_INTERNAL) ++ return; ++ gdb_assert (TYPE_OBJFILE (type) == OBJFILE_MALLOC); ++ ++ slot = htab_find_slot (deleted_main_types_hash, TYPE_MAIN_TYPE (type), ++ INSERT); ++ gdb_assert (!*slot); ++ *slot = TYPE_MAIN_TYPE (type); ++ ++ xfree (type); ++} ++ ++/* Hash function for type_refc_table. */ ++ ++static hashval_t ++type_refc_hash (const void *p) ++{ ++ const struct type_refc_entry *entry = p; ++ return htab_hash_pointer (entry->type); ++} ++ ++/* Equality function for type_refc_table. */ ++ ++static int ++type_refc_equal (const void *a, const void *b) ++{ ++ const struct type_refc_entry *left = a; ++ const struct type_refc_entry *right = b; ++ return left->type == right->type; ++} ++ ++/* Insert the new type NEW_TYPE into the table. Does nothing if ++ NEW_TYPE has an objfile. If PARENT_TYPE is not NULL, then NEW_TYPE ++ will be inserted into the same hierarchy as PARENT_TYPE. In this ++ case, PARENT_TYPE must already exist in the reference count map. ++ If PARENT_TYPE is NULL, a new reference count is allocated and set ++ to one. */ ++ ++static void ++type_init_refc (struct type *new_type, struct type *parent_type) ++{ ++ int *refc; ++ void **slot; ++ struct type_refc_entry *new_entry; ++ ++ if (TYPE_OBJFILE (new_type)) ++ return; ++ ++ if (parent_type) ++ { ++ struct type_refc_entry entry, *found; ++ entry.type = parent_type; ++ found = htab_find (type_refc_table, &entry); ++ gdb_assert (found); ++ refc = found->refc; ++ } ++ else ++ { ++ refc = xmalloc (sizeof (int)); ++ *refc = 0; ++ } ++ ++ new_entry = XNEW (struct type_refc_entry); ++ new_entry->type = new_type; ++ new_entry->refc = refc; ++ ++ slot = htab_find_slot (type_refc_table, new_entry, INSERT); ++ gdb_assert (!*slot); ++ *slot = new_entry; ++} ++ ++/* Increment the reference count for TYPE. */ ++ ++void ++type_incref (struct type *type) ++{ ++ struct type_refc_entry entry, *found; ++ ++ if (TYPE_OBJFILE (type)) ++ return; ++ ++ entry.type = type; ++ found = htab_find (type_refc_table, &entry); ++ gdb_assert (found); ++ ++*(found->refc); ++} ++ ++/* A traverse callback for type_refc_table which removes any entry ++ whose reference count pointer is REFC. REFC may be NULL to delete all the ++ unused entries - use such cleanup only in the GDB idle state as GDB code ++ does not necessarily reference county TYPEs during its processing. */ ++ ++static int ++type_refc_remove (void **slot, void *refc) ++{ ++ struct type_refc_entry *entry = *slot; ++ ++ if (entry->refc == refc || (refc == NULL && *entry->refc == 0)) ++ { ++ delete_type (entry->type); ++ ++ xfree (entry); ++ htab_clear_slot (type_refc_table, slot); ++ } ++ ++ return 1; ++} ++ ++/* Decrement the reference count for TYPE. If TYPE has no more ++ references, delete it. */ ++ ++void ++type_decref (struct type *type) ++{ ++ struct type_refc_entry entry, *found; ++ ++ if (TYPE_OBJFILE (type)) ++ return; ++ ++ entry.type = type; ++ found = htab_find (type_refc_table, &entry); ++ gdb_assert (found); ++ --*(found->refc); ++ if (*(found->refc) == 0) ++ { ++ void *refc = found->refc; ++ ++ /* Clear all table entries referring to this count. CHECK: Should not be ++ the deletion delayed till free_all_types? */ ++ delete_type_begin (); ++ htab_traverse (type_refc_table, type_refc_remove, refc); ++ delete_type_finish (); ++ ++ /* Delete the reference count itself. */ ++ xfree (refc); ++ } ++} ++ ++/* Free all the types that have been allocated (except for those released). ++ Called after each command, successful or not. */ ++ ++void ++free_all_types (void) ++{ ++ delete_type_begin (); ++ htab_traverse (type_refc_table, type_refc_remove, NULL); ++ delete_type_finish (); ++} ++ + static struct type * + build_flt (int bit, char *name, const struct floatformat **floatformats) + { +@@ -3105,7 +3602,7 @@ build_complex (int bit, char *name, struct type *target_type) + return builtin_type_error; + } + t = init_type (TYPE_CODE_COMPLEX, 2 * bit / TARGET_CHAR_BIT, +- 0, name, (struct objfile *) NULL); ++ 0, name, OBJFILE_INTERNAL); + TYPE_TARGET_TYPE (t) = target_type; + return t; + } +@@ -3119,56 +3616,56 @@ gdbtypes_post_init (struct gdbarch *gdbarch) + builtin_type->builtin_void = + init_type (TYPE_CODE_VOID, 1, + 0, +- "void", (struct objfile *) NULL); ++ "void", OBJFILE_INTERNAL); + builtin_type->builtin_char = + init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + (TYPE_FLAG_NOSIGN + | (gdbarch_char_signed (gdbarch) ? 0 : TYPE_FLAG_UNSIGNED)), +- "char", (struct objfile *) NULL); ++ "char", OBJFILE_INTERNAL); + builtin_type->builtin_signed_char = + init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, +- "signed char", (struct objfile *) NULL); ++ "signed char", OBJFILE_INTERNAL); + builtin_type->builtin_unsigned_char = + init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, +- "unsigned char", (struct objfile *) NULL); ++ "unsigned char", OBJFILE_INTERNAL); + builtin_type->builtin_short = + init_type (TYPE_CODE_INT, + gdbarch_short_bit (gdbarch) / TARGET_CHAR_BIT, +- 0, "short", (struct objfile *) NULL); ++ 0, "short", OBJFILE_INTERNAL); + builtin_type->builtin_unsigned_short = + init_type (TYPE_CODE_INT, + gdbarch_short_bit (gdbarch) / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned short", +- (struct objfile *) NULL); ++ OBJFILE_INTERNAL); + builtin_type->builtin_int = + init_type (TYPE_CODE_INT, + gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT, +- 0, "int", (struct objfile *) NULL); ++ 0, "int", OBJFILE_INTERNAL); + builtin_type->builtin_unsigned_int = + init_type (TYPE_CODE_INT, + gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned int", +- (struct objfile *) NULL); ++ OBJFILE_INTERNAL); + builtin_type->builtin_long = + init_type (TYPE_CODE_INT, + gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT, +- 0, "long", (struct objfile *) NULL); ++ 0, "long", OBJFILE_INTERNAL); + builtin_type->builtin_unsigned_long = + init_type (TYPE_CODE_INT, + gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned long", +- (struct objfile *) NULL); ++ OBJFILE_INTERNAL); + builtin_type->builtin_long_long = + init_type (TYPE_CODE_INT, + gdbarch_long_long_bit (gdbarch) / TARGET_CHAR_BIT, +- 0, "long long", (struct objfile *) NULL); ++ 0, "long long", OBJFILE_INTERNAL); + builtin_type->builtin_unsigned_long_long = + init_type (TYPE_CODE_INT, + gdbarch_long_long_bit (gdbarch) / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, "unsigned long long", +- (struct objfile *) NULL); ++ OBJFILE_INTERNAL); + builtin_type->builtin_float + = build_flt (gdbarch_float_bit (gdbarch), "float", + gdbarch_float_format (gdbarch)); +@@ -3187,26 +3684,26 @@ gdbtypes_post_init (struct gdbarch *gdbarch) + builtin_type->builtin_string = + init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, +- "string", (struct objfile *) NULL); ++ "string", OBJFILE_INTERNAL); + builtin_type->builtin_bool = + init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, +- "bool", (struct objfile *) NULL); ++ "bool", OBJFILE_INTERNAL); + + /* The following three are about decimal floating point types, which + are 32-bits, 64-bits and 128-bits respectively. */ + builtin_type->builtin_decfloat + = init_type (TYPE_CODE_DECFLOAT, 32 / 8, + 0, +- "_Decimal32", (struct objfile *) NULL); ++ "_Decimal32", OBJFILE_INTERNAL); + builtin_type->builtin_decdouble + = init_type (TYPE_CODE_DECFLOAT, 64 / 8, + 0, +- "_Decimal64", (struct objfile *) NULL); ++ "_Decimal64", OBJFILE_INTERNAL); + builtin_type->builtin_declong + = init_type (TYPE_CODE_DECFLOAT, 128 / 8, + 0, +- "_Decimal128", (struct objfile *) NULL); ++ "_Decimal128", OBJFILE_INTERNAL); + + /* Pointer/Address types. */ + +@@ -3245,27 +3742,28 @@ gdbtypes_post_init (struct gdbarch *gdbarch) + init_type (TYPE_CODE_INT, + gdbarch_addr_bit (gdbarch) / 8, + TYPE_FLAG_UNSIGNED, +- "__CORE_ADDR", (struct objfile *) NULL); ++ "__CORE_ADDR", OBJFILE_INTERNAL); + + + /* The following set of types is used for symbols with no + debug information. */ + builtin_type->nodebug_text_symbol = + init_type (TYPE_CODE_FUNC, 1, 0, +- "", NULL); ++ "", OBJFILE_INTERNAL); + TYPE_TARGET_TYPE (builtin_type->nodebug_text_symbol) = + builtin_type->builtin_int; + builtin_type->nodebug_data_symbol = + init_type (TYPE_CODE_INT, + gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0, +- "", NULL); ++ "", OBJFILE_INTERNAL); + builtin_type->nodebug_unknown_symbol = + init_type (TYPE_CODE_INT, 1, 0, +- "", NULL); ++ "", ++ OBJFILE_INTERNAL); + builtin_type->nodebug_tls_symbol = + init_type (TYPE_CODE_INT, + gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0, +- "", NULL); ++ "", OBJFILE_INTERNAL); + + return builtin_type; + } +@@ -3276,6 +3774,9 @@ _initialize_gdbtypes (void) + { + gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); + ++ type_refc_table = htab_create_alloc (20, type_refc_hash, type_refc_equal, ++ NULL, xcalloc, xfree); ++ + /* FIXME: The following types are architecture-neutral. However, + they contain pointer_type and reference_type fields potentially + caching pointer or reference types that *are* architecture +@@ -3284,47 +3785,47 @@ _initialize_gdbtypes (void) + builtin_type_int0 = + init_type (TYPE_CODE_INT, 0 / 8, + 0, +- "int0_t", (struct objfile *) NULL); ++ "int0_t", OBJFILE_INTERNAL); + builtin_type_int8 = + init_type (TYPE_CODE_INT, 8 / 8, + TYPE_FLAG_NOTTEXT, +- "int8_t", (struct objfile *) NULL); ++ "int8_t", OBJFILE_INTERNAL); + builtin_type_uint8 = + init_type (TYPE_CODE_INT, 8 / 8, + TYPE_FLAG_UNSIGNED | TYPE_FLAG_NOTTEXT, +- "uint8_t", (struct objfile *) NULL); ++ "uint8_t", OBJFILE_INTERNAL); + builtin_type_int16 = + init_type (TYPE_CODE_INT, 16 / 8, + 0, +- "int16_t", (struct objfile *) NULL); ++ "int16_t", OBJFILE_INTERNAL); + builtin_type_uint16 = + init_type (TYPE_CODE_INT, 16 / 8, + TYPE_FLAG_UNSIGNED, +- "uint16_t", (struct objfile *) NULL); ++ "uint16_t", OBJFILE_INTERNAL); + builtin_type_int32 = + init_type (TYPE_CODE_INT, 32 / 8, + 0, +- "int32_t", (struct objfile *) NULL); ++ "int32_t", OBJFILE_INTERNAL); + builtin_type_uint32 = + init_type (TYPE_CODE_INT, 32 / 8, + TYPE_FLAG_UNSIGNED, +- "uint32_t", (struct objfile *) NULL); ++ "uint32_t", OBJFILE_INTERNAL); + builtin_type_int64 = + init_type (TYPE_CODE_INT, 64 / 8, + 0, +- "int64_t", (struct objfile *) NULL); ++ "int64_t", OBJFILE_INTERNAL); + builtin_type_uint64 = + init_type (TYPE_CODE_INT, 64 / 8, + TYPE_FLAG_UNSIGNED, +- "uint64_t", (struct objfile *) NULL); ++ "uint64_t", OBJFILE_INTERNAL); + builtin_type_int128 = + init_type (TYPE_CODE_INT, 128 / 8, + 0, +- "int128_t", (struct objfile *) NULL); ++ "int128_t", OBJFILE_INTERNAL); + builtin_type_uint128 = + init_type (TYPE_CODE_INT, 128 / 8, + TYPE_FLAG_UNSIGNED, +- "uint128_t", (struct objfile *) NULL); ++ "uint128_t", OBJFILE_INTERNAL); + + builtin_type_ieee_single = + build_flt (-1, "builtin_type_ieee_single", floatformats_ieee_single); +@@ -3344,15 +3845,15 @@ _initialize_gdbtypes (void) + builtin_type_void = + init_type (TYPE_CODE_VOID, 1, + 0, +- "void", (struct objfile *) NULL); ++ "void", OBJFILE_INTERNAL); + builtin_type_true_char = + init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + 0, +- "true character", (struct objfile *) NULL); ++ "true character", OBJFILE_INTERNAL); + builtin_type_true_unsigned_char = + init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT, + TYPE_FLAG_UNSIGNED, +- "true character", (struct objfile *) NULL); ++ "true character", OBJFILE_INTERNAL); + + add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, _("\ + Set debugging of C++ overloading."), _("\ +diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h +index c90b6d7..86df022 100644 +--- a/gdb/gdbtypes.h ++++ b/gdb/gdbtypes.h +@@ -209,6 +209,11 @@ enum type_instance_flag_value + + #define TYPE_TARGET_STUB(t) (TYPE_MAIN_TYPE (t)->flag_target_stub) + ++/* Type needs to be evaluated on each CHECK_TYPEDEF and its results must not be ++ sticky. */ ++ ++#define TYPE_DYNAMIC(t) (TYPE_MAIN_TYPE (t)->flag_dynamic) ++ + /* Static type. If this is set, the corresponding type had + * a static modifier. + * Note: This may be unnecessary, since static data members +@@ -266,6 +271,36 @@ enum type_instance_flag_value + + #define TYPE_NOTTEXT(t) (TYPE_MAIN_TYPE (t)->flag_nottext) + ++/* Is HIGH_BOUND a low-bound relative count (1) or the high bound itself (0)? */ ++ ++#define TYPE_RANGE_HIGH_BOUND_IS_COUNT(range_type) \ ++ (TYPE_MAIN_TYPE (range_type)->flag_range_high_bound_is_count) ++ ++/* Not allocated. TYPE_ALLOCATED(t) must be NULL in such case. If this flag ++ is unset and TYPE_ALLOCATED(t) is NULL then the type is allocated. If this ++ flag is unset and TYPE_ALLOCATED(t) is not NULL then its DWARF block ++ determines the actual allocation state. */ ++ ++#define TYPE_NOT_ALLOCATED(t) (TYPE_MAIN_TYPE (t)->flag_not_allocated) ++ ++/* Not associated. TYPE_ASSOCIATED(t) must be NULL in such case. If this flag ++ is unset and TYPE_ASSOCIATED(t) is NULL then the type is associated. If ++ this flag is unset and TYPE_ASSOCIATED(t) is not NULL then its DWARF block ++ determines the actual association state. */ ++ ++#define TYPE_NOT_ASSOCIATED(t) (TYPE_MAIN_TYPE (t)->flag_not_associated) ++ ++/* Address of the actual data as for DW_AT_data_location. Its dwarf block must ++ not be evaluated unless both TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are ++ false. If TYPE_DATA_LOCATION_IS_ADDR set then TYPE_DATA_LOCATION_ADDR value ++ is the actual data address value. If unset and ++ TYPE_DATA_LOCATION_DWARF_BLOCK is NULL then the value is the normal ++ VALUE_ADDRESS copy. If unset and TYPE_DATA_LOCATION_DWARF_BLOCK is not NULL ++ then its DWARF block determines the actual data address. */ ++ ++#define TYPE_DATA_LOCATION_IS_ADDR(t) \ ++ (TYPE_MAIN_TYPE (t)->flag_data_location_is_addr) ++ + /* Constant type. If this is set, the corresponding type has a + * const modifier. + */ +@@ -352,6 +387,11 @@ struct main_type + unsigned int flag_stub_supported : 1; + unsigned int flag_nottext : 1; + unsigned int flag_fixed_instance : 1; ++ unsigned int flag_dynamic : 1; ++ unsigned int flag_range_high_bound_is_count : 1; ++ unsigned int flag_not_allocated : 1; ++ unsigned int flag_not_associated : 1; ++ unsigned int flag_data_location_is_addr : 1; + + /* Number of fields described for this type. This field appears at + this location because it packs nicely here. */ +@@ -414,6 +454,20 @@ struct main_type + + struct type *target_type; + ++ /* For DW_AT_data_location. */ ++ union ++ { ++ struct dwarf2_locexpr_baton *dwarf_block; ++ CORE_ADDR addr; ++ } ++ data_location; ++ ++ /* For DW_AT_allocated. */ ++ struct dwarf2_locexpr_baton *allocated; ++ ++ /* For DW_AT_associated. */ ++ struct dwarf2_locexpr_baton *associated; ++ + /* For structure and union types, a description of each field. + For set and pascal array types, there is one "field", + whose type is the domain type of the set or array. +@@ -795,9 +849,9 @@ extern void allocate_cplus_struct_type (struct type *); + #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type + #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type + #define TYPE_CHAIN(thistype) (thistype)->chain +-/* Note that if thistype is a TYPEDEF type, you have to call check_typedef. +- But check_typedef does set the TYPE_LENGTH of the TYPEDEF type, +- so you only have to call check_typedef once. Since allocate_value ++/* Note that if thistype is a TYPEDEF, ARRAY or STRING type, you have to call ++ check_typedef. But check_typedef does set the TYPE_LENGTH of the TYPEDEF ++ type, so you only have to call check_typedef once. Since allocate_value + calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */ + #define TYPE_LENGTH(thistype) (thistype)->length + #define TYPE_OBJFILE(thistype) TYPE_MAIN_TYPE(thistype)->objfile +@@ -807,23 +861,44 @@ extern void allocate_cplus_struct_type (struct type *); + #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields + #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->fields + #define TYPE_TEMPLATE_ARGS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->template_args ++#define TYPE_DATA_LOCATION_DWARF_BLOCK(thistype) TYPE_MAIN_TYPE (thistype)->data_location.dwarf_block ++#define TYPE_DATA_LOCATION_ADDR(thistype) TYPE_MAIN_TYPE (thistype)->data_location.addr ++#define TYPE_ALLOCATED(thistype) TYPE_MAIN_TYPE (thistype)->allocated ++#define TYPE_ASSOCIATED(thistype) TYPE_MAIN_TYPE (thistype)->associated + + #define TYPE_INDEX_TYPE(type) TYPE_FIELD_TYPE (type, 0) + #define TYPE_LOW_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 0) + #define TYPE_HIGH_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 1) +- +-/* Moto-specific stuff for FORTRAN arrays */ +- +-#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \ +- (TYPE_FIELD_ARTIFICIAL(TYPE_INDEX_TYPE((arraytype)),1)) ++#define TYPE_BYTE_STRIDE(range_type) TYPE_FIELD_BITPOS (range_type, 2) ++ ++/* Whether we should use TYPE_FIELD_DWARF_BLOCK (and not TYPE_FIELD_BITPOS). */ ++#define TYPE_RANGE_BOUND_IS_DWARF_BLOCK(range_type, fieldno) \ ++ (TYPE_FIELD_LOC_KIND (range_type, fieldno) == FIELD_LOC_KIND_DWARF_BLOCK) ++#define TYPE_RANGE_BOUND_SET_DWARF_BLOCK(range_type, fieldno) \ ++ (TYPE_FIELD_LOC_KIND (range_type, fieldno) = FIELD_LOC_KIND_DWARF_BLOCK) ++#define TYPE_ARRAY_BOUND_IS_DWARF_BLOCK(array_type, fieldno) \ ++ TYPE_RANGE_BOUND_IS_DWARF_BLOCK (TYPE_INDEX_TYPE (array_type), fieldno) ++ ++/* Unbound arrays, such as GCC array[]; at end of struct. */ +#define TYPE_RANGE_LOWER_BOUND_IS_UNDEFINED(rangetype) \ + TYPE_FIELD_ARTIFICIAL((rangetype),0) +#define TYPE_RANGE_UPPER_BOUND_IS_UNDEFINED(rangetype) \ + TYPE_FIELD_ARTIFICIAL((rangetype),1) #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \ -- (TYPE_FIELD_ARTIFICIAL((TYPE_FIELD_TYPE((arraytype),0)),0)) +- (TYPE_FIELD_ARTIFICIAL(TYPE_INDEX_TYPE((arraytype)),0)) - -#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ -- (TYPE_FIELD_BITPOS((TYPE_FIELD_TYPE((arraytype),0)),1)) +- (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) + TYPE_RANGE_LOWER_BOUND_IS_UNDEFINED (TYPE_INDEX_TYPE (arraytype)) +#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \ + TYPE_RANGE_UPPER_BOUND_IS_UNDEFINED (TYPE_INDEX_TYPE (arraytype)) #define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \ -- (TYPE_FIELD_BITPOS((TYPE_FIELD_TYPE((arraytype),0)),0)) +- (TYPE_LOW_BOUND(TYPE_INDEX_TYPE((arraytype)))) + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (arraytype)) +#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ + TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (arraytype)) +/* TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (arraytype)) with a fallback to the + element size if no specific stride value is known. */ +#define TYPE_ARRAY_BYTE_STRIDE_VALUE(arraytype) \ -+ (TYPE_NFIELDS (TYPE_INDEX_TYPE (arraytype)) < 2 \ ++ (TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (arraytype)) == 0 \ + ? TYPE_LENGTH (TYPE_TARGET_TYPE (arraytype)) \ + : TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (arraytype))) /* C++ */ -@@ -1162,12 +1208,26 @@ extern struct type *make_function_type (struct type *, struct type **); - - extern struct type *lookup_function_type (struct type *); - -+extern struct type *create_range_type_nfields (struct type *result_type, -+ struct type *index_type, -+ int nfields); -+ - extern struct type *create_range_type (struct type *, struct type *, int, - int); - +@@ -1078,6 +1153,16 @@ extern struct type *builtin_type_error; + (TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) \ + : MIN_OF_SIZE(TYPE_LENGTH(t))) + ++/* Virtual OBJFILE used for builtin types. */ ++#define OBJFILE_INTERNAL ((struct objfile *) 1L) ++ ++/* Virtual OBJFILE used for types allocated by malloc. FIXME: Currently ++ backward compatible with the old NULL value; fix then also init_type. */ ++#define OBJFILE_MALLOC ((struct objfile *) 0L) ++ ++#define OBJFILE_IS_VIRTUAL(objfile) ((objfile) == OBJFILE_INTERNAL \ ++ || (objfile) == OBJFILE_MALLOC) ++ + /* Allocate space for storing data associated with a particular type. + We ensure that the space is allocated using the same mechanism that + was used to allocate the space for the type structure itself. I.E. +@@ -1087,18 +1172,18 @@ extern struct type *builtin_type_error; + builtin types), then the data space will be allocated with xmalloc, + the same as for the type structure. */ + +-#define TYPE_ALLOC(t,size) \ +- (TYPE_OBJFILE (t) != NULL \ +- ? obstack_alloc (&TYPE_OBJFILE (t) -> objfile_obstack, size) \ +- : xmalloc (size)) ++#define TYPE_ALLOC(t,size) \ ++ (OBJFILE_IS_VIRTUAL (TYPE_OBJFILE (t)) \ ++ ? xmalloc (size) \ ++ : obstack_alloc (&TYPE_OBJFILE (t) -> objfile_obstack, size)) + +-#define TYPE_ZALLOC(t,size) \ +- (TYPE_OBJFILE (t) != NULL \ +- ? memset (obstack_alloc (&TYPE_OBJFILE (t)->objfile_obstack, size), \ +- 0, size) \ +- : xzalloc (size)) ++#define TYPE_ZALLOC(t,size) \ ++ (OBJFILE_IS_VIRTUAL (TYPE_OBJFILE (t)) \ ++ ? xzalloc (size) \ ++ : memset (obstack_alloc (&TYPE_OBJFILE (t)->objfile_obstack, size), \ ++ 0, size)) + +-extern struct type *alloc_type (struct objfile *); ++extern struct type *alloc_type (struct objfile *, struct type *); + + extern struct type *init_type (enum type_code, int, int, char *, + struct objfile *); +@@ -1172,6 +1257,16 @@ extern struct type *create_range_type (struct type *, struct type *, int, extern struct type *create_array_type (struct type *, struct type *, struct type *); @@ -2047,19 +3076,67 @@ index 333eb31..a925dac 100644 extern struct type *create_string_type (struct type *, struct type *); extern struct type *create_set_type (struct type *, struct type *); +@@ -1263,10 +1358,15 @@ extern void maintenance_print_type (char *, int); + + extern htab_t create_copied_types_hash (struct objfile *objfile); + +-extern struct type *copy_type_recursive (struct objfile *objfile, +- struct type *type, ++extern struct type *copy_type_recursive (struct type *type, + htab_t copied_types); + + extern struct type *copy_type (const struct type *type); + ++extern void type_incref (struct type *type); ++ ++extern void type_decref (struct type *type); ++ ++extern void free_all_types (void); ++ + #endif /* GDBTYPES_H */ +diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c +index 0728866..cc82cb4 100644 +--- a/gdb/jv-lang.c ++++ b/gdb/jv-lang.c +@@ -302,7 +302,7 @@ type_from_class (struct value *clas) + if (type != NULL) + return type; + +- type = alloc_type (objfile); ++ type = alloc_type (objfile, NULL); + TYPE_CODE (type) = TYPE_CODE_STRUCT; + INIT_CPLUS_SPECIFIC (type); + +diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c +index 7cbcc59..e507c3b 100644 +--- a/gdb/mdebugread.c ++++ b/gdb/mdebugread.c +@@ -4696,7 +4696,7 @@ new_type (char *name) + { + struct type *t; + +- t = alloc_type (current_objfile); ++ t = alloc_type (current_objfile, NULL); + TYPE_NAME (t) = name; + TYPE_CPLUS_SPECIFIC (t) = (struct cplus_struct_type *) &cplus_struct_default; + return t; +diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c +index b905a9e..83c6b48 100644 +--- a/gdb/mi/mi-main.c ++++ b/gdb/mi/mi-main.c +@@ -1317,6 +1317,7 @@ mi_cmd_execute (struct mi_parse *parse) + struct cleanup *cleanup; + int i; + free_all_values (); ++ free_all_types (); + + current_token = xstrdup (parse->token); + cleanup = make_cleanup (free_current_contents, ¤t_token); diff --git a/gdb/printcmd.c b/gdb/printcmd.c -index 6d6b915..2ab5a56 100644 +index a51ba68..55a39f5 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -43,6 +43,7 @@ - #include "disasm.h" - #include "dfp.h" - #include "valprint.h" -+#include "exceptions.h" - - #ifdef TUI - #include "tui/tui.h" /* For tui_active et.al. */ -@@ -876,6 +877,11 @@ print_command_1 (char *exp, int inspect, int voidprint) +@@ -878,6 +878,11 @@ print_command_1 (char *exp, int inspect, int voidprint) else val = access_value_history (0); @@ -2071,382 +3148,35 @@ index 6d6b915..2ab5a56 100644 if (voidprint || (val && value_type (val) && TYPE_CODE (value_type (val)) != TYPE_CODE_VOID)) { -@@ -1731,17 +1737,30 @@ disable_display_command (char *args, int from_tty) - - - /* Print the value in stack frame FRAME of a variable specified by a -- struct symbol. */ -+ struct symbol. Printed value gets terminated by a newline. */ - - void --print_variable_value (struct symbol *var, struct frame_info *frame, -- struct ui_file *stream) -+print_variable_value_nl (struct symbol *var, struct frame_info *frame, -+ struct ui_file *stream) - { -- struct value *val = read_var_value (var, frame); -- struct value_print_options opts; -+ struct value *val = NULL; /* A false GCC warning. */ -+ struct gdb_exception e; - -- get_user_print_options (&opts); -- value_print (val, stream, &opts); -+ TRY_CATCH (e, RETURN_MASK_ERROR) -+ { -+ val = read_var_value (var, frame); -+ } -+ if (e.reason < 0) -+ exception_print (stream, e); -+ else -+ { -+ struct value_print_options opts; -+ -+ get_user_print_options (&opts); -+ value_print (val, stream, &opts); -+ -+ fputc_filtered ('\n', stream); -+ } - } - - static void -diff --git a/gdb/stack.c b/gdb/stack.c -index 3c1019b..79afba4 100644 ---- a/gdb/stack.c -+++ b/gdb/stack.c -@@ -1378,8 +1378,7 @@ print_block_frame_locals (struct block *b, struct frame_info *frame, - fputs_filtered ("\t", stream); - fputs_filtered (SYMBOL_PRINT_NAME (sym), stream); - fputs_filtered (" = ", stream); -- print_variable_value (sym, frame, stream); -- fprintf_filtered (stream, "\n"); -+ print_variable_value_nl (sym, frame, stream); - break; +diff --git a/gdb/stabsread.c b/gdb/stabsread.c +index 3457784..976a5a7 100644 +--- a/gdb/stabsread.c ++++ b/gdb/stabsread.c +@@ -322,7 +322,7 @@ dbx_alloc_type (int typenums[2], struct objfile *objfile) - default: -@@ -1591,8 +1590,7 @@ print_frame_arg_vars (struct frame_info *frame, struct ui_file *stream) + if (typenums[0] == -1) + { +- return (alloc_type (objfile)); ++ return (alloc_type (objfile, NULL)); + } - sym2 = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), - b, VAR_DOMAIN, NULL); -- print_variable_value (sym2, frame, stream); -- fprintf_filtered (stream, "\n"); -+ print_variable_value_nl (sym2, frame, stream); - } + type_addr = dbx_lookup_type (typenums); +@@ -332,7 +332,7 @@ dbx_alloc_type (int typenums[2], struct objfile *objfile) + We will fill it in later if we find out how. */ + if (*type_addr == 0) + { +- *type_addr = alloc_type (objfile); ++ *type_addr = alloc_type (objfile, NULL); } -diff --git a/gdb/testsuite/gdb.base/vla-overflow.c b/gdb/testsuite/gdb.base/vla-overflow.c + return (*type_addr); +diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S new file mode 100644 -index 0000000..c5d5ee0 +index 0000000..66f7a39 --- /dev/null -+++ b/gdb/testsuite/gdb.base/vla-overflow.c -@@ -0,0 +1,30 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 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 -+ -+int -+main (int argc, char **argv) -+{ -+ int array[argc]; -+ -+ array[0] = array[0]; -+ -+ abort (); -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/vla-overflow.exp b/gdb/testsuite/gdb.base/vla-overflow.exp -new file mode 100644 -index 0000000..7203a48 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/vla-overflow.exp -@@ -0,0 +1,108 @@ -+# Copyright 2008 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 . -+ -+# We could crash in: -+# #0 block_linkage_function (bl=0x0) at ../../gdb/block.c:69 -+# #1 in dwarf_block_get_frame_base (...) at ../../gdb/dwarf2block.c:97 -+# 97 framefunc = block_linkage_function (get_frame_block (frame, NULL)); -+# #2 in execute_stack_op (...) at ../../gdb/dwarf2expr.c:496 -+# #3 in dwarf_block_exec_core () at ../../gdb/dwarf2block.c:156 -+# #4 dwarf_block_exec (...) at ../../gdb/dwarf2block.c:206 -+# #5 in range_type_count_bound_internal (...) at ../../gdb/gdbtypes.c:1430 -+# #6 in create_array_type (...) at ../../gdb/gdbtypes.c:840 -+# ... -+# #21 in psymtab_to_symtab (...) at ../../gdb/symfile.c:292 -+# ... -+# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273 -+ -+set testfile vla-overflow -+set shfile ${objdir}/${subdir}/${testfile}-gdb.sh -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+set f [open "|getconf PAGESIZE" "r"] -+gets $f pagesize -+close $f -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+set pid_of_gdb [exp_pid -i [board_info host fileid]] -+ -+if { [runto_main] < 0 } { -+ untested vla-overflow -+ return -1 -+} -+ -+# Get the GDB memory size when we stay at main. -+ -+proc memory_v_pages_get {} { -+ global pid_of_gdb pagesize -+ set fd [open "/proc/$pid_of_gdb/statm"] -+ gets $fd line -+ close $fd -+ # number of pages of virtual memory -+ scan $line "%d" drs -+ return $drs -+} -+ -+set pages_found [memory_v_pages_get] -+ -+set mb_reserve 10 -+verbose -log "pages_found = $pages_found, mb_reserve = $mb_reserve" -+set kb_found [expr $pages_found * $pagesize / 1024] -+set kb_permit [expr $kb_found + 1 * 1024 + $mb_reserve * 1024] -+verbose -log "kb_found = $kb_found, kb_permit = $kb_permit" -+ -+# Create the ulimit wrapper. -+set f [open $shfile "w"] -+puts $f "#! /bin/sh" -+puts $f "ulimit -v $kb_permit" -+puts $f "exec $GDB \"\$@\"" -+close $f -+remote_exec host "chmod +x $shfile" -+ -+gdb_exit -+set GDBold $GDB -+set GDB "$shfile" -+gdb_start -+set GDB $GDBold -+ -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+set pid_of_gdb [exp_pid -i [board_info host fileid]] -+ -+# Check the size again after the second run. -+# We must not stop in main as it would cache `array' and never crash later. -+ -+gdb_run_cmd -+ -+verbose -log "kb_found before abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" -+ -+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()" -+ -+verbose -log "kb_found in abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" -+ -+# `abort' can get expressed as `*__GI_abort'. -+gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()" -+ -+verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" -diff --git a/gdb/testsuite/gdb.base/vla.c b/gdb/testsuite/gdb.base/vla.c -new file mode 100644 -index 0000000..e1f3ed1 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/vla.c -@@ -0,0 +1,55 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 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 -+ -+void -+marker (void) -+{ -+} -+ -+void -+bar (char *a, char *b, char *c, int size) -+{ -+ memset (a, '1', size); -+ memset (b, '2', size); -+ memset (c, '3', 48); -+} -+ -+void -+foo (int size) -+{ -+ char temp1[size]; -+ char temp3[48]; -+ -+ temp1[size - 1] = '\0'; -+ { -+ char temp2[size]; -+ -+ bar (temp1, temp2, temp3, size); -+ -+ marker (); /* break-here */ -+ } -+} -+ -+int -+main (void) -+{ -+ foo (26); -+ foo (78); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/vla.exp b/gdb/testsuite/gdb.base/vla.exp -new file mode 100644 -index 0000000..5da7378 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/vla.exp -@@ -0,0 +1,62 @@ -+# Copyright 2008 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 . -+ -+set testfile vla -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+if ![runto_main] { -+ untested vla -+ return -1 -+} -+ -+gdb_breakpoint [gdb_get_line_number "break-here"] -+ -+gdb_continue_to_breakpoint "break-here" -+ -+gdb_test "whatis temp1" "type = char \\\[variable\\\]" "first: whatis temp1" -+gdb_test "whatis temp2" "type = char \\\[variable\\\]" "first: whatis temp2" -+gdb_test "whatis temp3" "type = char \\\[48\\\]" "first: whatis temp3" -+ -+gdb_test "ptype temp1" "type = char \\\[26\\\]" "first: ptype temp1" -+gdb_test "ptype temp2" "type = char \\\[26\\\]" "first: ptype temp2" -+gdb_test "ptype temp3" "type = char \\\[48\\\]" "first: ptype temp3" -+ -+gdb_test "p temp1" " = '1' " "first: print temp1" -+gdb_test "p temp2" " = '2' " "first: print temp2" -+gdb_test "p temp3" " = '3' " "first: print temp3" -+ -+gdb_continue_to_breakpoint "break-here" -+ -+gdb_test "whatis temp1" "type = char \\\[variable\\\]" "second: whatis temp1" -+gdb_test "whatis temp2" "type = char \\\[variable\\\]" "second: whatis temp2" -+gdb_test "whatis temp3" "type = char \\\[48\\\]" "second: whatis temp3" -+ -+gdb_test "ptype temp1" "type = char \\\[78\\\]" "second: ptype temp1" -+gdb_test "ptype temp2" "type = char \\\[78\\\]" "second: ptype temp2" -+gdb_test "ptype temp3" "type = char \\\[48\\\]" "second: ptype temp3" -+ -+gdb_test "p temp1" " = '1' " "second: print temp1" -+gdb_test "p temp2" " = '2' " "second: print temp2" -+gdb_test "p temp3" " = '3' " "second: print temp3" -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-func.S b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-func.S -new file mode 100644 -index 0000000..aae5b56 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-func.S -@@ -0,0 +1,336 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 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 -+ -+void -+func (void) -+{ -+ int i; -+ -+ abort (); -+} -+*/ -+ .file "dw2-loclist-prelinked.c" ++++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S +@@ -0,0 +1,455 @@ ++ .file "x86_64-vla-typedef.c" + .section .debug_abbrev,"",@progbits +.Ldebug_abbrev0: + .section .debug_info,"",@progbits @@ -2455,22 +3185,70 @@ index 0000000..aae5b56 +.Ldebug_line0: + .text +.Ltext0: -+.globl func -+ .type func, @function -+func: ++.globl foo ++ .type foo, @function ++foo: +.LFB2: -+ .file 1 "dw2-loclist-prelinked.c" -+ .loc 1 5 0 -+ pushl %ebp ++ .file 1 "x86_64-vla-typedef.c" ++ .loc 1 22 0 ++ pushq %rbp +.LCFI0: -+ movl %esp, %ebp ++ movq %rsp, %rbp +.LCFI1: -+ subl $24, %esp ++ subq $64, %rsp +.LCFI2: -+ .loc 1 8 0 -+ call abort ++ movl %edi, -36(%rbp) ++ .loc 1 22 0 ++ movq %rsp, %rax ++ movq %rax, -48(%rbp) ++ .loc 1 23 0 ++ movl -36(%rbp), %edx ++ movslq %edx,%rax ++ subq $1, %rax ++ movq %rax, -24(%rbp) ++ .loc 1 24 0 ++ movslq %edx,%rax ++ addq $15, %rax ++ addq $15, %rax ++ shrq $4, %rax ++ salq $4, %rax ++ subq %rax, %rsp ++ movq %rsp, -56(%rbp) ++ movq -56(%rbp), %rax ++ addq $15, %rax ++ shrq $4, %rax ++ salq $4, %rax ++ movq %rax, -56(%rbp) ++ movq -56(%rbp), %rax ++ movq %rax, -16(%rbp) ++ .loc 1 27 0 ++ movl $0, -4(%rbp) ++ jmp .L2 ++.L3: ++ .loc 1 28 0 ++ movl -4(%rbp), %esi ++ movl -4(%rbp), %eax ++ movl %eax, %ecx ++ movq -16(%rbp), %rdx ++ movslq %esi,%rax ++ movb %cl, (%rdx,%rax) ++ .loc 1 27 0 ++ addl $1, -4(%rbp) ++.L2: ++ movl -4(%rbp), %eax ++ cmpl -36(%rbp), %eax ++ jl .L3 ++ .loc 1 30 0 ++ .globl break_here ++break_here: ++ movq -16(%rbp), %rax ++ movb $0, (%rax) ++ movq -48(%rbp), %rsp ++ .loc 1 31 0 ++ leave ++ ret +.LFE2: -+ .size func, .-func ++ .size foo, .-foo + .section .debug_frame,"",@progbits +.Lframe0: + .long .LECIE0-.LSCIE0 @@ -2479,140 +3257,190 @@ index 0000000..aae5b56 + .byte 0x1 + .string "" + .uleb128 0x1 -+ .sleb128 -4 -+ .byte 0x8 ++ .sleb128 -8 ++ .byte 0x10 + .byte 0xc -+ .uleb128 0x4 -+ .uleb128 0x4 -+ .byte 0x88 ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 + .uleb128 0x1 -+ .align 4 ++ .align 8 +.LECIE0: +.LSFDE0: + .long .LEFDE0-.LASFDE0 +.LASFDE0: + .long .Lframe0 ++ .quad .LFB2 ++ .quad .LFE2-.LFB2 ++ .byte 0x4 ++ .long .LCFI0-.LFB2 ++ .byte 0xe ++ .uleb128 0x10 ++ .byte 0x86 ++ .uleb128 0x2 ++ .byte 0x4 ++ .long .LCFI1-.LCFI0 ++ .byte 0xd ++ .uleb128 0x6 ++ .align 8 ++.LEFDE0: ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "zR" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .uleb128 0x1 ++ .byte 0x3 ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .align 8 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe1 + .long .LFB2 + .long .LFE2-.LFB2 ++ .uleb128 0x0 + .byte 0x4 + .long .LCFI0-.LFB2 + .byte 0xe -+ .uleb128 0x8 -+ .byte 0x85 ++ .uleb128 0x10 ++ .byte 0x86 + .uleb128 0x2 + .byte 0x4 + .long .LCFI1-.LCFI0 + .byte 0xd -+ .uleb128 0x5 -+ .align 4 -+.LEFDE0: ++ .uleb128 0x6 ++ .align 8 ++.LEFDE1: + .text +.Letext0: -+#if 0 /* FRAMEBASE_MISSING */ + .section .debug_loc,"",@progbits +.Ldebug_loc0: +.LLST0: -+ .long .LFB2-.Ltext0 -+ .long .LCFI0-.Ltext0 -+ .value 0x2 -+ .byte 0x74 -+ .sleb128 4 -+ .long .LCFI0-.Ltext0 -+ .long .LCFI1-.Ltext0 ++ .quad .LFB2-.Ltext0 ++ .quad .LCFI0-.Ltext0 + .value 0x2 -+ .byte 0x74 ++ .byte 0x77 + .sleb128 8 -+ .long .LCFI1-.Ltext0 -+ .long .LFE2-.Ltext0 ++ .quad .LCFI0-.Ltext0 ++ .quad .LCFI1-.Ltext0 + .value 0x2 -+ .byte 0x75 -+ .sleb128 8 -+ .long 0x0 -+ .long 0x0 -+#endif /* FRAMEBASE_MISSING */ ++ .byte 0x77 ++ .sleb128 16 ++ .quad .LCFI1-.Ltext0 ++ .quad .LFE2-.Ltext0 ++ .value 0x2 ++ .byte 0x76 ++ .sleb128 16 ++ .quad 0x0 ++ .quad 0x0 + .section .debug_info -+ .long .Ldebug_info_end - .Ldebug_info_start -+.Ldebug_info_start: ++ .long .Ldebug_end - .Ldebug_start ++.Ldebug_start: + .value 0x2 + .long .Ldebug_abbrev0 -+ .byte 0x4 -+ .uleb128 0x1 -+ .long .LASF10 -+ .byte 0x1 -+ .long .LASF11 -+ .long .LASF12 -+ .long .Ltext0 -+ .long .Letext0 -+ .long .Ldebug_line0 -+ .uleb128 0x2 -+ .byte 0x4 -+ .byte 0x7 -+ .long .LASF0 -+ .uleb128 0x3 -+ .byte 0x4 -+ .byte 0x5 -+ .string "int" -+ .uleb128 0x2 -+ .byte 0x4 -+ .byte 0x5 -+ .long .LASF1 -+ .uleb128 0x2 -+ .byte 0x1 + .byte 0x8 ++ .uleb128 0x1 + .long .LASF2 -+ .uleb128 0x2 -+ .byte 0x2 -+ .byte 0x7 ++ .byte 0x1 + .long .LASF3 -+ .uleb128 0x2 -+ .byte 0x4 -+ .byte 0x7 + .long .LASF4 ++ .quad .Ltext0 ++ .quad .Letext0 ++ .long .Ldebug_line0 + .uleb128 0x2 + .byte 0x1 -+ .byte 0x6 ++ .string "foo" ++ .byte 0x1 ++ .byte 0x16 ++ .byte 0x1 ++ .quad .LFB2 ++ .quad .LFE2 ++ .long .LLST0 ++ .long 0x83 ++ .uleb128 0x3 + .long .LASF5 -+ .uleb128 0x2 ++ .byte 0x1 ++ .byte 0x15 ++ .long 0x83 + .byte 0x2 -+ .byte 0x5 -+ .long .LASF6 -+ .uleb128 0x2 -+ .byte 0x8 -+ .byte 0x5 -+ .long .LASF7 -+ .uleb128 0x2 -+ .byte 0x8 -+ .byte 0x7 -+ .long .LASF8 ++ .byte 0x91 ++ .sleb128 -52 ++.Ltag_typedef: + .uleb128 0x4 -+ .byte 0x4 -+ .byte 0x7 -+ .uleb128 0x2 -+ .byte 0x1 -+ .byte 0x6 -+ .long .LASF9 -+ .uleb128 0x5 -+ .byte 0x1 -+ .long .LASF13 ++ .long .LASF6 + .byte 0x1 -+ .byte 0x5 ++ .byte 0x17 ++ .long .Ltag_array_type - .debug_info ++ .uleb128 0x5 /* Abbrev Number: 5 (DW_TAG_variable) */ ++ .long .LASF0 + .byte 0x1 -+ .long .LFB2 -+ .long .LFE2 -+#if 0 /* FRAMEBASE_MISSING */ -+ .long .LLST0 /* DW_AT_frame_base : 0x0 (location list) */ -+#endif /* FRAMEBASE_MISSING */ ++ .byte 0x18 ++#if 1 ++ .long .Ltag_typedef - .debug_info ++#else ++ /* Debugging only: Skip the typedef indirection. */ ++ .long .Ltag_array_type - .debug_info ++#endif ++ /* DW_AT_location: DW_FORM_block1: start */ ++ .byte 0x3 ++ .byte 0x91 ++ .sleb128 -32 ++#if 0 ++ .byte 0x6 /* DW_OP_deref */ ++#else ++ .byte 0x96 /* DW_OP_nop */ ++#endif ++ /* DW_AT_location: DW_FORM_block1: end */ + .uleb128 0x6 + .string "i" + .byte 0x1 -+ .byte 0x6 -+ .long 0x2c ++ .byte 0x19 ++ .long 0x83 + .byte 0x2 + .byte 0x91 -+ .sleb128 -12 ++ .sleb128 -20 + .byte 0x0 ++ .uleb128 0x7 ++ .byte 0x4 ++ .byte 0x5 ++ .string "int" ++.Ltag_array_type: ++ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */ ++ .long 0xa0 + (2f - 1f) /* DW_AT_type: DW_FORM_ref4 */ ++ .long 0x9d + (2f - 1f) /* DW_AT_sibling: DW_FORM_ref4 */ ++1: /* DW_AT_data_location: DW_FORM_block1: start */ ++ .byte 2f - 3f /* length */ ++3: ++ .byte 0x97 /* DW_OP_push_object_address */ ++ .byte 0x6 /* DW_OP_deref */ ++2: /* DW_AT_data_location: DW_FORM_block1: end */ ++ .uleb128 0x9 ++ .long 0x9d + (2b - 1b) /* DW_AT_type: DW_FORM_ref4 */ ++ .byte 0x3 ++ .byte 0x91 ++ .sleb128 -40 ++ .byte 0x6 + .byte 0x0 -+.Ldebug_info_end: ++ .uleb128 0xa ++ .byte 0x8 ++ .byte 0x7 ++ .uleb128 0xb ++ .byte 0x1 ++ .byte 0x6 ++ .long .LASF1 ++ .byte 0x0 ++.Ldebug_end: + .section .debug_abbrev + .uleb128 0x1 + .uleb128 0x11 @@ -2633,58 +3461,70 @@ index 0000000..aae5b56 + .uleb128 0x6 + .byte 0x0 + .byte 0x0 -+ .uleb128 0x2 -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb ++ .uleb128 0x2 ++ .uleb128 0x2e ++ .byte 0x1 ++ .uleb128 0x3f ++ .uleb128 0xc ++ .uleb128 0x3 ++ .uleb128 0x8 ++ .uleb128 0x3a ++ .uleb128 0xb ++ .uleb128 0x3b ++ .uleb128 0xb ++ .uleb128 0x27 ++ .uleb128 0xc ++ .uleb128 0x11 ++ .uleb128 0x1 ++ .uleb128 0x12 ++ .uleb128 0x1 ++ .uleb128 0x40 ++ .uleb128 0x6 ++ .uleb128 0x1 ++ .uleb128 0x13 ++ .byte 0x0 ++ .byte 0x0 + .uleb128 0x3 -+ .uleb128 0xe -+ .byte 0x0 ++ .uleb128 0x5 + .byte 0x0 + .uleb128 0x3 -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb ++ .uleb128 0xe ++ .uleb128 0x3a + .uleb128 0xb -+ .uleb128 0x3e ++ .uleb128 0x3b + .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0x8 ++ .uleb128 0x49 ++ .uleb128 0x13 ++ .uleb128 0x2 ++ .uleb128 0xa + .byte 0x0 + .byte 0x0 + .uleb128 0x4 -+ .uleb128 0x24 ++ .uleb128 0x16 + .byte 0x0 ++ .uleb128 0x3 ++ .uleb128 0xe ++ .uleb128 0x3a + .uleb128 0xb ++ .uleb128 0x3b + .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb ++ .uleb128 0x49 ++ .uleb128 0x13 + .byte 0x0 + .byte 0x0 + .uleb128 0x5 -+ .uleb128 0x2e -+ .byte 0x1 -+ .uleb128 0x3f -+ .uleb128 0xc ++ .uleb128 0x34 ++ .byte 0x0 + .uleb128 0x3 + .uleb128 0xe + .uleb128 0x3a + .uleb128 0xb + .uleb128 0x3b + .uleb128 0xb -+ .uleb128 0x27 -+ .uleb128 0xc -+ .uleb128 0x11 -+ .uleb128 0x1 -+ .uleb128 0x12 -+ .uleb128 0x1 -+#if 0 /* FRAMEBASE_MISSING */ -+ .uleb128 0x40 -+ .uleb128 0x6 -+#endif /* FRAMEBASE_MISSING */ ++ .uleb128 0x49 ++ .uleb128 0x13 ++ .uleb128 0x2 ++ .uleb128 0xa + .byte 0x0 + .byte 0x0 + .uleb128 0x6 @@ -2702,64 +3542,370 @@ index 0000000..aae5b56 + .uleb128 0xa + .byte 0x0 + .byte 0x0 ++ .uleb128 0x7 ++ .uleb128 0x24 ++ .byte 0x0 ++ .uleb128 0xb ++ .uleb128 0xb ++ .uleb128 0x3e ++ .uleb128 0xb ++ .uleb128 0x3 ++ .uleb128 0x8 ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */ ++ .uleb128 0x1 ++ .byte 0x1 ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x1 /* DW_AT_sibling */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x50 /* DW_AT_data_location */ ++ .uleb128 0xa /* DW_FORM_block1 */ ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x9 ++ .uleb128 0x21 ++ .byte 0x0 ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x2f ++ .uleb128 0xa ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0xa ++ .uleb128 0x24 ++ .byte 0x0 ++ .uleb128 0xb ++ .uleb128 0xb ++ .uleb128 0x3e ++ .uleb128 0xb ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0xb ++ .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 0x17 ++ .long 0x16 + .value 0x2 + .long .Ldebug_info0 -+ .long 0x98 -+ .long 0x75 -+ .string "func" ++ .long 0xa8 ++ .long 0x2d ++ .string "foo" + .long 0x0 + .section .debug_aranges,"",@progbits -+ .long 0x1c ++ .long 0x2c + .value 0x2 + .long .Ldebug_info0 -+ .byte 0x4 ++ .byte 0x8 + .byte 0x0 + .value 0x0 + .value 0x0 -+ .long .Ltext0 -+ .long .Letext0-.Ltext0 -+ .long 0x0 -+ .long 0x0 ++ .quad .Ltext0 ++ .quad .Letext0-.Ltext0 ++ .quad 0x0 ++ .quad 0x0 + .section .debug_str,"MS",@progbits,1 -+.LASF7: -+ .string "long long int" +.LASF0: -+ .string "unsigned int" -+.LASF11: -+ .string "dw2-framebase-missing-func.c" -+.LASF12: -+ .string "gdb-6.8/gdb/testsuite/gdb.dwarf2" -+.LASF4: -+ .string "long unsigned int" -+.LASF8: -+ .string "long long unsigned int" -+.LASF2: -+ .string "unsigned char" -+.LASF9: -+ .string "char" -+.LASF1: -+ .string "long int" -+.LASF3: -+ .string "short unsigned int" ++ .string "array" +.LASF5: -+ .string "signed char" -+.LASF10: -+ .string "GNU C 4.3.2 20081007 (Red Hat 4.3.2-6)" -+.LASF13: -+ .string "func" ++ .string "size" ++.LASF3: ++ .string "x86_64-vla-typedef.c" +.LASF6: -+ .string "short int" -+ .ident "GCC: (GNU) 4.3.2 20081007 (Red Hat 4.3.2-6)" ++ .string "array_t" ++.LASF1: ++ .string "char" ++.LASF4: ++ .string "gdb.arch" ++.LASF2: ++ .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)" ++ .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)" + .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-main.c b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-main.c +diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +new file mode 100644 +index 0000000..b809c4e +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +@@ -0,0 +1,43 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 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 0 ++ ++void ++foo (int size) ++{ ++ typedef char array_t[size]; ++ array_t array; ++ int i; ++ ++ for (i = 0; i < size; i++) ++ array[i] = i; ++ ++ array[0] = 0; /* break-here */ ++} ++ ++#else ++ ++int ++main (void) ++{ ++ foo (26); ++ foo (78); ++ return 0; ++} ++ ++#endif +diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +new file mode 100644 +index 0000000..b05411e +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +@@ -0,0 +1,64 @@ ++# 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_AT_data_location accessed through DW_TAG_typedef intermediate. ++ ++if ![istarget "x86_64-*-*"] then { ++ verbose "Skipping over gdb.arch/x86_64-vla-typedef.exp test made only for x86_64." ++ return ++} ++ ++set testfile x86_64-vla-typedef ++set srcasmfile ${testfile}-foo.S ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++set binobjfile ${objdir}/${subdir}/${testfile}-foo.o ++if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] { ++ untested x86_64-vla-typedef ++ return -1 ++} ++ ++gdb_breakpoint "break_here" ++ ++gdb_continue_to_breakpoint "break_here" ++ ++gdb_test "whatis array" "type = array_t" "first: whatis array" ++ ++gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array" ++ ++gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'" ++gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'" ++gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'" ++gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'" ++ ++gdb_continue_to_breakpoint "break_here" ++ ++gdb_test "whatis array" "type = array_t" "second: whatis array" ++ ++gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" +diff --git a/gdb/testsuite/gdb.base/vla-overflow.c b/gdb/testsuite/gdb.base/vla-overflow.c +new file mode 100644 +index 0000000..c5d5ee0 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla-overflow.c +@@ -0,0 +1,30 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 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 ++ ++int ++main (int argc, char **argv) ++{ ++ int array[argc]; ++ ++ array[0] = array[0]; ++ ++ abort (); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/vla-overflow.exp b/gdb/testsuite/gdb.base/vla-overflow.exp +new file mode 100644 +index 0000000..7203a48 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla-overflow.exp +@@ -0,0 +1,108 @@ ++# Copyright 2008 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 . ++ ++# We could crash in: ++# #0 block_linkage_function (bl=0x0) at ../../gdb/block.c:69 ++# #1 in dwarf_block_get_frame_base (...) at ../../gdb/dwarf2block.c:97 ++# 97 framefunc = block_linkage_function (get_frame_block (frame, NULL)); ++# #2 in execute_stack_op (...) at ../../gdb/dwarf2expr.c:496 ++# #3 in dwarf_block_exec_core () at ../../gdb/dwarf2block.c:156 ++# #4 dwarf_block_exec (...) at ../../gdb/dwarf2block.c:206 ++# #5 in range_type_count_bound_internal (...) at ../../gdb/gdbtypes.c:1430 ++# #6 in create_array_type (...) at ../../gdb/gdbtypes.c:840 ++# ... ++# #21 in psymtab_to_symtab (...) at ../../gdb/symfile.c:292 ++# ... ++# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273 ++ ++set testfile vla-overflow ++set shfile ${objdir}/${subdir}/${testfile}-gdb.sh ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++set f [open "|getconf PAGESIZE" "r"] ++gets $f pagesize ++close $f ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++set pid_of_gdb [exp_pid -i [board_info host fileid]] ++ ++if { [runto_main] < 0 } { ++ untested vla-overflow ++ return -1 ++} ++ ++# Get the GDB memory size when we stay at main. ++ ++proc memory_v_pages_get {} { ++ global pid_of_gdb pagesize ++ set fd [open "/proc/$pid_of_gdb/statm"] ++ gets $fd line ++ close $fd ++ # number of pages of virtual memory ++ scan $line "%d" drs ++ return $drs ++} ++ ++set pages_found [memory_v_pages_get] ++ ++set mb_reserve 10 ++verbose -log "pages_found = $pages_found, mb_reserve = $mb_reserve" ++set kb_found [expr $pages_found * $pagesize / 1024] ++set kb_permit [expr $kb_found + 1 * 1024 + $mb_reserve * 1024] ++verbose -log "kb_found = $kb_found, kb_permit = $kb_permit" ++ ++# Create the ulimit wrapper. ++set f [open $shfile "w"] ++puts $f "#! /bin/sh" ++puts $f "ulimit -v $kb_permit" ++puts $f "exec $GDB \"\$@\"" ++close $f ++remote_exec host "chmod +x $shfile" ++ ++gdb_exit ++set GDBold $GDB ++set GDB "$shfile" ++gdb_start ++set GDB $GDBold ++ ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++set pid_of_gdb [exp_pid -i [board_info host fileid]] ++ ++# Check the size again after the second run. ++# We must not stop in main as it would cache `array' and never crash later. ++ ++gdb_run_cmd ++ ++verbose -log "kb_found before abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" ++ ++gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()" ++ ++verbose -log "kb_found in abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" ++ ++# `abort' can get expressed as `*__GI_abort'. ++gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()" ++ ++verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" +diff --git a/gdb/testsuite/gdb.base/vla.c b/gdb/testsuite/gdb.base/vla.c new file mode 100644 -index 0000000..d4ad8eb +index 0000000..e1f3ed1 --- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-main.c -@@ -0,0 +1,26 @@ ++++ b/gdb/testsuite/gdb.base/vla.c +@@ -0,0 +1,55 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2008 Free Software Foundation, Inc. @@ -2777,68 +3923,70 @@ index 0000000..d4ad8eb + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + -+/* dw2-framebase-missing-func.S */ -+extern void func (void); ++#include ++ ++void ++marker (void) ++{ ++} ++ ++void ++bar (char *a, char *b, char *c, int size) ++{ ++ memset (a, '1', size); ++ memset (b, '2', size); ++ memset (c, '3', 48); ++} ++ ++void ++foo (int size) ++{ ++ char temp1[size]; ++ char temp3[48]; ++ ++ temp1[size - 1] = '\0'; ++ { ++ char temp2[size]; ++ ++ bar (temp1, temp2, temp3, size); ++ ++ marker (); /* break-here */ ++ } ++} + +int +main (void) +{ -+ func (); ++ foo (26); ++ foo (78); + return 0; +} -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing.exp b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing.exp +diff --git a/gdb/testsuite/gdb.base/vla.exp b/gdb/testsuite/gdb.base/vla.exp new file mode 100644 -index 0000000..8d047bb +index 0000000..5da7378 --- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing.exp -@@ -0,0 +1,83 @@ ++++ b/gdb/testsuite/gdb.base/vla.exp +@@ -0,0 +1,62 @@ +# Copyright 2008 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 2 of the License, or ++# 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, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# Minimal DWARF-2 unit test -+ -+# This test can only be run on i386/x86_64 targets which support DWARF-2. -+# For now pick a sampling of likely targets. -+if {(![istarget *-*-linux*] -+ && ![istarget *-*-gnu*] -+ && ![istarget *-*-elf*] -+ && ![istarget *-*-openbsd*]) -+ || (![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"])} { -+ return 0 -+} ++# along with this program. If not, see . + -+set testfile "dw2-framebase-missing" -+set srcfuncfile ${testfile}-func.S -+set srcmainfile ${testfile}-main.c ++set testfile vla ++set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} -+ -+remote_exec build "rm -f ${binfile}" -+ -+# get the value of gcc_compiled -+if [get_compiler_info ${binfile}] { -+ return -1 -+} -+ -+# This test can only be run on gcc as we use additional_flags=FIXME -+if {$gcc_compiled == 0} { -+ return 0 -+} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcmainfile} ${srcdir}/${subdir}/${srcfuncfile}" \ -+ "${binfile}" executable [list debug additional_flags=-m32]] != "" } { ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" + return -1 +} + @@ -2847,34 +3995,40 @@ index 0000000..8d047bb +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + -+gdb_run_cmd ++if ![runto_main] { ++ untested vla ++ return -1 ++} + -+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()" ++gdb_breakpoint [gdb_get_line_number "break-here"] + -+# Incorrect: -+# #0 0x00110430 in __kernel_vsyscall () -+# No symbol table info available. -+# #1 0x003d44c0 in raise () from /lib/libc.so.6 -+# No symbol table info available. -+# #2 0x003d5e88 in abort () from /lib/libc.so.6 -+# No symbol table info available. -+# #3 0x44f10437 in func () at dw2-framebase-missing.c:8 -+# i = Could not find the frame base for "func". -+ -+# Correct: -+# #0 0x00110430 in __kernel_vsyscall () -+# No symbol table info available. -+# #1 0x003d44c0 in raise () from /lib/libc.so.6 -+# No symbol table info available. -+# #2 0x003d5e88 in abort () from /lib/libc.so.6 -+# No symbol table info available. -+# #3 0x4ae36437 in func () at dw2-framebase-missing.c:8 -+# i = Could not find the frame base for "func". -+# #4 0x0804851a in main () at ../../../gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-main.c:24 -+# No locals. ++gdb_continue_to_breakpoint "break-here" + -+# `abort' can get expressed as `*__GI_abort'. -+gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\ti = Could not find the frame base for \"func\".\r\n.*in main \\(.*" "Backtrace after abort()" ++gdb_test "whatis temp1" "type = char \\\[variable\\\]" "first: whatis temp1" ++gdb_test "whatis temp2" "type = char \\\[variable\\\]" "first: whatis temp2" ++gdb_test "whatis temp3" "type = char \\\[48\\\]" "first: whatis temp3" ++ ++gdb_test "ptype temp1" "type = char \\\[26\\\]" "first: ptype temp1" ++gdb_test "ptype temp2" "type = char \\\[26\\\]" "first: ptype temp2" ++gdb_test "ptype temp3" "type = char \\\[48\\\]" "first: ptype temp3" ++ ++gdb_test "p temp1" " = '1' " "first: print temp1" ++gdb_test "p temp2" " = '2' " "first: print temp2" ++gdb_test "p temp3" " = '3' " "first: print temp3" ++ ++gdb_continue_to_breakpoint "break-here" ++ ++gdb_test "whatis temp1" "type = char \\\[variable\\\]" "second: whatis temp1" ++gdb_test "whatis temp2" "type = char \\\[variable\\\]" "second: whatis temp2" ++gdb_test "whatis temp3" "type = char \\\[48\\\]" "second: whatis temp3" ++ ++gdb_test "ptype temp1" "type = char \\\[78\\\]" "second: ptype temp1" ++gdb_test "ptype temp2" "type = char \\\[78\\\]" "second: ptype temp2" ++gdb_test "ptype temp3" "type = char \\\[48\\\]" "second: ptype temp3" ++ ++gdb_test "p temp1" " = '1' " "second: print temp1" ++gdb_test "p temp2" " = '2' " "second: print temp2" ++gdb_test "p temp3" " = '3' " "second: print temp3" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.c b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c new file mode 100644 index 0000000..1f02d90 @@ -3010,10 +4164,10 @@ index 0000000..1c6e84a + "step" diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp new file mode 100644 -index 0000000..91f47d7 +index 0000000..77a1203 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/dynamic.exp -@@ -0,0 +1,141 @@ +@@ -0,0 +1,156 @@ +# Copyright 2007 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -3148,6 +4302,8 @@ index 0000000..91f47d7 +# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7) +# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7. +gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?" ++gdb_test "p varz" "\\$\[0-9\]* = \\(\\)" ++gdb_test "p vart" "\\$\[0-9\]* = \\(\\)" +gdb_test "p varz(3)" "\\$\[0-9\]* = 4" +# maps to foo::vary(1,1) +gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8" @@ -3155,12 +4311,25 @@ index 0000000..91f47d7 +gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9" +# maps to foo::vary(1,3) +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10" ++ ++set test "quit #1" ++gdb_test_multiple "quit" $test { ++ -re "The program is running. Quit anyway \\(and kill it\\)\\? \\(y or n\\) " { ++ pass $test ++ } ++} ++set test "quit #2" ++gdb_test_multiple "y" $test { ++ eof { ++ pass $test ++ } ++} diff --git a/gdb/testsuite/gdb.fortran/dynamic.f90 b/gdb/testsuite/gdb.fortran/dynamic.f90 new file mode 100644 -index 0000000..9dd7ce0 +index 0000000..0f43564 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/dynamic.f90 -@@ -0,0 +1,97 @@ +@@ -0,0 +1,98 @@ +! Copyright 2007 Free Software Foundation, Inc. +! +! This program is free software; you can redistribute it and/or modify @@ -3186,20 +4355,20 @@ index 0000000..9dd7ce0 + real, pointer :: varv (:, :, :) + real, target :: varu (1, 2, 3) + logical :: l -+ allocate (varx (1:6, 5:15, 17:28)) ! varx-init ++ allocate (varx (1:6, 5:15, 17:28)) ! varx-init + l = allocated (varx) -+ varx(:, :, :) = 6 ! varx-allocated ++ varx(:, :, :) = 6 ! varx-allocated + varx(1, 5, 17) = 7 + varx(2, 6, 18) = 8 + varx(6, 15, 28) = 9 -+ varv => varx ! varx-filled ++ varv => varx ! varx-filled + l = associated (varv) -+ varv(3, 7, 19) = 10 ! varv-associated -+ varv => null () ! varv-filled ++ varv(3, 7, 19) = 10 ! varv-associated ++ varv => null () ! varv-filled + l = associated (varv) -+ deallocate (varx) ! varv-deassociated ++ deallocate (varx) ! varv-deassociated + l = allocated (varx) -+ varu(:, :, :) = 10 ! varx-deallocated ++ varu(:, :, :) = 10 ! varx-deallocated + allocate (varv (1:6, 5:15, 17:28)) + l = associated (varv) + varv(:, :, :) = 6 @@ -3216,19 +4385,20 @@ index 0000000..9dd7ce0 +subroutine foo (vary, varw) + real :: vary (:, :) + real :: varw (:, :, :) -+ vary(:, :) = 4 ! vary-passed ++ vary(:, :) = 4 ! vary-passed + vary(1, 1) = 8 + vary(2, 2) = 9 + vary(1, 3) = 10 -+ varw(:, :, :) = 5 ! vary-filled ++ varw(:, :, :) = 5 ! vary-filled + varw(1, 1, 1) = 6 -+ varw(2, 2, 2) = 7 ! varw-almostfilled ++ varw(2, 2, 2) = 7 ! varw-almostfilled +end subroutine foo +subroutine bar (varz, vart) + real :: varz (*) + real :: vart (2:11, 7:*) + varz(1:3) = 4 -+ varz(2) = 5 ! varz-almostfilled ++ varz(2) = 5 ! varz-almostfilled ++ vart(2,7) = vart(2,7) +end subroutine bar +program test + interface @@ -3260,10 +4430,10 @@ index 0000000..9dd7ce0 +end diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/string.exp new file mode 100644 -index 0000000..b1120c3 +index 0000000..ab72206 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/string.exp -@@ -0,0 +1,59 @@ +@@ -0,0 +1,72 @@ +# Copyright 2008 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -3323,9 +4493,22 @@ index 0000000..b1120c3 +gdb_continue_to_breakpoint "var-finish" +gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set" +gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set" ++ ++set test "quit #1" ++gdb_test_multiple "quit" $test { ++ -re "The program is running. Quit anyway \\(and kill it\\)\\? \\(y or n\\) " { ++ pass $test ++ } ++} ++set test "quit #2" ++gdb_test_multiple "y" $test { ++ eof { ++ pass $test ++ } ++} diff --git a/gdb/testsuite/gdb.fortran/string.f90 b/gdb/testsuite/gdb.fortran/string.f90 new file mode 100644 -index 0000000..66cd98f +index 0000000..226dc5d --- /dev/null +++ b/gdb/testsuite/gdb.fortran/string.f90 @@ -0,0 +1,37 @@ @@ -3356,29 +4539,41 @@ index 0000000..66cd98f + character (len=*) :: f (1:7, 8:10) + c = 'c' + d = 'd' -+ e = 'e' ! var-init ++ e = 'e' ! var-init + f = 'f' + f(1,9) = 'f2' -+ c = 'c' ! var-finish ++ c = 'c' ! var-finish +end subroutine foo + character (len=4) :: g, h (1:7, 8:10) + g = 'g' + h = 'h' + call foo (g, h) +end +diff --git a/gdb/top.c b/gdb/top.c +index d5ef706..6045e21 100644 +--- a/gdb/top.c ++++ b/gdb/top.c +@@ -377,6 +377,7 @@ execute_command (char *p, int from_tty) + } + + free_all_values (); ++ free_all_types (); + + /* Force cleanup of any alloca areas if using C alloca instead of + a builtin alloca. */ diff --git a/gdb/typeprint.c b/gdb/typeprint.c -index edf87cd..174fb58 100644 +index 1f824fa..60a4c5b 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c -@@ -34,6 +34,7 @@ - #include "typeprint.h" +@@ -35,6 +35,7 @@ #include "gdb_string.h" + #include "exceptions.h" #include "valprint.h" +#include "dwarf2loc.h" #include extern void _initialize_typeprint (void); -@@ -75,6 +76,9 @@ void +@@ -76,6 +77,9 @@ void type_print (struct type *type, char *varstring, struct ui_file *stream, int show) { @@ -3388,7 +4583,7 @@ index edf87cd..174fb58 100644 LA_PRINT_TYPE (type, varstring, stream, show, 0); } -@@ -86,7 +90,8 @@ whatis_exp (char *exp, int show) +@@ -115,7 +119,8 @@ whatis_exp (char *exp, int show) { struct expression *expr; struct value *val; @@ -3398,7 +4593,7 @@ index edf87cd..174fb58 100644 struct type *real_type = NULL; struct type *type; int full = 0; -@@ -97,12 +102,13 @@ whatis_exp (char *exp, int show) +@@ -126,12 +131,13 @@ whatis_exp (char *exp, int show) if (exp) { expr = parse_expression (exp); @@ -3413,7 +4608,7 @@ index edf87cd..174fb58 100644 type = value_type (val); get_user_print_options (&opts); -@@ -139,8 +145,7 @@ whatis_exp (char *exp, int show) +@@ -168,8 +174,7 @@ whatis_exp (char *exp, int show) type_print (type, "", gdb_stdout, show); printf_filtered ("\n"); @@ -3424,7 +4619,7 @@ index edf87cd..174fb58 100644 static void diff --git a/gdb/valarith.c b/gdb/valarith.c -index 59f67d3..f5517ae 100644 +index f38cdb8..8e103cf 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -164,9 +164,9 @@ an integer nor a pointer of the same type.")); @@ -3468,7 +4663,7 @@ index 59f67d3..f5517ae 100644 /* Emit warning unless we have an array of unknown size. An array of unknown size has lowerbound 0 and upperbound -1. */ if (upperbound > -1) -@@ -194,53 +207,62 @@ value_subscript (struct value *array, struct value *idx) +@@ -194,49 +207,52 @@ value_subscript (struct value *array, struct value *idx) c_style = 1; } @@ -3532,17 +4727,7 @@ index 59f67d3..f5517ae 100644 + value_contents (array) + offset, elt_size); + } - if (VALUE_LVAL (array) == lval_internalvar) - VALUE_LVAL (v) = lval_internalvar_component; - else - VALUE_LVAL (v) = VALUE_LVAL (array); -+ - VALUE_ADDRESS (v) = VALUE_ADDRESS (array); -+ /* We need to already adjust the address according to the former type as -+ V will have a different type (ELT_TYPE) which may no longer contain the -+ adjustment code like TYPE_FORTRAN_ARRAY_DATA_LOCATION. */ -+ object_address_get_data (array_type, &VALUE_ADDRESS (v)); -+ + set_value_component_location (v, array); VALUE_REGNUM (v) = VALUE_REGNUM (array); VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array); - set_value_offset (v, value_offset (array) + elt_offs); @@ -3551,7 +4736,7 @@ index 59f67d3..f5517ae 100644 } diff --git a/gdb/valops.c b/gdb/valops.c -index 05e5351..83f15a8 100644 +index 9810f2b..c3a48b4 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -38,6 +38,7 @@ @@ -3562,7 +4747,16 @@ index 05e5351..83f15a8 100644 #include #include "gdb_string.h" -@@ -568,6 +569,49 @@ value_one (struct type *type, enum lval_type lv) +@@ -371,8 +372,6 @@ value_cast (struct type *type, struct value *arg2) + new_length = val_length / element_length; + if (val_length % element_length != 0) + warning (_("array element type size does not divide object size in cast")); +- /* FIXME-type-allocation: need a way to free this type when +- we are done with it. */ + range_type = create_range_type ((struct type *) NULL, + TYPE_TARGET_TYPE (range_type), + low_bound, +@@ -568,6 +567,64 @@ value_one (struct type *type, enum lval_type lv) return val; } @@ -3571,13 +4765,20 @@ index 05e5351..83f15a8 100644 +const char * +object_address_data_not_valid (struct type *type) +{ ++ /* Attributes are present only at the target type of a typedef. Make the ++ call conditional as it would otherwise loop through type_length_get. */ ++ if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF) ++ CHECK_TYPEDEF (type); ++ + /* DW_AT_associated has a preference over DW_AT_allocated. */ -+ if (TYPE_ASSOCIATED (type) != NULL -+ && 0 == dwarf_locexpr_baton_eval (TYPE_ASSOCIATED (type))) ++ if (TYPE_NOT_ASSOCIATED (type) ++ || (TYPE_ASSOCIATED (type) != NULL ++ && 0 == dwarf_locexpr_baton_eval (TYPE_ASSOCIATED (type)))) + return N_("object is not associated"); + -+ if (TYPE_ALLOCATED (type) != NULL -+ && 0 == dwarf_locexpr_baton_eval (TYPE_ALLOCATED (type))) ++ if (TYPE_NOT_ALLOCATED (type) ++ || (TYPE_ALLOCATED (type) != NULL ++ && 0 == dwarf_locexpr_baton_eval (TYPE_ALLOCATED (type)))) + return N_("object is not allocated"); + + return NULL; @@ -3596,6 +4797,11 @@ index 05e5351..83f15a8 100644 + gdb_assert (address_return != NULL); + + object_address_set (*address_return); ++ ++ /* TYPE_DATA_LOCATION_DWARF_BLOCK / TYPE_DATA_LOCATION_ADDR are present only ++ at the target type of a typedef. */ ++ CHECK_TYPEDEF (type); ++ + if (object_address_data_not_valid (type) != NULL) + { + /* Do not try to evaluate DW_AT_data_location as it may even crash @@ -3603,8 +4809,11 @@ index 05e5351..83f15a8 100644 + return 0; + } + -+ if (TYPE_DATA_LOCATION (type) != NULL) -+ *address_return = dwarf_locexpr_baton_eval (TYPE_DATA_LOCATION (type)); ++ if (TYPE_DATA_LOCATION_IS_ADDR (type)) ++ *address_return = TYPE_DATA_LOCATION_ADDR (type); ++ else if (TYPE_DATA_LOCATION_DWARF_BLOCK (type) != NULL) ++ *address_return ++ = dwarf_locexpr_baton_eval (TYPE_DATA_LOCATION_DWARF_BLOCK (type)); + + return 1; +} @@ -3612,18 +4821,16 @@ index 05e5351..83f15a8 100644 /* Return a value with type TYPE located at ADDR. Call value_at only if the data needs to be fetched immediately; -@@ -637,11 +681,21 @@ value_fetch_lazy (struct value *val) +@@ -637,11 +694,19 @@ value_fetch_lazy (struct value *val) allocate_value_contents (val); if (VALUE_LVAL (val) == lval_memory) { - CORE_ADDR addr = VALUE_ADDRESS (val) + value_offset (val); - int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); -+ CORE_ADDR addr; -+ int length; ++ CORE_ADDR addr = VALUE_ADDRESS (val); - if (length) - read_memory (addr, value_contents_all_raw (val), length); -+ addr = VALUE_ADDRESS (val); + if (object_address_get_data (value_type (val), &addr)) + { + struct type *type = value_enclosing_type (val); @@ -3638,7 +4845,17 @@ index 05e5351..83f15a8 100644 } else if (VALUE_LVAL (val) == lval_register) { -@@ -1085,6 +1139,7 @@ struct value * +@@ -1036,7 +1101,8 @@ address_of_variable (struct symbol *var, struct block *b) + + val = value_of_variable (var, b); + +- if ((VALUE_LVAL (val) == lval_memory && value_lazy (val)) ++ if ((VALUE_LVAL (val) == lval_memory && value_lazy (val) ++ && object_address_get_data (type, &VALUE_ADDRESS (val))) + || TYPE_CODE (type) == TYPE_CODE_FUNC) + { + CORE_ADDR addr = VALUE_ADDRESS (val); +@@ -1145,6 +1211,7 @@ struct value * value_coerce_array (struct value *arg1) { struct type *type = check_typedef (value_type (arg1)); @@ -3646,7 +4863,7 @@ index 05e5351..83f15a8 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 -@@ -1094,8 +1149,12 @@ value_coerce_array (struct value *arg1) +@@ -1154,8 +1221,12 @@ value_coerce_array (struct value *arg1) if (VALUE_LVAL (arg1) != lval_memory) error (_("Attempt to take address of value not located in memory.")); @@ -3660,11 +4877,170 @@ index 05e5351..83f15a8 100644 } /* Given a value which is a function, return a value which is a pointer +@@ -2989,8 +3060,6 @@ value_slice (struct value *array, int lowbound, int length) + || lowbound + length - 1 > upperbound) + error (_("slice out of range")); + +- /* FIXME-type-allocation: need a way to free this type when we are +- done with it. */ + slice_range_type = create_range_type ((struct type *) NULL, + TYPE_TARGET_TYPE (range_type), + lowbound, +diff --git a/gdb/value.c b/gdb/value.c +index 4d4329e..47739c9 100644 +--- a/gdb/value.c ++++ b/gdb/value.c +@@ -225,7 +225,9 @@ allocate_value_lazy (struct type *type) + val->next = all_values; + all_values = val; + val->type = type; ++ type_incref (type); + val->enclosing_type = type; ++ type_incref (type); + VALUE_LVAL (val) = not_lval; + VALUE_ADDRESS (val) = 0; + VALUE_FRAME_ID (val) = null_frame_id; +@@ -269,13 +271,9 @@ struct value * + allocate_repeat_value (struct type *type, int count) + { + int low_bound = current_language->string_lower_bound; /* ??? */ +- /* FIXME-type-allocation: need a way to free this type when we are +- done with it. */ + struct type *range_type + = create_range_type ((struct type *) NULL, builtin_type_int32, + low_bound, count + low_bound - 1); +- /* FIXME-type-allocation: need a way to free this type when we are +- done with it. */ + return allocate_value (create_array_type ((struct type *) NULL, + type, range_type)); + } +@@ -335,6 +333,8 @@ value_type (struct value *value) + void + deprecated_set_value_type (struct value *value, struct type *type) + { ++ type_incref (type); ++ type_decref (value->type); + value->type = type; + } + +@@ -552,6 +552,9 @@ value_free (struct value *val) + { + if (val) + { ++ type_decref (val->type); ++ type_decref (val->enclosing_type); ++ + if (VALUE_LVAL (val) == lval_computed) + { + struct lval_funcs *funcs = val->location.computed.funcs; +@@ -655,6 +658,8 @@ value_copy (struct value *arg) + val = allocate_value_lazy (encl_type); + else + val = allocate_value (encl_type); ++ type_incref (arg->type); ++ type_decref (val->type); + val->type = arg->type; + VALUE_LVAL (val) = VALUE_LVAL (arg); + val->location = arg->location; +@@ -693,6 +698,7 @@ set_value_component_location (struct value *component, struct value *whole) + VALUE_LVAL (component) = VALUE_LVAL (whole); + + component->location = whole->location; ++ + if (VALUE_LVAL (whole) == lval_computed) + { + struct lval_funcs *funcs = whole->location.computed.funcs; +@@ -700,6 +706,8 @@ set_value_component_location (struct value *component, struct value *whole) + if (funcs->copy_closure) + component->location.computed.closure = funcs->copy_closure (whole); + } ++ ++ object_address_get_data (value_type (whole), &VALUE_ADDRESS (component)); + } + + +@@ -830,6 +838,25 @@ show_values (char *num_exp, int from_tty) + num_exp[1] = '\0'; + } + } ++ ++/* Sanity check for memory leaks and proper types reference counting. */ ++ ++static void ++value_history_cleanup (void *unused) ++{ ++ while (value_history_chain) ++ { ++ struct value_history_chunk *chunk = value_history_chain; ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE (chunk->values); i++) ++ value_free (chunk->values[i]); ++ ++ value_history_chain = chunk->next; ++ xfree (chunk); ++ } ++ value_history_count = 0; ++} + + /* Internal variables. These are variables within the debugger + that hold values assigned by debugger commands. +@@ -1067,12 +1094,21 @@ preserve_one_value (struct value *value, struct objfile *objfile, + htab_t copied_types) + { + if (TYPE_OBJFILE (value->type) == objfile) +- value->type = copy_type_recursive (objfile, value->type, copied_types); ++ { ++ /* No need to decref the old type here, since we know it has no ++ reference count. */ ++ value->type = copy_type_recursive (value->type, copied_types); ++ type_incref (value->type); ++ } + + if (TYPE_OBJFILE (value->enclosing_type) == objfile) +- value->enclosing_type = copy_type_recursive (objfile, +- value->enclosing_type, +- copied_types); ++ { ++ /* No need to decref the old type here, since we know it has no ++ reference count. */ ++ value->enclosing_type = copy_type_recursive (value->enclosing_type, ++ copied_types); ++ type_incref (value->enclosing_type); ++ } + } + + /* Update the internal variables and value history when OBJFILE is +@@ -1461,6 +1497,8 @@ value_static_field (struct type *type, int fieldno) + struct value * + value_change_enclosing_type (struct value *val, struct type *new_encl_type) + { ++ type_incref (new_encl_type); ++ type_decref (val->enclosing_type); + if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val))) + val->contents = + (gdb_byte *) xrealloc (val->contents, TYPE_LENGTH (new_encl_type)); +@@ -1516,6 +1554,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))); + } ++ type_incref (type); ++ type_decref (v->type); + v->type = type; + v->offset = value_offset (arg1); + v->embedded_offset = (offset + value_embedded_offset (arg1) +@@ -1944,4 +1984,6 @@ init-if-undefined VARIABLE = EXPRESSION\n\ + Set an internal VARIABLE to the result of the EXPRESSION if it does not\n\ + exist or does not contain a value. The EXPRESSION is not evaluated if the\n\ + VARIABLE is already initialized.")); ++ ++ make_final_cleanup (value_history_cleanup, NULL); + } diff --git a/gdb/value.h b/gdb/value.h -index a882004..f6aece1 100644 +index aa43365..ad5306a 100644 --- a/gdb/value.h +++ b/gdb/value.h -@@ -286,6 +286,10 @@ extern struct value *value_from_decfloat (struct type *type, +@@ -348,6 +348,10 @@ extern struct value *value_from_decfloat (struct type *type, const gdb_byte *decbytes); extern struct value *value_from_string (char *string); @@ -3675,20 +5051,7 @@ index a882004..f6aece1 100644 extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); -@@ -557,9 +561,9 @@ extern int val_print_string (CORE_ADDR addr, int len, int width, - struct ui_file *stream, - const struct value_print_options *options); - --extern void print_variable_value (struct symbol *var, -- struct frame_info *frame, -- struct ui_file *stream); -+extern void print_variable_value_nl (struct symbol *var, -+ struct frame_info *frame, -+ struct ui_file *stream); - - extern int check_field (struct type *, const char *); - -@@ -590,5 +594,7 @@ extern struct value *value_allocate_space_in_inferior (int); +@@ -658,5 +662,7 @@ extern struct value *value_allocate_space_in_inferior (int); extern struct value *value_of_local (const char *name, int complain); diff --git a/gdb-6.8-bz466901-backtrace-full-prelinked.patch b/gdb-6.8-bz466901-backtrace-full-prelinked.patch index 62cf021..9a96ac8 100644 --- a/gdb-6.8-bz466901-backtrace-full-prelinked.patch +++ b/gdb-6.8-bz466901-backtrace-full-prelinked.patch @@ -121,7 +121,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp +# No locals. + +# `abort' can get expressed as `*__GI_abort'. -+gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\ti = -?\[0-9\].*in main \\(.*" "Backtrace after 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.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 diff --git a/gdb-6.8-constant-watchpoints.patch b/gdb-6.8-constant-watchpoints.patch index c3962ae..baa242b 100644 --- a/gdb-6.8-constant-watchpoints.patch +++ b/gdb-6.8-constant-watchpoints.patch @@ -18,11 +18,11 @@ gdb.base/watchpoint.c (global_ptr_ptr): New variable. (func4): New testing code for GLOBAL_PTR_PTR. -Index: gdb-6.8.50.20081128/gdb/breakpoint.c +Index: gdb-6.8.50.20090209/gdb/breakpoint.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/breakpoint.c 2008-12-01 16:13:12.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/breakpoint.c 2008-12-03 00:00:08.000000000 +0100 -@@ -770,7 +770,15 @@ is_hardware_watchpoint (struct breakpoin +--- gdb-6.8.50.20090209.orig/gdb/breakpoint.c 2009-02-09 15:39:01.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/breakpoint.c 2009-02-09 16:04:10.000000000 +0100 +@@ -769,7 +769,15 @@ is_hardware_watchpoint (struct breakpoin If VAL_CHAIN is non-NULL, *VAL_CHAIN will be released from the value chain. The caller must free the values individually. If VAL_CHAIN is NULL, all generated values will be left on the value @@ -39,7 +39,7 @@ Index: gdb-6.8.50.20081128/gdb/breakpoint.c static void fetch_watchpoint_value (struct expression *exp, struct value **valp, -@@ -5824,7 +5832,7 @@ watch_command_1 (char *arg, int accessfl +@@ -5862,7 +5870,7 @@ watch_command_1 (char *arg, int accessfl struct symtab_and_line sal; struct expression *exp; struct block *exp_valid_block; @@ -48,7 +48,7 @@ Index: gdb-6.8.50.20081128/gdb/breakpoint.c struct frame_info *frame; struct frame_info *prev_frame = NULL; char *exp_start = NULL; -@@ -5910,6 +5918,27 @@ watch_command_1 (char *arg, int accessfl +@@ -5954,6 +5962,27 @@ watch_command_1 (char *arg, int accessfl exp_valid_block = innermost_block; mark = value_mark (); fetch_watchpoint_value (exp, &val, NULL, NULL); @@ -76,10 +76,10 @@ Index: gdb-6.8.50.20081128/gdb/breakpoint.c if (val != NULL) release_value (val); -Index: gdb-6.8.50.20081128/gdb/gdbtypes.h +Index: gdb-6.8.50.20090209/gdb/gdbtypes.h =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/gdbtypes.h 2008-12-02 22:53:14.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/gdbtypes.h 2008-12-03 00:00:08.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/gdbtypes.h 2009-02-09 15:51:57.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/gdbtypes.h 2009-02-09 16:04:10.000000000 +0100 @@ -70,7 +70,22 @@ enum type_code TYPE_CODE_UNION, /* C union or Pascal variant part */ TYPE_CODE_ENUM, /* Enumeration type */ @@ -104,11 +104,11 @@ Index: gdb-6.8.50.20081128/gdb/gdbtypes.h TYPE_CODE_INT, /* Integer type */ /* Floating type. This is *NOT* a complex type. Beware, there are parts -Index: gdb-6.8.50.20081128/gdb/doc/gdb.texinfo +Index: gdb-6.8.50.20090209/gdb/doc/gdb.texinfo =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/doc/gdb.texinfo 2008-12-02 23:43:49.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/doc/gdb.texinfo 2008-12-03 00:00:08.000000000 +0100 -@@ -3479,6 +3479,18 @@ This command prints a list of watchpoint +--- gdb-6.8.50.20090209.orig/gdb/doc/gdb.texinfo 2009-02-09 16:02:42.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/doc/gdb.texinfo 2009-02-09 16:04:10.000000000 +0100 +@@ -3480,6 +3480,18 @@ This command prints a list of watchpoint it is the same as @code{info break} (@pxref{Set Breaks}). @end table @@ -127,10 +127,10 @@ Index: gdb-6.8.50.20081128/gdb/doc/gdb.texinfo @value{GDBN} sets a @dfn{hardware watchpoint} if possible. Hardware watchpoints execute very quickly, and the debugger reports a change in value at the exact instruction where the change occurs. If @value{GDBN} -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.c +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.base/watchpoint.c =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.base/watchpoint.c 2008-03-03 14:24:12.000000000 +0100 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.c 2008-12-03 00:00:08.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.base/watchpoint.c 2008-03-03 14:24:12.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/watchpoint.c 2009-02-09 16:04:10.000000000 +0100 @@ -40,6 +40,7 @@ struct foo struct1, struct2, *ptr1, *ptr int doread = 0; @@ -150,10 +150,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.c } int main () -Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.base/watchpoint.exp =================================================================== ---- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.base/watchpoint.exp 2008-08-06 14:52:07.000000000 +0200 -+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.exp 2008-12-03 00:01:07.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.base/watchpoint.exp 2009-01-03 06:58:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/watchpoint.exp 2009-02-09 16:05:03.000000000 +0100 @@ -641,7 +641,21 @@ proc test_watchpoint_and_breakpoint {} { } } @@ -177,9 +177,9 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.exp proc test_inaccessible_watchpoint {} { global gdb_prompt -@@ -650,7 +664,8 @@ proc test_inaccessible_watchpoint {} { +@@ -662,7 +676,8 @@ proc test_inaccessible_watchpoint {} { + } - if [runto func4] then { gdb_test "watch *global_ptr" ".*atchpoint \[0-9\]+: \\*global_ptr" - gdb_test "next" ".*global_ptr = buf.*" + gdb_test "set \$global_ptr_breakpoint_number = \$bpnum" "" @@ -187,7 +187,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.exp gdb_test_multiple "next" "next over ptr init" { -re ".*atchpoint \[0-9\]+: \\*global_ptr\r\n\r\nOld value = .*\r\nNew value = 3 .*\r\n.*$gdb_prompt $" { # We can not test for here because NULL may be readable. -@@ -663,6 +678,28 @@ proc test_inaccessible_watchpoint {} { +@@ -675,6 +690,28 @@ proc test_inaccessible_watchpoint {} { pass "next over buffer set" } } @@ -216,7 +216,7 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.exp } } -@@ -830,6 +867,17 @@ if [initialize] then { +@@ -842,6 +879,17 @@ if [initialize] then { } test_watchpoint_and_breakpoint diff --git a/gdb-6.8-inlining-addon.patch b/gdb-6.8-inlining-addon.patch index a5aa613..66f58cc 100644 --- a/gdb-6.8-inlining-addon.patch +++ b/gdb-6.8-inlining-addon.patch @@ -1,3 +1,10 @@ +infcall.c : +Revert the change of: gdb-6.8-inlining.patch +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.20081214/gdb/testsuite/gdb.opt/inline-bt.c =================================================================== --- gdb-6.8.50.20081214.orig/gdb/testsuite/gdb.opt/inline-bt.c 2009-02-09 13:28:48.000000000 +0100 @@ -597,6 +604,15 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c =================================================================== --- gdb-6.8.50.20081214.orig/gdb/infrun.c 2009-02-09 13:29:51.000000000 +0100 +++ gdb-6.8.50.20081214/gdb/infrun.c 2009-02-09 13:30:16.000000000 +0100 +@@ -1147,8 +1150,6 @@ a command like `return' or `jump' to con + step = 0; + } + +- clear_inline_frame_state (resume_ptid); +- + if (debug_displaced + && use_displaced_stepping (gdbarch) + && tp->trap_expected) @@ -1201,6 +1201,8 @@ clear_proceed_status_thread (struct thre /* Discard any remaining commands or status from previous stop. */ @@ -606,6 +622,24 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c } static int +--- ./gdb/target.c 2009-02-10 23:45:59.000000000 +0100 ++++ ./gdb/target.c 2009-02-10 23:43:29.000000000 +0100 +@@ -41,6 +41,7 @@ + #include "target-descriptions.h" + #include "gdbthread.h" + #include "solib.h" ++#include "inline-frame.h" + + static void target_info (char *, int); + +@@ -1938,6 +1939,7 @@ target_pid_to_str (ptid_t ptid) + void + target_resume (ptid_t ptid, int step, enum target_signal signal) + { ++ clear_inline_frame_state (ptid); + dcache_invalidate (target_dcache); + (*current_target.to_resume) (ptid, step, signal); + set_executing (ptid, 1); Index: gdb-6.8.50.20081214/gdb/inline-frame.h =================================================================== --- gdb-6.8.50.20081214.orig/gdb/inline-frame.h 2009-02-09 13:28:48.000000000 +0100 @@ -621,3 +655,23 @@ Index: gdb-6.8.50.20081214/gdb/inline-frame.h /* Return the number of hidden functions inlined into the current frame. */ +--- gdb-6.8.50.20090209/gdb/infcall.c 2009-02-10 00:16:10.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/infcall.c-removed 2009-02-10 00:15:58.000000000 +0100 +@@ -841,8 +841,15 @@ When the function is done executing, GDB + + if (unwind_on_signal_p) + { +- /* The user wants the context restored. Calling error will +- run inf_status_cleanup, which does all the work. */ ++ /* The user wants the context restored. */ ++ ++ /* We must get back to the frame we were before the ++ dummy call. */ ++ dummy_frame_pop (dummy_id); ++ ++ /* We also need to restore inferior status to that before the ++ dummy call. */ ++ restore_inferior_status (inf_status); + + /* FIXME: Insert a bunch of wrap_here; name can be very + long if it's a C++ name with arguments and stuff. */ diff --git a/gdb-6.8-inlining.patch b/gdb-6.8-inlining.patch index 2da05b8..bcd8587 100644 --- a/gdb-6.8-inlining.patch +++ b/gdb-6.8-inlining.patch @@ -5,24 +5,26 @@ http://sourceware.org/ml/gdb-patches/2008-07/msg00317.html Removed dwarf_expr_frame_base NULL check duplicity with *-vla.patch. -Index: gdb-6.8.50.20081214/gdb/NEWS +Index: gdb-6.8.50.20090209/gdb/NEWS =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/NEWS 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/NEWS 2008-12-14 15:31:03.000000000 +0100 -@@ -26,6 +26,9 @@ completions will be "f1" and "f2". - operators when expanding macros. It also supports variable-arity - macros. +--- gdb-6.8.50.20090209.orig/gdb/NEWS 2009-02-07 16:00:57.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/NEWS 2009-02-09 16:06:54.000000000 +0100 +@@ -1,6 +1,11 @@ + What has changed in GDB? + (Organized release by release) ++*** Fedora changes ++ +* Inlined functions are now supported. They show up in backtraces, and +the "step", "next", and "finish" commands handle them automatically. + - * New remote packets + *** Changes since GDB 6.8 - qSearch:memory: -Index: gdb-6.8.50.20081214/gdb/block.c + * GDB now supports automatic retrieval of shared library files from +Index: gdb-6.8.50.20090209/gdb/block.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/block.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/block.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/block.c 2009-01-03 06:57:50.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/block.c 2009-02-09 16:06:00.000000000 +0100 @@ -47,8 +47,16 @@ contained_in (const struct block *a, con { if (!a || !b) @@ -65,10 +67,10 @@ Index: gdb-6.8.50.20081214/gdb/block.c /* Return the blockvector immediately containing the innermost lexical block containing the specified pc value and section, or 0 if there is none. PBLOCK is a pointer to the block. If PBLOCK is NULL, we -Index: gdb-6.8.50.20081214/gdb/block.h +Index: gdb-6.8.50.20090209/gdb/block.h =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/block.h 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/block.h 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/block.h 2009-01-03 06:57:50.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/block.h 2009-02-09 16:06:00.000000000 +0100 @@ -65,7 +65,7 @@ struct block CORE_ADDR endaddr; @@ -87,10 +89,10 @@ Index: gdb-6.8.50.20081214/gdb/block.h extern int contained_in (const struct block *, const struct block *); extern struct blockvector *blockvector_for_pc (CORE_ADDR, struct block **); -Index: gdb-6.8.50.20081214/gdb/blockframe.c +Index: gdb-6.8.50.20090209/gdb/blockframe.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/blockframe.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/blockframe.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/blockframe.c 2009-01-03 06:57:50.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/blockframe.c 2009-02-09 16:06:00.000000000 +0100 @@ -36,6 +36,7 @@ #include "command.h" #include "gdbcmd.h" @@ -159,11 +161,11 @@ Index: gdb-6.8.50.20081214/gdb/blockframe.c return frame; frame = get_prev_frame (frame); -Index: gdb-6.8.50.20081214/gdb/breakpoint.c +Index: gdb-6.8.50.20090209/gdb/breakpoint.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/breakpoint.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/breakpoint.c 2008-12-14 15:31:03.000000000 +0100 -@@ -2572,19 +2572,21 @@ watchpoint_check (void *p) +--- gdb-6.8.50.20090209.orig/gdb/breakpoint.c 2009-02-09 16:04:10.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/breakpoint.c 2009-02-09 16:06:00.000000000 +0100 +@@ -2615,19 +2615,21 @@ watchpoint_check (void *p) within_current_scope = 1; else { @@ -193,7 +195,7 @@ Index: gdb-6.8.50.20081214/gdb/breakpoint.c /* in_function_epilogue_p() returns a non-zero value if we're still in the function but the stack frame has already been invalidated. -@@ -2596,10 +2598,9 @@ watchpoint_check (void *p) +@@ -2639,10 +2641,9 @@ watchpoint_check (void *p) that the watchpoint frame couldn't be found by frame_find_by_id() because the current PC is currently in an epilogue. Calling gdbarch_in_function_epilogue_p() also when fr == NULL fixes that. */ @@ -206,7 +208,7 @@ Index: gdb-6.8.50.20081214/gdb/breakpoint.c /* If we end up stopping, the current frame will get selected in normal_stop. So this call to select_frame won't affect the user. */ -@@ -2833,7 +2834,7 @@ bpstat_check_breakpoint_conditions (bpst +@@ -2876,7 +2877,7 @@ bpstat_check_breakpoint_conditions (bpst struct breakpoint *b = bl->owner; if (frame_id_p (b->frame_id) @@ -215,7 +217,7 @@ Index: gdb-6.8.50.20081214/gdb/breakpoint.c bs->stop = 0; else if (bs->stop) { -@@ -2848,8 +2849,12 @@ bpstat_check_breakpoint_conditions (bpst +@@ -2891,8 +2892,12 @@ bpstat_check_breakpoint_conditions (bpst if (bl->cond && bl->owner->disposition != disp_del_at_next_stop) { @@ -230,7 +232,7 @@ Index: gdb-6.8.50.20081214/gdb/breakpoint.c select_frame (get_current_frame ()); value_is_zero = catch_errors (breakpoint_cond_eval, (bl->cond), -@@ -4820,6 +4825,11 @@ set_momentary_breakpoint (struct symtab_ +@@ -4862,6 +4867,11 @@ set_momentary_breakpoint (struct symtab_ enum bptype type) { struct breakpoint *b; @@ -242,7 +244,7 @@ Index: gdb-6.8.50.20081214/gdb/breakpoint.c b = set_raw_breakpoint (sal, type); b->enable_state = bp_enabled; b->disposition = disp_donttouch; -@@ -5832,7 +5842,6 @@ watch_command_1 (char *arg, int accessfl +@@ -5872,7 +5882,6 @@ watch_command_1 (char *arg, int accessfl struct block *exp_valid_block; struct value *val, *mark, *val_chain; struct frame_info *frame; @@ -250,7 +252,7 @@ Index: gdb-6.8.50.20081214/gdb/breakpoint.c char *exp_start = NULL; char *exp_end = NULL; char *tok, *id_tok_start, *end_tok; -@@ -5987,34 +5996,34 @@ watch_command_1 (char *arg, int accessfl +@@ -6033,34 +6042,34 @@ watch_command_1 (char *arg, int accessfl bp_type = bp_watchpoint; frame = block_innermost_frame (exp_valid_block); @@ -303,7 +305,7 @@ Index: gdb-6.8.50.20081214/gdb/breakpoint.c } /* Now set up the breakpoint. */ -@@ -6195,7 +6204,6 @@ until_break_command (char *arg, int from +@@ -6241,7 +6250,6 @@ until_break_command (char *arg, int from struct symtabs_and_lines sals; struct symtab_and_line sal; struct frame_info *frame = get_selected_frame (NULL); @@ -311,7 +313,7 @@ Index: gdb-6.8.50.20081214/gdb/breakpoint.c struct breakpoint *breakpoint; struct breakpoint *breakpoint2 = NULL; struct cleanup *old_chain; -@@ -6228,20 +6236,22 @@ until_break_command (char *arg, int from +@@ -6274,20 +6282,22 @@ until_break_command (char *arg, int from we don't specify a frame at which we need to stop. */ breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until); else @@ -340,10 +342,10 @@ Index: gdb-6.8.50.20081214/gdb/breakpoint.c bp_until); make_cleanup_delete_breakpoint (breakpoint2); } -Index: gdb-6.8.50.20081214/gdb/buildsym.c +Index: gdb-6.8.50.20090209/gdb/buildsym.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/buildsym.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/buildsym.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/buildsym.c 2009-01-03 06:57:50.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/buildsym.c 2009-02-09 16:06:00.000000000 +0100 @@ -1159,6 +1159,12 @@ end_symtab (CORE_ADDR end_addr, struct o struct symbol *sym; struct dict_iterator iter; @@ -357,11 +359,11 @@ Index: gdb-6.8.50.20081214/gdb/buildsym.c for (sym = dict_iterator_first (BLOCK_DICT (block), &iter); sym != NULL; sym = dict_iterator_next (&iter)) -Index: gdb-6.8.50.20081214/gdb/doc/gdb.texinfo +Index: gdb-6.8.50.20090209/gdb/doc/gdb.texinfo =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/doc/gdb.texinfo 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/doc/gdb.texinfo 2008-12-14 15:31:03.000000000 +0100 -@@ -147,6 +147,7 @@ software in general. We will miss him. +--- gdb-6.8.50.20090209.orig/gdb/doc/gdb.texinfo 2009-02-09 16:04:10.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/doc/gdb.texinfo 2009-02-09 16:06:00.000000000 +0100 +@@ -137,6 +137,7 @@ software in general. We will miss him. * Stack:: Examining the stack * Source:: Examining source files * Data:: Examining data @@ -369,7 +371,7 @@ Index: gdb-6.8.50.20081214/gdb/doc/gdb.texinfo * Macros:: Preprocessor Macros * Tracepoints:: Debugging remote targets non-intrusively * Overlays:: Debugging programs that use overlays -@@ -1813,7 +1814,7 @@ To request debugging information, specif +@@ -1812,7 +1813,7 @@ To request debugging information, specif the compiler. Programs that are to be shipped to your customers are compiled with @@ -378,7 +380,7 @@ Index: gdb-6.8.50.20081214/gdb/doc/gdb.texinfo compilers are unable to handle the @samp{-g} and @samp{-O} options together. Using those compilers, you cannot generate optimized executables containing debugging information. -@@ -1822,22 +1823,7 @@ executables containing debugging informa +@@ -1821,22 +1822,7 @@ executables containing debugging informa without @samp{-O}, making it possible to debug optimized code. We recommend that you @emph{always} use @samp{-g} whenever you compile a program. You may think your program is correct, but there is no sense @@ -402,7 +404,7 @@ Index: gdb-6.8.50.20081214/gdb/doc/gdb.texinfo Older versions of the @sc{gnu} C compiler permitted a variant option @w{@samp{-gg}} for debugging information. @value{GDBN} no longer supports this -@@ -8271,6 +8257,107 @@ $1 = 1 +@@ -8297,6 +8283,107 @@ $1 = 1 $2 = (void *) 0x8049560 @end smallexample @@ -510,10 +512,10 @@ Index: gdb-6.8.50.20081214/gdb/doc/gdb.texinfo @node Macros @chapter C Preprocessor Macros -Index: gdb-6.8.50.20081214/gdb/dwarf2loc.c +Index: gdb-6.8.50.20090209/gdb/dwarf2loc.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/dwarf2loc.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/dwarf2loc.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/dwarf2loc.c 2009-02-09 15:38:54.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/dwarf2loc.c 2009-02-09 16:06:00.000000000 +0100 @@ -31,6 +31,7 @@ #include "regcache.h" #include "objfiles.h" @@ -534,11 +536,11 @@ Index: gdb-6.8.50.20081214/gdb/dwarf2loc.c /* If we found a frame-relative symbol then it was certainly within some function associated with a frame. If we can't find the frame, -Index: gdb-6.8.50.20081214/gdb/dwarf2read.c +Index: gdb-6.8.50.20090209/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/dwarf2read.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/dwarf2read.c 2008-12-14 15:31:03.000000000 +0100 -@@ -45,6 +45,7 @@ +--- gdb-6.8.50.20090209.orig/gdb/dwarf2read.c 2009-02-09 16:03:46.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/dwarf2read.c 2009-02-09 16:06:00.000000000 +0100 +@@ -46,6 +46,7 @@ #include "hashtab.h" #include "command.h" #include "gdbcmd.h" @@ -546,7 +548,7 @@ Index: gdb-6.8.50.20081214/gdb/dwarf2read.c #include "addrmap.h" #include "top.h" -@@ -2787,12 +2788,8 @@ process_die (struct die_info *die, struc +@@ -2788,12 +2789,8 @@ process_die (struct die_info *die, struc read_file_scope (die, cu); break; case DW_TAG_subprogram: @@ -560,7 +562,7 @@ Index: gdb-6.8.50.20081214/gdb/dwarf2read.c break; case DW_TAG_lexical_block: case DW_TAG_try_block: -@@ -3055,10 +3052,25 @@ read_func_scope (struct die_info *die, s +@@ -3056,10 +3053,25 @@ read_func_scope (struct die_info *die, s CORE_ADDR lowpc; CORE_ADDR highpc; struct die_info *child_die; @@ -587,7 +589,7 @@ Index: gdb-6.8.50.20081214/gdb/dwarf2read.c baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -@@ -6942,6 +6954,9 @@ die_specification (struct die_info *die, +@@ -6949,6 +6961,9 @@ die_specification (struct die_info *die, *spec_cu); if (spec_attr == NULL) @@ -597,7 +599,7 @@ Index: gdb-6.8.50.20081214/gdb/dwarf2read.c return NULL; else return follow_die_ref (die, spec_attr, spec_cu); -@@ -7625,6 +7640,7 @@ new_symbol (struct die_info *die, struct +@@ -7632,6 +7647,7 @@ new_symbol (struct die_info *die, struct struct attribute *attr = NULL; struct attribute *attr2 = NULL; CORE_ADDR baseaddr; @@ -605,7 +607,7 @@ Index: gdb-6.8.50.20081214/gdb/dwarf2read.c baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -@@ -7654,13 +7670,17 @@ new_symbol (struct die_info *die, struct +@@ -7661,13 +7677,17 @@ new_symbol (struct die_info *die, struct SYMBOL_TYPE (sym) = type; else SYMBOL_TYPE (sym) = die_type (die, cu); @@ -625,7 +627,7 @@ Index: gdb-6.8.50.20081214/gdb/dwarf2read.c if (attr) { int file_index = DW_UNSND (attr); -@@ -7707,6 +7727,14 @@ new_symbol (struct die_info *die, struct +@@ -7714,6 +7734,14 @@ new_symbol (struct die_info *die, struct add_symbol_to_list (sym, cu->list_in_scope); } break; @@ -640,7 +642,7 @@ Index: gdb-6.8.50.20081214/gdb/dwarf2read.c case DW_TAG_variable: /* Compilation with minimal debug info may result in variables with missing type entries. Change the misleading `void' type -@@ -7754,7 +7782,14 @@ new_symbol (struct die_info *die, struct +@@ -7761,7 +7789,14 @@ new_symbol (struct die_info *die, struct } break; case DW_TAG_formal_parameter: @@ -656,10 +658,10 @@ Index: gdb-6.8.50.20081214/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_location, cu); if (attr) { -Index: gdb-6.8.50.20081214/gdb/frame-unwind.c +Index: gdb-6.8.50.20090209/gdb/frame-unwind.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/frame-unwind.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/frame-unwind.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/frame-unwind.c 2009-01-03 06:57:51.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/frame-unwind.c 2009-02-09 16:06:00.000000000 +0100 @@ -21,6 +21,7 @@ #include "frame.h" #include "frame-unwind.h" @@ -680,10 +682,10 @@ Index: gdb-6.8.50.20081214/gdb/frame-unwind.c return table; } -Index: gdb-6.8.50.20081214/gdb/frame.c +Index: gdb-6.8.50.20090209/gdb/frame.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/frame.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/frame.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/frame.c 2009-02-09 15:48:46.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/frame.c 2009-02-09 16:06:00.000000000 +0100 @@ -41,8 +41,14 @@ #include "objfiles.h" #include "exceptions.h" @@ -868,7 +870,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c get_frame_func (struct frame_info *this_frame) { struct frame_info *next_frame = this_frame->next; -@@ -1217,7 +1290,6 @@ frame_register_unwind_location (struct f +@@ -1226,7 +1299,6 @@ frame_register_unwind_location (struct f static struct frame_info * get_prev_frame_1 (struct frame_info *this_frame) { @@ -876,7 +878,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c struct frame_id this_id; struct gdbarch *gdbarch; -@@ -1257,6 +1329,14 @@ get_prev_frame_1 (struct frame_info *thi +@@ -1266,6 +1338,14 @@ get_prev_frame_1 (struct frame_info *thi this_frame->prev_p = 1; this_frame->stop_reason = UNWIND_NO_REASON; @@ -891,7 +893,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c /* Check that this frame's ID was valid. If it wasn't, don't try to unwind to the prev frame. Be careful to not apply this test to the sentinel frame. */ -@@ -1324,7 +1404,8 @@ get_prev_frame_1 (struct frame_info *thi +@@ -1333,7 +1413,8 @@ get_prev_frame_1 (struct frame_info *thi if (this_frame->level > 0 && gdbarch_pc_regnum (gdbarch) >= 0 && get_frame_type (this_frame) == NORMAL_FRAME @@ -901,7 +903,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c { int optimized, realnum, nrealnum; enum lval_type lval, nlval; -@@ -1353,6 +1434,17 @@ get_prev_frame_1 (struct frame_info *thi +@@ -1362,6 +1443,17 @@ get_prev_frame_1 (struct frame_info *thi } } @@ -919,7 +921,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c /* Allocate the new frame but do not wire it in to the frame chain. Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along frame->next to pull some fancy tricks (of course such code is, by -@@ -1511,7 +1603,7 @@ get_prev_frame (struct frame_info *this_ +@@ -1484,7 +1576,7 @@ get_prev_frame (struct frame_info *this_ the main function when we created the dummy frame, the dummy frame will point inside the main function. */ if (this_frame->level >= 0 @@ -928,7 +930,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c && !backtrace_past_main && inside_main_func (this_frame)) /* Don't unwind past main(). Note, this is done _before_ the -@@ -1556,8 +1648,9 @@ get_prev_frame (struct frame_info *this_ +@@ -1529,8 +1621,9 @@ get_prev_frame (struct frame_info *this_ from main returns directly to the caller of main. Since we don't stop at main, we should at least stop at the entry point of the application. */ @@ -940,7 +942,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c && inside_entry_func (this_frame)) { frame_debug_got_null_frame (this_frame, "inside entry func"); -@@ -1568,7 +1661,8 @@ get_prev_frame (struct frame_info *this_ +@@ -1541,7 +1634,8 @@ get_prev_frame (struct frame_info *this_ like a SIGSEGV or a dummy frame, and hence that NORMAL frames will never unwind a zero PC. */ if (this_frame->level > 0 @@ -950,7 +952,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME && get_frame_pc (this_frame) == 0) { -@@ -1593,7 +1687,7 @@ CORE_ADDR +@@ -1566,7 +1660,7 @@ CORE_ADDR get_frame_pc (struct frame_info *frame) { gdb_assert (frame->next != NULL); @@ -959,7 +961,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c } /* Return an address that falls within THIS_FRAME's code block. */ -@@ -1638,17 +1732,58 @@ get_frame_address_in_block (struct frame +@@ -1611,17 +1705,58 @@ get_frame_address_in_block (struct frame We check the type of NEXT_FRAME first, since it is already known; frame type is determined by the unwinder, and since we have THIS_FRAME we've already selected an unwinder for @@ -1022,7 +1024,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.c /* If FRAME is not the innermost frame, that normally means that FRAME->pc points at the return instruction (which is *after* the call instruction), and we want to get the line containing the -@@ -1658,15 +1793,8 @@ pc_notcurrent (struct frame_info *frame) +@@ -1631,15 +1766,8 @@ pc_notcurrent (struct frame_info *frame) PC and such a PC indicates the current (rather than next) instruction/line, consequently, for such cases, want to get the line containing fi->pc. */ @@ -1040,19 +1042,10 @@ Index: gdb-6.8.50.20081214/gdb/frame.c } /* Per "frame.h", return the ``address'' of the frame. Code should -@@ -1747,7 +1875,7 @@ get_frame_type (struct frame_info *frame - return frame->unwind->type; - } - --void -+static void - deprecated_update_frame_pc_hack (struct frame_info *frame, CORE_ADDR pc) - { - if (frame_debug) -Index: gdb-6.8.50.20081214/gdb/frame.h +Index: gdb-6.8.50.20090209/gdb/frame.h =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/frame.h 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/frame.h 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/frame.h 2009-02-05 18:28:20.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/frame.h 2009-02-09 16:06:00.000000000 +0100 @@ -34,6 +34,9 @@ frame_unwind_WHAT...(): Unwind THIS frame's WHAT from the NEXT frame. @@ -1106,7 +1099,7 @@ Index: gdb-6.8.50.20081214/gdb/frame.h /* In a signal handler, various OSs handle this in various ways. The main thing is that the frame may be far from normal. */ SIGTRAMP_FRAME, -@@ -340,6 +358,7 @@ extern CORE_ADDR get_frame_base (struct +@@ -345,6 +363,7 @@ extern CORE_ADDR get_frame_base (struct instead, since that avoids the bug. */ extern struct frame_id get_frame_id (struct frame_info *fi); @@ -1114,25 +1107,10 @@ Index: gdb-6.8.50.20081214/gdb/frame.h extern struct frame_id frame_unwind_id (struct frame_info *next_frame); /* Assuming that a frame is `normal', return its base-address, or 0 if -@@ -660,14 +679,6 @@ extern struct frame_info *deprecated_saf - - extern struct frame_info *create_new_frame (CORE_ADDR base, CORE_ADDR pc); - --/* FIXME: cagney/2002-12-06: Has the PC in the current frame changed? -- "infrun.c", Thanks to gdbarch_decr_pc_after_break, can change the PC after -- the initial frame create. This puts things back in sync. -- -- This replaced: frame->pc = ....; */ --extern void deprecated_update_frame_pc_hack (struct frame_info *frame, -- CORE_ADDR pc); -- - /* FIXME: cagney/2002-12-18: Has the frame's base changed? Or to be - more exact, was that initial guess at the frame's base as returned - by the deleted read_fp() wrong? If it was, fix it. This shouldn't -Index: gdb-6.8.50.20081214/gdb/gdbthread.h +Index: gdb-6.8.50.20090209/gdb/gdbthread.h =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/gdbthread.h 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/gdbthread.h 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/gdbthread.h 2009-01-18 18:42:16.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/gdbthread.h 2009-02-09 16:06:00.000000000 +0100 @@ -83,6 +83,13 @@ struct thread_info This is how we know when we step into a subroutine call, and how to set the frame for the breakpoint used to step out. */ @@ -1147,28 +1125,32 @@ Index: gdb-6.8.50.20081214/gdb/gdbthread.h int current_line; struct symtab *current_symtab; -Index: gdb-6.8.50.20081214/gdb/infcall.c +Index: gdb-6.8.50.20090209/gdb/infcall.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/infcall.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/infcall.c 2008-12-14 15:31:03.000000000 +0100 -@@ -734,11 +734,8 @@ The program being debugged exited while +--- gdb-6.8.50.20090209.orig/gdb/infcall.c 2009-01-19 20:05:00.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/infcall.c 2009-02-09 16:08:45.000000000 +0100 +@@ -841,15 +841,8 @@ When the function is done executing, GDB if (unwind_on_signal_p) { - /* The user wants the context restored. */ - - /* We must get back to the frame we were before the -- dummy call. */ -- frame_pop (get_current_frame ()); +- dummy call. */ +- dummy_frame_pop (dummy_id); +- +- /* We also need to restore inferior status to that before the +- dummy call. */ +- restore_inferior_status (inf_status); + /* The user wants the context restored. Calling error will + run inf_status_cleanup, which does all the work. */ /* FIXME: Insert a bunch of wrap_here; name can be very long if it's a C++ name with arguments and stuff. */ -Index: gdb-6.8.50.20081214/gdb/infcmd.c +Index: gdb-6.8.50.20090209/gdb/infcmd.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/infcmd.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/infcmd.c 2008-12-14 15:37:04.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/infcmd.c 2009-01-26 00:35:51.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/infcmd.c 2009-02-09 16:06:00.000000000 +0100 @@ -52,6 +52,7 @@ #include "cli/cli-decode.h" #include "gdbthread.h" @@ -1177,7 +1159,7 @@ Index: gdb-6.8.50.20081214/gdb/infcmd.c /* Functions exported for general use, in inferior.h: */ -@@ -722,6 +723,17 @@ Can't resume all threads and specify pro +@@ -739,6 +740,17 @@ Can't resume all threads and specify pro continue_1 (all_threads); } @@ -1195,7 +1177,7 @@ Index: gdb-6.8.50.20081214/gdb/infcmd.c /* Step until outside of current statement. */ static void -@@ -899,6 +911,20 @@ step_once (int skip_subroutines, int sin +@@ -916,6 +928,20 @@ step_once (int skip_subroutines, int sin THREAD is set. */ struct thread_info *tp = inferior_thread (); clear_proceed_status (); @@ -1216,7 +1198,7 @@ Index: gdb-6.8.50.20081214/gdb/infcmd.c frame = get_current_frame (); tp->step_frame_id = get_frame_id (frame); -@@ -1155,6 +1181,7 @@ until_next_command (int from_tty) +@@ -1168,6 +1194,7 @@ until_next_command (int from_tty) clear_proceed_status (); frame = get_current_frame (); @@ -1224,7 +1206,7 @@ Index: gdb-6.8.50.20081214/gdb/infcmd.c /* Step until either exited from this function or greater than the current line (if in symbolic section) or pc (if -@@ -1182,7 +1209,6 @@ until_next_command (int from_tty) +@@ -1195,7 +1222,6 @@ until_next_command (int from_tty) } tp->step_over_calls = STEP_OVER_ALL; @@ -1232,7 +1214,7 @@ Index: gdb-6.8.50.20081214/gdb/infcmd.c tp->step_multi = 0; /* Only one call to proceed */ -@@ -1515,6 +1541,37 @@ finish_command (char *arg, int from_tty) +@@ -1528,6 +1554,37 @@ finish_command (char *arg, int from_tty) clear_proceed_status (); @@ -1270,11 +1252,11 @@ Index: gdb-6.8.50.20081214/gdb/infcmd.c /* Find the function we will return from. */ function = find_pc_function (get_frame_pc (get_selected_frame (NULL))); -Index: gdb-6.8.50.20081214/gdb/inferior.h +Index: gdb-6.8.50.20090209/gdb/inferior.h =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/inferior.h 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/inferior.h 2008-12-14 15:31:03.000000000 +0100 -@@ -249,6 +249,9 @@ extern void error_is_running (void); +--- gdb-6.8.50.20090209.orig/gdb/inferior.h 2009-02-09 15:39:01.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/inferior.h 2009-02-09 16:06:00.000000000 +0100 +@@ -259,6 +259,9 @@ extern void error_is_running (void); /* Calls error_is_running if the current thread is running. */ extern void ensure_not_running (void); @@ -1284,19 +1266,19 @@ Index: gdb-6.8.50.20081214/gdb/inferior.h /* From infcmd.c */ extern void tty_command (char *, int); -Index: gdb-6.8.50.20081214/gdb/infrun.c +Index: gdb-6.8.50.20090209/gdb/infrun.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/infrun.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/infrun.c 2008-12-14 15:31:03.000000000 +0100 -@@ -45,6 +45,7 @@ - #include "language.h" - #include "solib.h" - #include "main.h" -+#include "inline-frame.h" - +--- gdb-6.8.50.20090209.orig/gdb/infrun.c 2009-02-09 16:02:31.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/infrun.c 2009-02-09 16:09:19.000000000 +0100 +@@ -48,6 +48,7 @@ #include "gdb_assert.h" #include "mi/mi-common.h" -@@ -206,7 +207,7 @@ static unsigned char *signal_program; + #include "event-top.h" ++#include "inline-frame.h" + + /* Prototypes for local functions */ + +@@ -205,7 +206,7 @@ static unsigned char *signal_program; /* Value to pass to target_resume() to cause all threads to resume */ @@ -1305,7 +1287,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c /* Command list pointer for the "stop" placeholder. */ -@@ -1147,6 +1148,8 @@ a command like `return' or `jump' to con +@@ -1146,6 +1147,8 @@ a command like `return' or `jump' to con step = 0; } @@ -1314,7 +1296,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c if (debug_displaced && use_displaced_stepping (gdbarch) && tp->trap_expected) -@@ -1188,6 +1191,7 @@ clear_proceed_status_thread (struct thre +@@ -1187,6 +1190,7 @@ clear_proceed_status_thread (struct thre tp->step_range_start = 0; tp->step_range_end = 0; tp->step_frame_id = null_frame_id; @@ -1322,7 +1304,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c tp->step_over_calls = STEP_OVER_UNDEBUGGABLE; tp->stop_requested = 0; -@@ -1532,6 +1536,9 @@ init_wait_for_inferior (void) +@@ -1531,6 +1535,9 @@ init_wait_for_inferior (void) init_infwait_state (); displaced_step_clear (); @@ -1332,7 +1314,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c } -@@ -1587,7 +1594,7 @@ struct execution_control_state +@@ -1586,7 +1593,7 @@ struct execution_control_state int wait_some_more; }; @@ -1341,7 +1323,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c void handle_inferior_event (struct execution_control_state *ecs); -@@ -1903,10 +1910,21 @@ fetch_inferior_event (void *client_data) +@@ -1944,10 +1951,21 @@ fetch_inferior_event (void *client_data) display_gdb_prompt (0); } @@ -1364,7 +1346,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c init_execution_control_state (struct execution_control_state *ecs) { ecs->random_signal = 0; -@@ -1917,16 +1935,10 @@ init_execution_control_state (struct exe +@@ -1958,16 +1976,10 @@ init_execution_control_state (struct exe void init_thread_stepping_state (struct thread_info *tss) { @@ -1381,7 +1363,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c } /* Return the cached copy of the last pid/waitstatus returned by -@@ -2096,6 +2108,22 @@ ensure_not_running (void) +@@ -2137,6 +2149,22 @@ ensure_not_running (void) error_is_running (); } @@ -1404,7 +1386,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c /* Given an execution control state that has been freshly filled in by an event from the inferior, figure out what it means and take appropriate action. */ -@@ -2787,6 +2815,12 @@ targets should add new threads to the th +@@ -2828,6 +2856,12 @@ targets should add new threads to the th ecs->random_signal = 0; stopped_by_random_signal = 0; @@ -1417,7 +1399,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c if (ecs->event_thread->stop_signal == TARGET_SIGNAL_TRAP && ecs->event_thread->trap_expected && gdbarch_single_step_through_delay_p (current_gdbarch) -@@ -3019,8 +3053,8 @@ process_event_stop_test: +@@ -3060,8 +3094,8 @@ process_event_stop_test: && ecs->event_thread->stop_signal != TARGET_SIGNAL_0 && (ecs->event_thread->step_range_start <= stop_pc && stop_pc < ecs->event_thread->step_range_end) @@ -1428,7 +1410,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c && ecs->event_thread->step_resume_breakpoint == NULL) { /* The inferior is about to take a signal that will take it -@@ -3406,10 +3440,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( +@@ -3447,10 +3481,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( NOTE: frame_id_eq will never report two invalid frame IDs as being equal, so to get into this block, both the current and previous frame must have valid frame IDs. */ @@ -1442,7 +1424,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c || execution_direction == EXEC_REVERSE)) { CORE_ADDR real_stop_pc; -@@ -3652,6 +3686,82 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( +@@ -3693,6 +3727,82 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( return; } @@ -1525,7 +1507,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c if ((stop_pc == stop_pc_sal.pc) && (ecs->event_thread->current_line != stop_pc_sal.line || ecs->event_thread->current_symtab != stop_pc_sal.symtab)) -@@ -3677,9 +3787,7 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( +@@ -3718,9 +3828,7 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( ecs->event_thread->step_range_start = stop_pc_sal.pc; ecs->event_thread->step_range_end = stop_pc_sal.end; @@ -1536,25 +1518,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: keep going\n"); -@@ -4203,17 +4311,6 @@ normal_stop (void) - previous_inferior_ptid = inferior_ptid; - } - -- /* NOTE drow/2004-01-17: Is this still necessary? */ -- /* Make sure that the current_frame's pc is correct. This -- is a correction for setting up the frame info before doing -- gdbarch_decr_pc_after_break */ -- if (target_has_execution) -- /* FIXME: cagney/2002-12-06: Has the PC changed? Thanks to -- gdbarch_decr_pc_after_break, the program counter can change. Ask the -- frame code to check for this and sort out any resultant mess. -- gdbarch_decr_pc_after_break needs to just go away. */ -- deprecated_update_frame_pc_hack (get_current_frame (), read_pc ()); -- - if (!breakpoints_always_inserted_mode () && target_has_execution) - { - if (remove_breakpoints ()) -@@ -4790,6 +4887,7 @@ struct inferior_status +@@ -4987,6 +5095,7 @@ struct inferior_status CORE_ADDR step_range_start; CORE_ADDR step_range_end; struct frame_id step_frame_id; @@ -1562,7 +1526,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c enum step_over_calls_kind step_over_calls; CORE_ADDR step_resume_break_address; int stop_after_trap; -@@ -4828,6 +4926,7 @@ save_inferior_status (int restore_stack_ +@@ -5016,6 +5125,7 @@ save_inferior_status (void) inf_status->step_range_start = tp->step_range_start; inf_status->step_range_end = tp->step_range_end; inf_status->step_frame_id = tp->step_frame_id; @@ -1570,7 +1534,7 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c inf_status->step_over_calls = tp->step_over_calls; inf_status->stop_after_trap = stop_after_trap; inf_status->stop_soon = inf->stop_soon; -@@ -4883,6 +4982,7 @@ restore_inferior_status (struct inferior +@@ -5069,6 +5179,7 @@ restore_inferior_status (struct inferior tp->step_range_start = inf_status->step_range_start; tp->step_range_end = inf_status->step_range_end; tp->step_frame_id = inf_status->step_frame_id; @@ -1578,10 +1542,10 @@ Index: gdb-6.8.50.20081214/gdb/infrun.c tp->step_over_calls = inf_status->step_over_calls; stop_after_trap = inf_status->stop_after_trap; inf->stop_soon = inf_status->stop_soon; -Index: gdb-6.8.50.20081214/gdb/inline-frame.c +Index: gdb-6.8.50.20090209/gdb/inline-frame.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081214/gdb/inline-frame.c 2008-12-14 15:31:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/inline-frame.c 2009-02-09 16:06:00.000000000 +0100 @@ -0,0 +1,382 @@ +/* Inline frame unwinder for GDB. + @@ -1965,10 +1929,10 @@ Index: gdb-6.8.50.20081214/gdb/inline-frame.c + + return inline_count; +} -Index: gdb-6.8.50.20081214/gdb/inline-frame.h +Index: gdb-6.8.50.20090209/gdb/inline-frame.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081214/gdb/inline-frame.h 2008-12-14 15:31:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/inline-frame.h 2009-02-09 16:06:00.000000000 +0100 @@ -0,0 +1,62 @@ +/* Definitions for inline frame support. + @@ -2032,10 +1996,10 @@ Index: gdb-6.8.50.20081214/gdb/inline-frame.h +int frame_inlined_callees (struct frame_info *this_frame); + +#endif /* !defined (INLINE_FRAME_H) */ -Index: gdb-6.8.50.20081214/gdb/minsyms.c +Index: gdb-6.8.50.20090209/gdb/minsyms.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/minsyms.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/minsyms.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/minsyms.c 2009-02-09 16:02:28.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/minsyms.c 2009-02-09 16:06:00.000000000 +0100 @@ -767,7 +767,7 @@ prim_record_minimal_symbol_and_info (con if (msym_bunch_index == BUNCH_SIZE) @@ -2045,10 +2009,10 @@ Index: gdb-6.8.50.20081214/gdb/minsyms.c msym_bunch_index = 0; new->next = msym_bunch; msym_bunch = new; -Index: gdb-6.8.50.20081214/gdb/s390-tdep.c +Index: gdb-6.8.50.20090209/gdb/s390-tdep.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/s390-tdep.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/s390-tdep.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/s390-tdep.c 2009-01-03 06:57:53.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/s390-tdep.c 2009-02-09 16:06:00.000000000 +0100 @@ -1182,6 +1182,7 @@ s390_prologue_frame_unwind_cache (struct CORE_ADDR prev_sp; int frame_pointer; @@ -2082,10 +2046,10 @@ Index: gdb-6.8.50.20081214/gdb/s390-tdep.c || get_frame_type (get_next_frame (this_frame)) != NORMAL_FRAME)) { /* See the comment in s390_in_function_epilogue_p on why this is -Index: gdb-6.8.50.20081214/gdb/stack.c +Index: gdb-6.8.50.20090209/gdb/stack.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/stack.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/stack.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/stack.c 2009-01-26 20:09:58.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/stack.c 2009-02-09 16:06:00.000000000 +0100 @@ -45,6 +45,7 @@ #include "valprint.h" #include "gdbthread.h" @@ -2200,7 +2164,7 @@ Index: gdb-6.8.50.20081214/gdb/stack.c { printf_filtered (" called by frame at "); fputs_filtered (paddress (get_frame_base (calling_frame_info)), -@@ -1453,7 +1493,9 @@ print_frame_local_vars (struct frame_inf +@@ -1449,7 +1489,9 @@ print_frame_local_vars (struct frame_inf if (print_block_frame_locals (block, frame, num_tabs, stream)) values_printed = 1; /* After handling the function's top-level block, stop. Don't @@ -2211,7 +2175,7 @@ Index: gdb-6.8.50.20081214/gdb/stack.c if (BLOCK_FUNCTION (block)) break; block = BLOCK_SUPERBLOCK (block); -@@ -1524,7 +1566,9 @@ print_frame_label_vars (struct frame_inf +@@ -1520,7 +1562,9 @@ print_frame_label_vars (struct frame_inf return; /* After handling the function's top-level block, stop. Don't @@ -2222,7 +2186,7 @@ Index: gdb-6.8.50.20081214/gdb/stack.c if (BLOCK_FUNCTION (block)) break; block = BLOCK_SUPERBLOCK (block); -@@ -1795,6 +1839,9 @@ return_command (char *retval_exp, int fr +@@ -1790,6 +1834,9 @@ return_command (char *retval_exp, int fr thisframe = get_selected_frame ("No selected frame."); thisfun = get_frame_function (thisframe); @@ -2232,10 +2196,10 @@ Index: gdb-6.8.50.20081214/gdb/stack.c /* Compute the return value. If the computation triggers an error, let it bail. If the return type can't be handled, set RETURN_VALUE to NULL, and QUERY_PREFIX to an informational -Index: gdb-6.8.50.20081214/gdb/symtab.c +Index: gdb-6.8.50.20090209/gdb/symtab.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/symtab.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/symtab.c 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/symtab.c 2009-02-09 16:02:29.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/symtab.c 2009-02-09 16:06:00.000000000 +0100 @@ -1373,10 +1373,13 @@ lookup_symbol_aux_local (const char *nam sym = lookup_symbol_aux_block (name, linkage_name, block, domain); if (sym != NULL) @@ -2407,7 +2371,7 @@ Index: gdb-6.8.50.20081214/gdb/symtab.c ALL_BLOCK_SYMBOLS (b, iter, sym) { COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); -@@ -4305,6 +4345,25 @@ skip_prologue_using_sal (CORE_ADDR func_ +@@ -4315,6 +4355,25 @@ skip_prologue_using_sal (CORE_ADDR func_ line mark the prologue -> body transition. */ if (sal.line >= prologue_sal.line) break; @@ -2433,10 +2397,10 @@ Index: gdb-6.8.50.20081214/gdb/symtab.c /* The case in which compiler's optimizer/scheduler has moved instructions into the prologue. We look ahead in the function looking for address ranges whose -Index: gdb-6.8.50.20081214/gdb/symtab.h +Index: gdb-6.8.50.20090209/gdb/symtab.h =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/symtab.h 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/symtab.h 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/symtab.h 2009-02-06 22:33:58.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/symtab.h 2009-02-09 16:06:00.000000000 +0100 @@ -556,9 +556,18 @@ struct symbol unsigned is_argument : 1; @@ -2467,10 +2431,10 @@ Index: gdb-6.8.50.20081214/gdb/symtab.h #define SYMBOL_TYPE(symbol) (symbol)->type #define SYMBOL_LINE(symbol) (symbol)->line #define SYMBOL_SYMTAB(symbol) (symbol)->symtab -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.base/break.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.base/break.exp =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/testsuite/gdb.base/break.exp 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.base/break.exp 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.base/break.exp 2009-01-19 20:05:01.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.base/break.exp 2009-02-09 16:06:00.000000000 +0100 @@ -880,6 +880,13 @@ gdb_expect { # marker4() is defined at line 46 when compiled with -DPROTOTYPES pass "run until breakpoint set at small function, optimized file (line bp_location14)" @@ -2485,10 +2449,10 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.base/break.exp -re ".*$gdb_prompt " { fail "run until breakpoint set at small function, optimized file" } -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.cp/annota2.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.cp/annota2.exp =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/testsuite/gdb.cp/annota2.exp 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.cp/annota2.exp 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.cp/annota2.exp 2009-01-03 06:58:04.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.cp/annota2.exp 2009-02-09 16:06:00.000000000 +0100 @@ -119,10 +119,11 @@ gdb_expect { # continue until exit # this will test: @@ -2502,10 +2466,10 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.cp/annota2.exp { pass "continue until exit" } -re ".*$gdb_prompt$" { fail "continue to exit" } timeout { fail "continue to exit (timeout)" } -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-bt.c +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-bt.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-bt.c 2008-12-14 15:31:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-bt.c 2009-02-09 16:06:00.000000000 +0100 @@ -0,0 +1,47 @@ +/* Copyright (C) 2008 Free Software Foundation, Inc. + @@ -2554,10 +2518,10 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-bt.c + + return 0; +} -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-bt.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-bt.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-bt.exp 2008-12-14 15:31:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-bt.exp 2009-02-09 16:06:00.000000000 +0100 @@ -0,0 +1,63 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -2622,10 +2586,10 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-bt.exp +gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (3)" +gdb_test "up" "#2 .*func2.*" "up from func1 (3)" +gdb_test "info frame" ".*inlined into frame.*" "func2 inlined (3)" -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-cmds.c +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-cmds.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-cmds.c 2008-12-14 15:31:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-cmds.c 2009-02-09 16:06:00.000000000 +0100 @@ -0,0 +1,85 @@ +/* Copyright (C) 2008 Free Software Foundation, Inc. + @@ -2712,10 +2676,10 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-cmds.c + + return 0; +} -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-cmds.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-cmds.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-14 15:31:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-cmds.exp 2009-02-09 16:06:00.000000000 +0100 @@ -0,0 +1,279 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -2996,10 +2960,10 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-cmds.exp +gdb_test "info frame" ".*inlined into frame.*" "outer_inline2 inlined" +gdb_test "up" "#4 main.*" "up from outer_inline2" +gdb_test "info frame" ".*\n caller of frame.*" "main not inlined" -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-locals.c +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-locals.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-locals.c 2008-12-14 15:31:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-locals.c 2009-02-09 16:06:00.000000000 +0100 @@ -0,0 +1,52 @@ +/* Copyright (C) 2008 Free Software Foundation, Inc. + @@ -3053,10 +3017,10 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-locals.c + + return 0; +} -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-locals.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-locals.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-locals.exp 2008-12-14 15:31:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-locals.exp 2009-02-09 16:06:00.000000000 +0100 @@ -0,0 +1,118 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -3176,10 +3140,10 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-locals.exp +} + +gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local (3)" -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-markers.c +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-markers.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-markers.c 2008-12-14 15:31:03.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/inline-markers.c 2009-02-09 16:06:00.000000000 +0100 @@ -0,0 +1,36 @@ +/* Copyright (C) 2008 Free Software Foundation, Inc. + @@ -3217,10 +3181,10 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/inline-markers.c +{ + inlined_fn (); /* inlined */ +} -Index: gdb-6.8.50.20081214/gdb/testsuite/lib/gdb.exp +Index: gdb-6.8.50.20090209/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/testsuite/lib/gdb.exp 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/testsuite/lib/gdb.exp 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/testsuite/lib/gdb.exp 2009-02-09 16:02:35.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/testsuite/lib/gdb.exp 2009-02-09 16:06:00.000000000 +0100 @@ -1471,6 +1471,37 @@ proc skip_hp_tests {} { return $skip_hp } @@ -3259,11 +3223,11 @@ Index: gdb-6.8.50.20081214/gdb/testsuite/lib/gdb.exp set compiler_info "unknown" set gcc_compiled 0 set hp_cc_compiler 0 -Index: gdb-6.8.50.20081214/gdb/valops.c +Index: gdb-6.8.50.20090209/gdb/valops.c =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/valops.c 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/valops.c 2008-12-14 15:31:03.000000000 +0100 -@@ -1051,7 +1051,7 @@ value_of_variable (struct symbol *var, s +--- gdb-6.8.50.20090209.orig/gdb/valops.c 2009-02-09 15:40:36.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/valops.c 2009-02-09 16:06:00.000000000 +0100 +@@ -1074,7 +1074,7 @@ value_of_variable (struct symbol *var, s frame = block_innermost_frame (b); if (!frame) { @@ -3272,11 +3236,11 @@ Index: gdb-6.8.50.20081214/gdb/valops.c && SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b))) error (_("No frame is currently executing in block %s."), SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b))); -Index: gdb-6.8.50.20081214/gdb/Makefile.in +Index: gdb-6.8.50.20090209/gdb/Makefile.in =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/Makefile.in 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/Makefile.in 2008-12-14 15:31:03.000000000 +0100 -@@ -630,6 +630,7 @@ SFILES = ada-exp.y ada-lang.c ada-typepr +--- gdb-6.8.50.20090209.orig/gdb/Makefile.in 2009-02-09 16:02:35.000000000 +0100 ++++ gdb-6.8.50.20090209/gdb/Makefile.in 2009-02-09 16:06:00.000000000 +0100 +@@ -634,6 +634,7 @@ SFILES = ada-exp.y ada-lang.c ada-typepr inf-loop.c \ infcall.c \ infcmd.c inflow.c infrun.c \ @@ -3284,7 +3248,7 @@ Index: gdb-6.8.50.20081214/gdb/Makefile.in interps.c \ jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \ language.c linespec.c \ -@@ -800,6 +801,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $ +@@ -804,6 +805,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $ user-regs.o \ frame.o frame-unwind.o doublest.o \ frame-base.o \ @@ -3292,10 +3256,10 @@ Index: gdb-6.8.50.20081214/gdb/Makefile.in gnu-v2-abi.o gnu-v3-abi.o cp-abi.o cp-support.o \ cp-namespace.o \ reggroups.o regset.o \ -Index: gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/Makefile.in +Index: gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/Makefile.in =================================================================== ---- gdb-6.8.50.20081214.orig/gdb/testsuite/gdb.opt/Makefile.in 2008-12-14 15:30:03.000000000 +0100 -+++ gdb-6.8.50.20081214/gdb/testsuite/gdb.opt/Makefile.in 2008-12-14 15:31:03.000000000 +0100 +--- gdb-6.8.50.20090209.orig/gdb/testsuite/gdb.opt/Makefile.in 2008-04-18 01:06:54.000000000 +0200 ++++ gdb-6.8.50.20090209/gdb/testsuite/gdb.opt/Makefile.in 2009-02-09 16:06:00.000000000 +0100 @@ -1,7 +1,7 @@ VPATH = @srcdir@ srcdir = @srcdir@ diff --git a/gdb-fortran-testsuite-gfortran.patch b/gdb-fortran-testsuite-gfortran.patch deleted file mode 100644 index 3a54e44..0000000 --- a/gdb-fortran-testsuite-gfortran.patch +++ /dev/null @@ -1,56 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2008-12/msg00155.html - -2008-12-08 Jan Kratochvil - - * gdb.fortran/subarray.exp: Expect also the strings type output. - * gdb.fortran/derived-type.exp: Likewise. Expect also the kind=X types. - Update for the f-valprint.c modification from 2008-04-22. - ---- ./gdb/testsuite/gdb.fortran/derived-type.exp 1 Jan 2008 22:53:19 -0000 1.6 -+++ ./gdb/testsuite/gdb.fortran/derived-type.exp 8 Dec 2008 18:04:34 -0000 -@@ -42,23 +42,22 @@ if ![runto MAIN__] then { - } - - gdb_test "ptype p" \ -- "type = Type bar.*int4.*\:\: c.*real.*\:\: d.*End Type bar" \ -+ "type = Type bar.*int.*\:\: c.*real.*\:\: d.*End Type bar" \ - "ptype p" - gdb_test "ptype q" \ -- "type = Type foo.*real.*\:\: a.*Type bar.*int4.*\:\: c.*real.*\:\: d.*End Type bar \:\: x.*character.*\\(7\\) \:\: b.*End Type foo" \ -+ "type = Type foo.*real.*\:\: *a.*Type bar.*int.*\:\: *c.*real.*\:\: *d.*End Type bar \:\: *x.*character.*7.* \:\: *b.*End Type foo" \ - "type-printing for derived type" - - gdb_breakpoint [gdb_get_line_number "print"] - gdb_continue_to_breakpoint "print" - --gdb_test "print p" "\\$\[0-9\]+ = \\{ 1, 2.375\\}" -+gdb_test "print p" "\\$\[0-9\]+ = \\( 1, 2.375 \\)" - gdb_test "print p%c" "\\$\[0-9\]+ = 1" - gdb_test "print p%d" "\\$\[0-9\]+ = 2.375" - gdb_test "print q%a" "\\$\[0-9\]+ = 3.125" --gdb_test "print q%b" "\\$\[0-9\]+ = \\(.*a.*b.*c.*d.*e.*f.*g.*\\)" -+gdb_test "print q%b" "\\$\[0-9\]+ = (\\(.*a.*b.*c.*d.*e.*f.*g.*\\)|'abcdefg')" - gdb_test "print q%x%c" "\\$\[0-9\]+ = 1" - gdb_test "print q%x%d" "\\$\[0-9\]+ = 2.375" - gdb_test "print q" \ -- "\\$\[0-9\]+ = \\{ 3.125, \\{ 1, 2.375\\}, \\(.*a.*b.*c.*d.*e.*f.*g.*\\)\\}" \ -+ "\\$\[0-9\]+ = \\( 3.125, \\( 1, 2.375 \\), (\\(.*a.*b.*c.*d.*e.*f.*g.*\\)|'abcdefg') \\)" \ - "print q" -- ---- ./gdb/testsuite/gdb.fortran/subarray.exp 1 Jan 2008 22:53:19 -0000 1.6 -+++ ./gdb/testsuite/gdb.fortran/subarray.exp 8 Dec 2008 18:04:34 -0000 -@@ -53,10 +53,10 @@ gdb_test "continue" \ - - # Test four different kinds of subarray expression evaluation. - --gdb_test "print str(2:4)" ".*1 = \\(98 'b', 99 'c', 100 'd'\\).*" "print str(2:4)" --gdb_test "print str(:3)" ".*2 = \\(97 'a', 98 'b', 99 'c'\\).*" "print str(:3)" --gdb_test "print str(5:)" ".*3 = \\(101 'e', 102 'f', 103 'g'\\).*" "print str(5:)" --gdb_test "print str(:)" ".*4 = \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\).*" "print str(:)" -+gdb_test "print str(2:4)" ".*1 = (\\(98 'b', 99 'c', 100 'd'\\)|'bcd').*" "print str(2:4)" -+gdb_test "print str(:3)" ".*2 = (\\(97 'a', 98 'b', 99 'c'\\)|'abc').*" "print str(:3)" -+gdb_test "print str(5:)" ".*3 = (\\(101 'e', 102 'f', 103 'g'\\)|'efg').*" "print str(5:)" -+gdb_test "print str(:)" ".*4 = (\\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\)|'abcdefg').*" "print str(:)" - - gdb_test "print array(2:4)" ".*5 = \\(2, 3, 4\\).*" "print array(2:4)" - gdb_test "print array(:3)" ".*6 = \\(1, 2, 3\\).*" "print array(:3)" diff --git a/gdb-watchpoint-hw-without-inferior.patch b/gdb-watchpoint-hw-without-inferior.patch deleted file mode 100644 index 27c6060..0000000 --- a/gdb-watchpoint-hw-without-inferior.patch +++ /dev/null @@ -1,136 +0,0 @@ -2008-12-07 Jan Kratochvil - - Fix hw watchpoints created before the inferior was started. - * breakpoint.c (update_watchpoint): Convert the bp_watchpoint and - bp_hardware_watchpoint types according to the current runtime state. - (insert_breakpoints): Call update_watchpoint even for `bp_watchpoint's. - -2008-12-07 Jan Kratochvil - - * gdb.base/watchpoint-hw.exp, gdb.base/watchpoint-hw.c: New. - ---- ./gdb/breakpoint.c 7 Dec 2008 15:59:51 -0000 1.364 -+++ ./gdb/breakpoint.c 7 Dec 2008 21:20:54 -0000 -@@ -892,6 +892,28 @@ update_watchpoint (struct breakpoint *b, - b->val_valid = 1; - } - -+ /* Change the type of breakpoint between hardware assisted or an -+ ordinary watchpoint depending on the hardware support and free -+ hardware slots. */ -+ if (b->type == bp_watchpoint || b->type == bp_hardware_watchpoint) -+ { -+ int i, mem_cnt, target_resources_ok, other_type_used; -+ -+ i = hw_watchpoint_used_count (bp_hardware_watchpoint, -+ &other_type_used); -+ mem_cnt = can_use_hardware_watchpoint (val_chain); -+ -+ /* Hack around 'unused var' error for some targets here. */ -+ (void) i; -+ if (mem_cnt) -+ target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT -+ (bp_hardware_watchpoint, i + mem_cnt, other_type_used); -+ if (!mem_cnt || target_resources_ok <= 0) -+ b->type = bp_watchpoint; -+ else -+ b->type = bp_hardware_watchpoint; -+ } -+ - /* Look at each value on the value chain. */ - for (v = val_chain; v; v = next) - { -@@ -1204,8 +1226,9 @@ insert_breakpoints (void) - { - struct breakpoint *bpt; - -+ /* Software watchpoint may get converted to hardware ones. */ - ALL_BREAKPOINTS (bpt) -- if (is_hardware_watchpoint (bpt)) -+ if (is_hardware_watchpoint (bpt) || bpt->type == bp_watchpoint) - update_watchpoint (bpt, 0 /* don't reparse. */); - - update_global_location_list (1); ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ ./gdb/testsuite/gdb.base/watchpoint-hw.c 7 Dec 2008 21:20:56 -0000 -@@ -0,0 +1,27 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 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 . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+int watchee; -+ -+int -+main (void) -+{ -+ return 0; -+} ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ ./gdb/testsuite/gdb.base/watchpoint-hw.exp 7 Dec 2008 21:20:56 -0000 -@@ -0,0 +1,50 @@ -+# Copyright 2008 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 {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] && ![istarget "ia64-*-*"] -+ && ![istarget "s390*-*-*"]} then { -+ verbose "Skipping watchpoint-hw test." -+ return -+} -+ -+set testfile watchpoint-hw -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# Create the watchpoint before the inferior gets started. Now the native CPU -+# target is still not active and its `to_can_use_hw_breakpoint' is not -+# installed, therefore only a software watchpoint gets created. -+ -+gdb_test "watch watchee" "atchpoint 1: watchee" -+ -+# `runto_main' or `runto main' would delete the watchpoint created above. -+ -+if { [gdb_start_cmd] < 0 } { -+ untested start -+ return -1 -+} -+gdb_test "" "main .* at .*" "start" -+ -+# Check it is really a `hw'-watchpoint. -+gdb_test "info watchpoints" "1 *hw watchpoint .* watchee" diff --git a/gdb.spec b/gdb.spec index 72a0c1d..ad954d2 100644 --- a/gdb.spec +++ b/gdb.spec @@ -9,11 +9,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.20081214 +Version: 6.8.50.20090209 # 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: 2%{?_with_upstream:.upstream}%{?dist} +Release: 1%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ Group: Development/Debuggers @@ -125,9 +125,6 @@ Patch142: gdb-6.3-terminal-fix-20050214.patch # Test sibling threads to set threaded watchpoints for x86 and x86-64 Patch145: gdb-6.3-threaded-watchpoints2-20050225.patch -# Fix unexpected compiler warning messages. -Patch147: gdb-6.3-warnings-20050317.patch - # Fix printing of inherited members Patch148: gdb-6.3-inheritance-20050324.patch @@ -377,12 +374,6 @@ Patch343: gdb-6.8-watchpoint-conditionals-test.patch # Fix resolving of variables at locations lists in prelinked libs (BZ 466901). Patch348: gdb-6.8-bz466901-backtrace-full-prelinked.patch -# Enable hardware watchpoints if created before starting inferior. -Patch349: gdb-watchpoint-hw-without-inferior.patch - -# Fix upstream testsuite regression + make Fortran tests gfortran compatible. -Patch351: gdb-fortran-testsuite-gfortran.patch - BuildRequires: ncurses-devel texinfo gettext flex bison expat-devel Requires: readline BuildRequires: readline-devel @@ -484,7 +475,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch259 -p1 %patch142 -p1 %patch145 -p1 -%patch147 -p1 %patch148 -p1 %patch150 -p1 %patch151 -p1 @@ -569,8 +559,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch337 -p1 %patch343 -p1 %patch348 -p1 -%patch349 -p1 -%patch351 -p1 %patch124 -p1 find -name "*.orig" | xargs rm -f @@ -834,6 +822,9 @@ fi %endif %changelog +* Wed Feb 11 2009 Jan Kratochvil - 6.8.50.20090209-1 +- Upgrade to the FSF GDB gdb-6.8.50 snapshot. + * Mon Feb 9 2009 Jan Kratochvil - 6.8.50.20081214-2 - Fix crash / implement `finish' into inlined functions (BZ 479781). - Drop the gdb.threads/attach-into-signal.exp change as obsolete. diff --git a/sources b/sources index 2ac9d8a..6b74d37 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -92a6d781eafdf1412c4516f1bdd979bb gdb-6.8.50.20081214.tar.bz2 +9fba745cff7bbcea11795ee45b362f06 gdb-6.8.50.20090209.tar.bz2