public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  gdb_7_2-branch:  * NEWS: Mention target reported shared libraries support by  default.
@ 2010-07-22 16:26 jkratoch
  0 siblings, 0 replies; only message in thread
From: jkratoch @ 2010-07-22 16:26 UTC (permalink / raw)
  To: archer-commits

The branch, gdb_7_2-branch has been updated
       via  ea8f06a2b443c1f4264a62b50badbd402caebc8f (commit)
       via  2f2ee99f2e55be950b03523e6afd338ceb1e4624 (commit)
       via  792b33a774bfce34b98c359314fb47fc1f2f1cf0 (commit)
       via  3a99f07239972e790d1c1e61636440348d7f6410 (commit)
       via  e60e64716a4daba6c2111205ddbb34d5f6fb5701 (commit)
       via  a7028d3232b509e94ce761d279da41ae3083f975 (commit)
       via  3e02f8520f3856466a1eea6dd51b19c02f9965a3 (commit)
      from  7d3d6fa3fe2c56d2120482a0fc75011356aa2e99 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit ea8f06a2b443c1f4264a62b50badbd402caebc8f
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Thu Jul 22 10:49:46 2010 +0000

    	* NEWS: Mention target reported shared libraries support by
    	default.

commit 2f2ee99f2e55be950b03523e6afd338ceb1e4624
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Thu Jul 22 00:00:33 2010 +0000

    *** empty log message ***

commit 792b33a774bfce34b98c359314fb47fc1f2f1cf0
Author: sezero <sezero>
Date:   Wed Jul 21 20:01:08 2010 +0000

    Merge recent win64 breakage fixes from HEAD to 7.2 branch:
    
    gdb/
    
    	* target.c (debug_to_insert_breakpoint): Instead of casting to unsigned
    	long and %ld, use core_addr_to_string() and %s to print CORE_ADDR vars
    	and host_address_to_string() and %s for pointers.
    	(debug_to_remove_breakpoint): Likewise.
    	(debug_to_region_ok_for_hw_watchpoint): Likewise.
    	(debug_to_can_accel_watchpoint_condition): Likewise.
    	(debug_to_stopped_data_address): Likewise.
    	(debug_to_watchpoint_addr_within_range): Likewise.
    	(debug_to_insert_hw_breakpoint): Likewise.
    	(debug_to_remove_hw_breakpoint): Likewise.
    	(debug_to_insert_watchpoint): Likewise.
    	(debug_to_remove_watchpoint): Likewise.
    
    gdb/gdbserver/
    
    	* server.c (handle_query): strcpy() the returned string from paddress()
    	instead of sprintf().
    	* utils.c (paddress): Return phex_nz().

commit 3a99f07239972e790d1c1e61636440348d7f6410
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Wed Jul 21 18:01:18 2010 +0000

    gdb/
    2010-07-21  Pedro Alves  <pedro@codesourcery.com>
    
    	PR symtab/11827
    
    	Revert:
    	2010-05-21  Pierre Muller  <muller@ics.u-strasbg.fr>
    	* dwarf2read.c (process_die): Also allow DW_TAG_const_type
    	and DW_TAG_volatile_type.
    	(new_symbol): Likewise.
    
    gdb/testsuite/
    2010-07-21  Pedro Alves  <pedro@codesourcery.com>
    
    	PR symtab/11827
    
    	* gdb.base/printcmds.c (enum some_volatile_enum): New enum.
    	(some_volatile_enum): New variable.
    	* gdb.base/printcmds.exp (test_print_enums): New.
    	<top level>: Call it.

commit e60e64716a4daba6c2111205ddbb34d5f6fb5701
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Wed Jul 21 00:00:03 2010 +0000

    *** empty log message ***

commit a7028d3232b509e94ce761d279da41ae3083f975
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Jul 20 22:22:56 2010 +0000

    gdb/
    	* symfile.c (find_separate_debug_file_by_debuglink): Remove
    	a gdb_assert call, new comment.
    
    gdb/testsuite/
    	* gdb.base/solib-nodir.exp: New file.
    	* lib/gdb.exp (runto): New case for a GDB internal error.

commit 3e02f8520f3856466a1eea6dd51b19c02f9965a3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Jul 20 22:12:23 2010 +0000

    gdb/testsuite/
    	* gdb.base/charset-malloc.c: New file.
    	* gdb.base/charset.c (malloc_stub): New prototype.
    	(main): Call it instead of malloc itself.
    	* gdb.base/charset.exp: Use only prepare_for_testing.
    	(binfile): Remove the variable.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                           |   35 ++++++++++++++++++++
 gdb/NEWS                                |    8 ++++
 gdb/dwarf2read.c                        |    4 --
 gdb/gdbserver/ChangeLog                 |    6 +++
 gdb/gdbserver/server.c                  |    4 +-
 gdb/gdbserver/utils.c                   |   20 +++++------
 gdb/symfile.c                           |    6 +--
 gdb/target.c                            |   51 ++++++++++++++---------------
 gdb/testsuite/ChangeLog                 |   24 ++++++++++++++
 gdb/testsuite/gdb.base/charset-malloc.c |   35 ++++++++++++++++++++
 gdb/testsuite/gdb.base/charset.c        |    6 ++--
 gdb/testsuite/gdb.base/charset.exp      |   11 +-----
 gdb/testsuite/gdb.base/printcmds.c      |    6 +++
 gdb/testsuite/gdb.base/printcmds.exp    |    6 +++
 gdb/testsuite/gdb.base/solib-nodir.exp  |   54 +++++++++++++++++++++++++++++++
 gdb/testsuite/lib/gdb.exp               |    5 +++
 gdb/version.in                          |    2 +-
 17 files changed, 223 insertions(+), 60 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/charset-malloc.c
 create mode 100644 gdb/testsuite/gdb.base/solib-nodir.exp

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1fbf5f8..1585b52 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,38 @@
+2010-07-22  Pedro Alves  <pedro@codesourcery.com>
+
+	* NEWS: Mention target reported shared libraries support by
+	default.
+
+2010-07-21  Ozkan Sezer  <sezeroz@gmail.com>
+
+	* target.c (debug_to_insert_breakpoint): Instead of casting to unsigned
+	long and %ld, use core_addr_to_string() and %s to print CORE_ADDR vars
+	and host_address_to_string() and %s for pointers.
+	(debug_to_remove_breakpoint): Likewise.
+	(debug_to_region_ok_for_hw_watchpoint): Likewise.
+	(debug_to_can_accel_watchpoint_condition): Likewise.
+	(debug_to_stopped_data_address): Likewise.
+	(debug_to_watchpoint_addr_within_range): Likewise.
+	(debug_to_insert_hw_breakpoint): Likewise.
+	(debug_to_remove_hw_breakpoint): Likewise.
+	(debug_to_insert_watchpoint): Likewise.
+	(debug_to_remove_watchpoint): Likewise.
+
+2010-07-21  Pedro Alves  <pedro@codesourcery.com>
+
+	PR symtab/11827
+
+	Revert:
+	2010-05-21  Pierre Muller  <muller@ics.u-strasbg.fr>
+	* dwarf2read.c (process_die): Also allow DW_TAG_const_type
+	and DW_TAG_volatile_type.
+	(new_symbol): Likewise.
+
+2010-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* symfile.c (find_separate_debug_file_by_debuglink): Remove
+	a gdb_assert call, new comment.
+
 2010-07-16  Thiago Jung Bauermann  <bauerman@br.ibm.com>
 
 	* NEWS: Mention support for the new ptrace interface and hardware
diff --git a/gdb/NEWS b/gdb/NEWS
index d3704b7..b552d70 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,14 @@
 
 *** Changes since GDB 7.1
 
+* Shared library support for remote targets by default
+
+  When GDB is configured for a generic, non-OS specific target, like
+  for example, --target=arm-eabi or one of the many *-*-elf targets,
+  GDB now queries remote stubs for loaded shared libraries using the
+  `qXfer:libraries:read' packet.  Previously, shared library support
+  was always disabled for such configurations.
+
 * C++ Improvements:
 
   ** Argument Dependent Lookup (ADL)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 16381de..acbeed6 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3220,8 +3220,6 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
     case DW_TAG_base_type:
     case DW_TAG_subrange_type:
     case DW_TAG_typedef:
-    case DW_TAG_const_type:
-    case DW_TAG_volatile_type:
       /* Add a typedef symbol for the type definition, if it has a
          DW_AT_name.  */
       new_symbol (die, read_type_die (die, cu), cu);
@@ -9011,8 +9009,6 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
 	  break;
 	case DW_TAG_base_type:
         case DW_TAG_subrange_type:
-        case DW_TAG_const_type:
-        case DW_TAG_volatile_type:
 	  SYMBOL_CLASS (sym) = LOC_TYPEDEF;
 	  SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
 	  add_symbol_to_list (sym, cu->list_in_scope);
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 8f50ce0..7c182cb 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-21  Ozkan Sezer  <sezeroz@gmail.com>
+
+	* server.c (handle_query): strcpy() the returned string from paddress()
+	instead of sprintf().
+	* utils.c (paddress): Return phex_nz().
+
 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
 
 	* server.c (handle_v_cont): Call mourn_inferior if process
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 9125f0e..29b6cdc 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1539,7 +1539,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
 
       if (err == 0)
 	{
-	  sprintf (own_buf, "%llx", address);
+	  strcpy (own_buf, paddress(address));
 	  return;
 	}
       else if (err > 0)
@@ -1563,7 +1563,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
       n = (*the_target->get_tib_address) (ptid, &tlb);
       if (n == 1)
 	{
-	  sprintf (own_buf, "%llx", tlb);
+	  strcpy (own_buf, paddress(tlb));
 	  return;
 	}
       else if (n == 0)
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index b942962..8a1acd9 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -257,17 +257,6 @@ xsnprintf (char *str, size_t size, const char *format, ...)
   return ret;
 }
 
-/* Convert a CORE_ADDR into a HEX string, like %lx.
-   The result is stored in a circular static buffer, NUMCELLS deep.  */
-
-char *
-paddress (CORE_ADDR addr)
-{
-  char *str = get_cell ();
-  xsnprintf (str, CELLSIZE, "%lx", (long) addr);
-  return str;
-}
-
 static char *
 decimal2str (char *sign, ULONGEST addr, int width)
 {
@@ -372,3 +361,12 @@ phex_nz (ULONGEST l, int sizeof_l)
 
   return str;
 }
+
+/* Convert a CORE_ADDR into a HEX string, like %lx.
+   The result is stored in a circular static buffer, NUMCELLS deep.  */
+
+char *
+paddress (CORE_ADDR addr)
+{
+  return phex_nz (addr, sizeof (CORE_ADDR));
+}
diff --git a/gdb/symfile.c b/gdb/symfile.c
index ab51fa4..42f7ae3 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1371,15 +1371,13 @@ find_separate_debug_file_by_debuglink (struct objfile *objfile)
   dir = xstrdup (objfile->name);
 
   /* Strip off the final filename part, leaving the directory name,
-     followed by a slash.  Objfile names should always be absolute and
-     tilde-expanded, so there should always be a slash in there
-     somewhere.  */
+     followed by a slash.  The directory can be relative or absolute.  */
   for (i = strlen(dir) - 1; i >= 0; i--)
     {
       if (IS_DIR_SEPARATOR (dir[i]))
 	break;
     }
-  gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i]));
+  /* If I is -1 then no directory is present there and DIR will be "".  */
   dir[i+1] = '\0';
 
   /* Set I to max (strlen (canon_name), strlen (dir)). */
diff --git a/gdb/target.c b/gdb/target.c
index 862df4e..4cabcbd 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3270,8 +3270,8 @@ debug_to_insert_breakpoint (struct gdbarch *gdbarch,
   retval = debug_target.to_insert_breakpoint (gdbarch, bp_tgt);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_insert_breakpoint (0x%lx, xxx) = %ld\n",
-		      (unsigned long) bp_tgt->placed_address,
+		      "target_insert_breakpoint (%s, xxx) = %ld\n",
+		      core_addr_to_string (bp_tgt->placed_address),
 		      (unsigned long) retval);
   return retval;
 }
@@ -3285,8 +3285,8 @@ debug_to_remove_breakpoint (struct gdbarch *gdbarch,
   retval = debug_target.to_remove_breakpoint (gdbarch, bp_tgt);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_remove_breakpoint (0x%lx, xxx) = %ld\n",
-		      (unsigned long) bp_tgt->placed_address,
+		      "target_remove_breakpoint (%s, xxx) = %ld\n",
+		      core_addr_to_string (bp_tgt->placed_address),
 		      (unsigned long) retval);
   return retval;
 }
@@ -3315,10 +3315,9 @@ debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
   retval = debug_target.to_region_ok_for_hw_watchpoint (addr, len);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_region_ok_for_hw_watchpoint (%ld, %ld) = 0x%lx\n",
-		      (unsigned long) addr,
-		      (unsigned long) len,
-		      (unsigned long) retval);
+		      "target_region_ok_for_hw_watchpoint (%s, %ld) = %s\n",
+		      core_addr_to_string (addr), (unsigned long) len,
+		      core_addr_to_string (retval));
   return retval;
 }
 
@@ -3331,9 +3330,9 @@ debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw,
   retval = debug_target.to_can_accel_watchpoint_condition (addr, len, rw, cond);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_can_accel_watchpoint_condition (0x%lx, %d, %d, 0x%lx) = %ld\n",
-		      (unsigned long) addr, len, rw, (unsigned long) cond,
-		      (unsigned long) retval);
+		      "target_can_accel_watchpoint_condition (%s, %d, %d, %s) = %ld\n",
+		      core_addr_to_string (addr), len, rw,
+		      host_address_to_string (cond), (unsigned long) retval);
   return retval;
 }
 
@@ -3358,8 +3357,8 @@ debug_to_stopped_data_address (struct target_ops *target, CORE_ADDR *addr)
   retval = debug_target.to_stopped_data_address (target, addr);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_stopped_data_address ([0x%lx]) = %ld\n",
-		      (unsigned long)*addr,
+		      "target_stopped_data_address ([%s]) = %ld\n",
+		      core_addr_to_string (*addr),
 		      (unsigned long)retval);
   return retval;
 }
@@ -3375,9 +3374,9 @@ debug_to_watchpoint_addr_within_range (struct target_ops *target,
 							 start, length);
 
   fprintf_filtered (gdb_stdlog,
-		    "target_watchpoint_addr_within_range (0x%lx, 0x%lx, %d) = %d\n",
-		    (unsigned long) addr, (unsigned long) start, length,
-		    retval);
+		    "target_watchpoint_addr_within_range (%s, %s, %d) = %d\n",
+		    core_addr_to_string (addr), core_addr_to_string (start),
+		    length, retval);
   return retval;
 }
 
@@ -3390,8 +3389,8 @@ debug_to_insert_hw_breakpoint (struct gdbarch *gdbarch,
   retval = debug_target.to_insert_hw_breakpoint (gdbarch, bp_tgt);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_insert_hw_breakpoint (0x%lx, xxx) = %ld\n",
-		      (unsigned long) bp_tgt->placed_address,
+		      "target_insert_hw_breakpoint (%s, xxx) = %ld\n",
+		      core_addr_to_string (bp_tgt->placed_address),
 		      (unsigned long) retval);
   return retval;
 }
@@ -3405,8 +3404,8 @@ debug_to_remove_hw_breakpoint (struct gdbarch *gdbarch,
   retval = debug_target.to_remove_hw_breakpoint (gdbarch, bp_tgt);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_remove_hw_breakpoint (0x%lx, xxx) = %ld\n",
-		      (unsigned long) bp_tgt->placed_address,
+		      "target_remove_hw_breakpoint (%s, xxx) = %ld\n",
+		      core_addr_to_string (bp_tgt->placed_address),
 		      (unsigned long) retval);
   return retval;
 }
@@ -3420,9 +3419,9 @@ debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type,
   retval = debug_target.to_insert_watchpoint (addr, len, type, cond);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_insert_watchpoint (0x%lx, %d, %d, 0x%ld) = %ld\n",
-		      (unsigned long) addr, len, type, (unsigned long) cond,
-		      (unsigned long) retval);
+		      "target_insert_watchpoint (%s, %d, %d, %s) = %ld\n",
+		      core_addr_to_string (addr), len, type,
+		      host_address_to_string (cond), (unsigned long) retval);
   return retval;
 }
 
@@ -3435,9 +3434,9 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type,
   retval = debug_target.to_remove_watchpoint (addr, len, type, cond);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_remove_watchpoint (0x%lx, %d, %d, 0x%ld) = %ld\n",
-		      (unsigned long) addr, len, type, (unsigned long) cond,
-		      (unsigned long) retval);
+		      "target_remove_watchpoint (%s, %d, %d, %s) = %ld\n",
+		      core_addr_to_string (addr), len, type,
+		      host_address_to_string (cond), (unsigned long) retval);
   return retval;
 }
 
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 11e689f..ddd760a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,27 @@
+2010-07-21  Pedro Alves  <pedro@codesourcery.com>
+
+	PR symtab/11827
+
+	* gdb.base/printcmds.c (enum some_volatile_enum): New enum.
+	(some_volatile_enum): New variable.
+	* gdb.base/printcmds.exp (test_print_enums): New.
+	<top level>: Call it.
+
+2010-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* gdb.base/solib-nodir.exp: New file.
+	* lib/gdb.exp (runto): New case for a GDB internal error.
+
+2010-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+	    Ulrich Weigand  <uweigand@de.ibm.com>
+	    Tom Tromey  <tromey@redhat.com>
+
+	* gdb.base/charset-malloc.c: New file.
+	* gdb.base/charset.c (malloc_stub): New prototype.
+	(main): Call it instead of malloc itself.
+	* gdb.base/charset.exp: Use only prepare_for_testing.
+	(binfile): Remove the variable.
+
 2010-07-13  Tom Tromey  <tromey@redhat.com>
 
 	* gdb.python/py-prettyprint.c (struct arraystruct): New struct.
diff --git a/gdb/testsuite/gdb.base/charset-malloc.c b/gdb/testsuite/gdb.base/charset-malloc.c
new file mode 100644
index 0000000..450b7c8
--- /dev/null
+++ b/gdb/testsuite/gdb.base/charset-malloc.c
@@ -0,0 +1,35 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2010 Free Software Foundation, Inc.
+
+   Contributed by Red Hat, originally written by Jim Blandy.
+
+   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 <http://www.gnu.org/licenses/>.
+
+   Please email any bugs, comments, and/or additions to this file to:
+   bug-gdb@gnu.org  */
+
+/* charset.c file cannot use a system include file as it has its own wchar_t
+   definition which would be in a conflict.  Use this separate compilation
+   unit.  */
+
+#include <stdlib.h>
+
+void
+malloc_stub (void)
+{
+  /* charset.exp wants to allocate memory for constants.  So make sure malloc
+     gets linked into the program.  */
+  malloc (1);
+}
diff --git a/gdb/testsuite/gdb.base/charset.c b/gdb/testsuite/gdb.base/charset.c
index a7d64f2..5dafc90 100644
--- a/gdb/testsuite/gdb.base/charset.c
+++ b/gdb/testsuite/gdb.base/charset.c
@@ -114,6 +114,8 @@ init_utf32 ()
     utf_32_string[i] = iso_8859_1_string[i] & 0xff;
 }
 
+extern void malloc_stub (void);
+
 int main ()
 {
 #ifdef usestubs
@@ -121,9 +123,7 @@ int main ()
   breakpoint();
 #endif
 
-  /* charset.exp wants to allocate memory for constants.  So make sure malloc
-     gets linked into the program.  */
-  malloc (1);
+  malloc_stub ();
 
   /* Initialize ascii_string.  */
   init_string (ascii_string,
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index 58418be..0639117 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -27,18 +27,11 @@ if $tracelevel then {
 
 set testfile "charset"
 set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    untested "couldn't compile ${srcdir}/${subdir}/${srcfile}"
+set srcmallocfile ${testfile}-malloc.c
+if { [prepare_for_testing ${testfile}.exp ${testfile} [list $srcfile $srcmallocfile]] } {
     return -1
 }
 
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 # Parse the output from a `show charset' command.  Return the host
 # and target charset as a two-element list.
 proc parse_show_charset_output {testname} {
diff --git a/gdb/testsuite/gdb.base/printcmds.c b/gdb/testsuite/gdb.base/printcmds.c
index 8eddeee..2d6668a 100644
--- a/gdb/testsuite/gdb.base/printcmds.c
+++ b/gdb/testsuite/gdb.base/printcmds.c
@@ -90,6 +90,12 @@ struct some_arrays {
 
 struct some_arrays *parrays = &arrays;
 
+enum some_volatile_enum { enumvolval1, enumvolval2 };
+
+/* A volatile enum variable whose name is the same as the enumeration
+   name.  See PR11827.  */
+volatile enum some_volatile_enum some_volatile_enum = enumvolval1;
+
 /* -- */
 
 int main ()
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index b6a8a3e..11e29fa 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -671,6 +671,11 @@ proc test_print_array_constants {} {
     gdb_test "print *&{4,5,6}\[1\]"	"Attempt to take address of value not located in memory."
 }
 
+proc test_print_enums {} {
+    # Regression test for PR11827.
+    gdb_test "print some_volatile_enum" "enumvolval1"
+}
+
 proc test_printf {} {
     gdb_test "printf \"x=%d,y=%d,z=%d\\n\", 5, 6, 7" "x=5,y=6,z=7"
     gdb_test "printf \"string=%.4sxx\\n\", teststring" "string=testxx"
@@ -800,6 +805,7 @@ if [set_lang_c] then {
 # We used to do the runto main here.
 	test_print_string_constants
 	test_print_array_constants
+	test_print_enums
 	test_printf
 	test_printf_with_dfp
     }
diff --git a/gdb/testsuite/gdb.base/solib-nodir.exp b/gdb/testsuite/gdb.base/solib-nodir.exp
new file mode 100644
index 0000000..5c3f46e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/solib-nodir.exp
@@ -0,0 +1,54 @@
+# Copyright 2010 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 <http://www.gnu.org/licenses/>.  */
+
+# are we on a target board
+if {![isnative] || [skip_shlib_tests]} {
+    return
+}
+
+set testfile "solib-nodir"
+# Arbitrary file, possibly not containing main, even an empty one.
+set srclibfile foo.c
+# Arbitrary file containing main.
+set srcfile start.c
+set binlibfilebase ${testfile}.so
+set binlibfiledir ${objdir}/${subdir}
+set binlibfile ${binlibfiledir}/${binlibfilebase}
+set executable ${testfile}


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-22 16:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-22 16:26 [SCM] gdb_7_2-branch: * NEWS: Mention target reported shared libraries support by default jkratoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).