public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-jankratochvil-fedora14: Merge remote branch 'origin/gdb_7_2-branch' into archer-jankratochvil-fedora14
Date: Tue, 20 Jul 2010 18:54:00 -0000	[thread overview]
Message-ID: <20100720185420.7182.qmail@sourceware.org> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 21006 bytes --]

The branch, archer-jankratochvil-fedora14 has been updated
       via  0bc9a93725d7a7bcf1e30f072a12cc5186e41dc2 (commit)
       via  7d3d6fa3fe2c56d2120482a0fc75011356aa2e99 (commit)
       via  8a8516b974085aa6772d522eb7d083b85373abe1 (commit)
       via  6992bfc4887afcffeb3a318a2d675a9ba38f600f (commit)
       via  f30a31eba26b27820384e82f0a2cd76427faf270 (commit)
       via  ffeb7030b0fce8df97c813e9b9ef8ec30b54bdfa (commit)
       via  1e384c02c910e604e2408a9a31fd738119f7397c (commit)
       via  0f72eb8318d5a61dc6a8761f49ea807b5e54c937 (commit)
       via  fde73799ef7cd32d009baa3e69984ff6f4158447 (commit)
       via  4e2a8b7c36956278c9cb84f6772d0eed5b9f27ac (commit)
       via  bb2d6379788153d6daae6637559628da356630f9 (commit)
       via  7fe8d7d81666ee33ea2fe03ca8190af3043be5cc (commit)
       via  01d3912c64acdbe488c4c5120f159ed7d8b8510f (commit)
       via  29ec463a09b028e75f1a84899129f7ff8da960a1 (commit)
       via  c1ee5e857e351607cc67cb257b808ee0d973e907 (commit)
       via  931b248c03254bd5ff95072dc6756585ca795ec8 (commit)
       via  2856622c0bd239f3de2b8239012ae61450b42b50 (commit)
       via  20f684fd4a26f1e371807802ea5cd59a0589349c (commit)
       via  6012d876f64c93d4bf2df2d61e76c3ad176d235a (commit)
       via  ce69941a7f705d9dd45bec8bf5503ca0d2e2d3ee (commit)
       via  d9ec7da91c5e99055dc5199b501f22433bd0a125 (commit)
       via  dcdf13adcaf8e52ec8d8863499629434298b67c5 (commit)
       via  63386bc824c89b53b0f7fd80ef8f45020c5b6e54 (commit)
       via  3c297a5317917f44a0a3c8d7b33a76272df23fe3 (commit)
       via  b0d50490ad49c6a33e5ca0a2e3116fd20e2f21eb (commit)
       via  0ef7c2c76c4d9c1b16eef3b049e3ee0fee0094bf (commit)
       via  a02d7b53e89a99f1278e01b461216ccc38a9dec7 (commit)
      from  fb624da4134d39abb16cf4d90507f8e12a88c19b (commit)

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

- Log -----------------------------------------------------------------
commit 0bc9a93725d7a7bcf1e30f072a12cc5186e41dc2
Merge: fb624da4134d39abb16cf4d90507f8e12a88c19b 7d3d6fa3fe2c56d2120482a0fc75011356aa2e99
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Jul 20 20:54:10 2010 +0200

    Merge remote branch 'origin/gdb_7_2-branch' into archer-jankratochvil-fedora14
    
    Conflicts:
    	gdb/dwarf2loc.c

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

Summary of changes:
 gdb/ChangeLog                               |   53 +++++++++++++++++++++++++++
 gdb/NEWS                                    |   15 ++++++++
 gdb/c-valprint.c                            |    3 +-
 gdb/configure                               |    5 ---
 gdb/configure.ac                            |    5 ---
 gdb/doc/ChangeLog                           |    4 ++
 gdb/doc/gdb.texinfo                         |    2 +-
 gdb/dwarf2loc.c                             |   17 +++------
 gdb/dwarf2loc.h                             |   10 +++++-
 gdb/dwarf2read.c                            |   17 ++++++++-
 gdb/python/py-prettyprint.c                 |    8 +++--
 gdb/source.c                                |    6 ++-
 gdb/testsuite/ChangeLog                     |   12 ++++++
 gdb/testsuite/gdb.base/default.exp          |   13 ++++++-
 gdb/testsuite/gdb.python/py-prettyprint.c   |   11 ++++++
 gdb/testsuite/gdb.python/py-prettyprint.exp |    2 +
 gdb/testsuite/lib/gdb.exp                   |   53 +++++++++++++++++++++++++++
 gdb/version.in                              |    2 +-
 18 files changed, 205 insertions(+), 33 deletions(-)

First 500 lines of diff:
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 64eef43..1fbf5f8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,46 @@
+2010-07-16  Thiago Jung Bauermann  <bauerman@br.ibm.com>
+
+	* NEWS: Mention support for the new ptrace interface and hardware
+	accelerated watchpoint conditions on powerpc-linux.
+
+2010-07-13  Emmanuel Thomé  <Emmanuel.Thome@gmail.com>
+
+	* c-valprint.c (c_val_print): Add embedded_offset to address in
+	call to val_print_array_elements.
+
+2010-07-13  Tom Tromey  <tromey@redhat.com>
+
+	* dwarf2loc.h (dwarf2_per_cu_text_offset): Declare.
+	* dwarf2loc.c (find_location_expression): Use
+	dwarf2_per_cu_text_offset.
+	(dwarf2_evaluate_loc_desc): Likewise.
+	(dwarf2_loc_desc_needs_frame): Likewise.
+	(compile_dwarf_to_ax): Likewise.
+	(loclist_describe_location): Likewise.
+	* dwarf2read.c (dwarf2_per_cu_text_offset): New function.
+	(dwarf2_per_cu_objfile): Update comment.
+
+2010-07-09  Tom Tromey  <tromey@redhat.com>
+
+	* python/py-prettyprint.c (gdbpy_get_display_hint): Don't use
+	'hint' if it is NULL.
+
+2010-07-09  Hui Zhu  <teawater@gmail.com>
+
+	* source.c (print_source_lines_base): Add check for noprint.
+
+2010-07-07  Joel Brobecker  <brobecker@adacore.com>
+
+	* version.in: Set version to 7.1.90.20100707-cvs.
+
+2010-07-07  Joel Brobecker  <brobecker@adacore.com>
+
+	GDB 7.1.90 released.
+
+2010-07-07  Joel Brobecker  <brobecker@adacore.com>
+
+	* version.in: Update GDB version number to 7.1.90.
+
 2010-07-07  Tom Tromey  <tromey@redhat.com>
 
 	* dwarf2read.c (dwarf2_const_value) <DW_form_addr>: Create a
@@ -16,6 +59,16 @@
 	(dwarf2_frame_base_sniffer): Update.
 	(dwarf2_frame_find_fde): Add 'out_offset' argument.
 
+2010-07-07  Joel Brobecker  <brobecker@adacore.com>
+
+	* configure.ac: Disable -Werror by default.
+	* configure: Regenerate.
+
+2010-07-07  Joel Brobecker  <brobecker@adacore.com>
+
+	GDB 7.2 branch created (branch timestamp: 2010-07-07 17:00 UTC)
+	* version.in: Bump version to 7.1.90.20100707-cvs.
+
 2010-07-07  Sergio Durigan Junior  <sergiodj@linux.vnet.ibm.com>
 	    Thiago Jung Bauermann  <bauerman@br.ibm.com>
 
diff --git a/gdb/NEWS b/gdb/NEWS
index 77c55de..d3704b7 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -221,6 +221,21 @@ ARM Symbian			arm*-*-symbianelf*
   GDB now supports debugging programs written in the D programming
   language.
 
+* GDB now supports the extended ptrace interface for PowerPC which is
+  available since Linux kernel version 2.6.34.  This automatically enables
+  any hardware breakpoints and additional hardware watchpoints available in
+  the processor.  The old ptrace interface exposes just one hardware
+  watchpoint and no hardware breakpoints.
+
+* GDB is now able to use the Data Value Compare (DVC) register available on
+  embedded PowerPC processors to implement in hardware simple watchpoint
+  conditions of the form:
+
+  watch ADDRESS|VARIABLE if ADDRESS|VARIABLE == CONSTANT EXPRESSION
+
+  This works in native GDB running on Linux kernels with the extended ptrace
+  interface mentioned above.
+
 *** Changes in GDB 7.1
 
 * C++ Improvements
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 4e5a95f..f0895a4 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -222,7 +222,8 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 		{
 		  i = 0;
 		}
-	      val_print_array_elements (type, valaddr + embedded_offset, address, stream,
+	      val_print_array_elements (type, valaddr + embedded_offset,
+					address + embedded_offset, stream,
 					recurse, original_value, options, i);
 	      fprintf_filtered (stream, "}");
 	    }
diff --git a/gdb/configure b/gdb/configure
index 174c186..94eb9b9 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -14741,11 +14741,6 @@ if test "${enable_werror+set}" = set; then :
 fi
 
 
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
-    ERROR_ON_WARNING=yes
-fi
-
 WERROR_CFLAGS=""
 if test "${ERROR_ON_WARNING}" = yes ; then
     WERROR_CFLAGS="-Werror"
diff --git a/gdb/configure.ac b/gdb/configure.ac
index bfe1803..9300544 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1711,11 +1711,6 @@ AC_ARG_ENABLE(werror,
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
    esac])
 
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
-    ERROR_ON_WARNING=yes
-fi
-
 WERROR_CFLAGS=""
 if test "${ERROR_ON_WARNING}" = yes ; then
     WERROR_CFLAGS="-Werror"
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 240ba89..04f1683 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+2010-07-13  Tom Tromey  <tromey@redhat.com>
+
+	* gdb.texinfo (GDB/MI Variable Objects): Remove extra 'for'.
+
 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
 
 	* gdb.texinfo (Create and Delete Tracepoints): Add more index
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 7abb9ed..1297175 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -26386,7 +26386,7 @@ be available.
 
 Return a list of the children of the specified variable object and
 create variable objects for them, if they do not already exist.  With
-a single argument or if @var{print-values} has a value for of 0 or
+a single argument or if @var{print-values} has a value of 0 or
 @code{--no-values}, print only the names of the variables; if
 @var{print-values} is 1 or @code{--all-values}, also print their
 values; and if it is 2 or @code{--simple-values} print the name and
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 9ece9fc..be74412 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -76,8 +76,7 @@ find_location_expression (struct dwarf2_loclist_baton *baton,
   int signed_addr_p = bfd_get_sign_extend_vma (objfile->obfd);
   CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
   /* Adjust base_address for relocatable objects.  */
-  CORE_ADDR base_offset = ANOFFSET (objfile->section_offsets,
-				    SECT_OFF_TEXT (objfile));
+  CORE_ADDR base_offset = dwarf2_per_cu_text_offset (baton->per_cu);
   CORE_ADDR base_address = baton->base_address + base_offset;
 
   loc_ptr = baton->data;
@@ -355,7 +354,7 @@ dwarf_expr_prep_ctx (struct frame_info *frame, const gdb_byte *data,
 
   ctx->gdbarch = get_objfile_arch (objfile);
   ctx->addr_size = dwarf2_per_cu_addr_size (per_cu);
-  ctx->offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+  ctx->offset = dwarf2_per_cu_text_offset (per_cu);
   ctx->baton = &baton;
   ctx->read_reg = dwarf_expr_read_reg;
   ctx->read_mem = dwarf_expr_read_mem;
@@ -1253,7 +1252,7 @@ dwarf2_loc_desc_needs_frame (const gdb_byte *data, unsigned short size,
 
   ctx->gdbarch = get_objfile_arch (objfile);
   ctx->addr_size = dwarf2_per_cu_addr_size (per_cu);
-  ctx->offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+  ctx->offset = dwarf2_per_cu_text_offset (per_cu);
   ctx->baton = &baton;
   ctx->read_reg = needs_frame_read_reg;
   ctx->read_mem = needs_frame_read_mem;
@@ -1462,12 +1461,7 @@ compile_dwarf_to_ax (struct agent_expr *expr, struct axs_value *loc,
 	     index, not an address.  We don't support things like
 	     branching between the address and the TLS op.  */
 	  if (op_ptr >= op_end || *op_ptr != DW_OP_GNU_push_tls_address)
-	    {
-	      struct objfile *objfile = dwarf2_per_cu_objfile (per_cu);
-
-	      uoffset += ANOFFSET (objfile->section_offsets,
-				   SECT_OFF_TEXT (objfile));
-	    }
+	    uoffset += dwarf2_per_cu_text_offset (per_cu);
 	  ax_const_l (expr, uoffset);
 	  break;
 
@@ -2669,8 +2663,7 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
   int signed_addr_p = bfd_get_sign_extend_vma (objfile->obfd);
   CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
   /* Adjust base_address for relocatable objects.  */
-  CORE_ADDR base_offset = ANOFFSET (objfile->section_offsets,
-				    SECT_OFF_TEXT (objfile));
+  CORE_ADDR base_offset = dwarf2_per_cu_text_offset (dlbaton->per_cu);
   CORE_ADDR base_address = dlbaton->base_address + base_offset;
 
   loc_ptr = dlbaton->data;
diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
index 943f858..1e7d8dc 100644
--- a/gdb/dwarf2loc.h
+++ b/gdb/dwarf2loc.h
@@ -28,7 +28,9 @@ struct dwarf2_per_cu_data;
 /* This header is private to the DWARF-2 reader.  It is shared between
    dwarf2read.c and dwarf2loc.c.  */
 
-/* Return the OBJFILE associated with the compilation unit CU.  */
+/* Return the OBJFILE associated with the compilation unit CU.  If CU
+   came from a separate debuginfo file, then the master objfile is
+   returned.  */
 struct objfile *dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *cu);
 
 /* Return the address size given in the compilation unit header for CU.  */
@@ -37,6 +39,12 @@ CORE_ADDR dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu);
 /* Return the offset size given in the compilation unit header for CU.  */
 int dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *cu);
 
+/* Return the text offset of the CU.  The returned offset comes from
+   this CU's objfile.  If this objfile came from a separate debuginfo
+   file, then the offset may be different from the corresponding
+   offset in the parent objfile.  */
+CORE_ADDR dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *cu);
+
 struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block
   (unsigned int offset, struct dwarf2_per_cu_data *per_cu);
 
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 928375b..ec31cf1 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -12297,7 +12297,9 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
     }
 }
 
-/* Return the OBJFILE associated with the compilation unit CU.  */
+/* Return the OBJFILE associated with the compilation unit CU.  If CU
+   came from a separate debuginfo file, then the master objfile is
+   returned.  */
 
 struct objfile *
 dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *per_cu)
@@ -12356,6 +12358,19 @@ dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *per_cu)
     }
 }
 
+/* Return the text offset of the CU.  The returned offset comes from
+   this CU's objfile.  If this objfile came from a separate debuginfo
+   file, then the offset may be different from the corresponding
+   offset in the parent objfile.  */
+
+CORE_ADDR
+dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *per_cu)
+{
+  struct objfile *objfile = per_cu->psymtab->objfile;
+
+  return ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+}
+
 /* Locate the .debug_info compilation unit from CU's objfile which contains
    the DIE at OFFSET.  Raises an error on failure.  */
 
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index 9a205b4..434c8a5 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -229,10 +229,12 @@ gdbpy_get_display_hint (PyObject *printer)
     return NULL;
 
   hint = PyObject_CallMethodObjArgs (printer, gdbpy_display_hint_cst, NULL);
-  if (gdbpy_is_string (hint))
-    result = python_string_to_host_string (hint);
   if (hint)
-    Py_DECREF (hint);
+    {
+      if (gdbpy_is_string (hint))
+	result = python_string_to_host_string (hint);
+      Py_DECREF (hint);
+    }
   else
     gdbpy_print_stack ();
 
diff --git a/gdb/source.c b/gdb/source.c
index 39bd06a..3e89672 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1293,6 +1293,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
 {
   int c;
   int desc;
+  int noprint = 0;
   FILE *stream;
   int nlines = stopline - line;
   struct cleanup *cleanup;
@@ -1319,11 +1320,12 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
     }
   else
     {
-      desc = -1;
+      desc = last_source_error;
       noerror = 1;
+      noprint = 1;
     }
 
-  if (desc < 0)
+  if (desc < 0 || noprint)
     {
       last_source_error = desc;
 
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f1b58b4..11e689f 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2010-07-13  Tom Tromey  <tromey@redhat.com>
+
+	* gdb.python/py-prettyprint.c (struct arraystruct): New struct.
+	(main): Use it.
+	* gdb.python/py-prettyprint.exp (run_lang_tests): Add test.
+
+2010-07-08  Doug Evans  <dje@google.com>
+
+	* lib/gdb.exp (gdb_test_list_exact): New function.
+	* gdb.base/default.exp (show convenience): Call it, add tests for
+	$_sdata = void, $_thread = 0.
+
 2010-07-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
 	    Joel Brobecker  <brobecker@adacore.com>
 
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 283745a..64d4c9d 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -567,8 +567,19 @@ gdb_test "show commands" ".*" "show commands"
 gdb_test "show complaints" "Max number of complaints about incorrect symbols is 0." "show complaints"
 #test show confirm
 gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm"
+
 #test show convenience
-gdb_test "show convenience" "\\\$_siginfo = void" "show convenience"
+# This is tricker as there are multiple internal convenience vars and we
+# can't assume any particular order.
+gdb_test_list_exact "show convenience" "show convenience" \
+    {[^\r\n]+[\r\n]+} \
+    {[^\r\n]+} \
+    { \
+	{$_sdata = void} \
+	{$_siginfo = void} \
+	{$_thread = 0} \
+    }
+
 #test show directories
 gdb_test "show directories" "Source directories searched: .cdir\[:;\].cwd" "show directories"
 #test show editing
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.c b/gdb/testsuite/gdb.python/py-prettyprint.c
index f461bb1..66a9014 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.c
+++ b/gdb/testsuite/gdb.python/py-prettyprint.c
@@ -29,6 +29,12 @@ struct ss
   struct s b;
 };
 
+struct arraystruct
+{
+  int y;
+  struct s x[2];
+};
+
 struct ns {
   const char *null_str;
   int length;
@@ -199,6 +205,7 @@ main ()
 {
   struct ss  ss;
   struct ss  ssa[2];
+  struct arraystruct arraystruct;
   string x = make_string ("this is x");
   zzz_type c = make_container ("container");
   zzz_type c2 = make_container ("container2");
@@ -214,6 +221,10 @@ main ()
   init_ss(ssa+1, 5, 6);
   memset (&nullstr, 0, sizeof nullstr);
 
+  arraystruct.y = 7;
+  init_s (&arraystruct.x[0], 23);
+  init_s (&arraystruct.x[1], 24);
+
   struct ns  ns;
   ns.null_str = "embedded\0null\0string";
   ns.length = 20;
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp
index f435fb7..3b2aadd 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.exp
+++ b/gdb/testsuite/gdb.python/py-prettyprint.exp
@@ -76,6 +76,8 @@ proc run_lang_tests {lang} {
     gdb_test "print ssa\[1\]" " = a=< a=<5> b=<$hex>> b=< a=<6> b=<$hex>>"
     gdb_test "print ssa" " = {a=< a=<3> b=<$hex>> b=< a=<4> b=<$hex>>, a=< a=<5> b=<$hex>> b=< a=<6> b=<$hex>>}"
     
+    gdb_test "print arraystruct" " = {$nl *y = 7, *$nl *x = { a=<23> b=<$hex>,  a=<24> b=<$hex>} *$nl *}"
+
     if {$lang == "c++"} {
 	gdb_test "print cps" "=  a=<8> b=<$hex>"
 	gdb_test "print cpss" " = {$nl *zss = 9, *$nl *s =  a=<10> b=<$hex>$nl}"
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d702dee..b5b3362 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1036,6 +1036,59 @@ proc gdb_test_exact { args } {
 
     return [gdb_test $command $pattern $message]
 }
+
+# Wrapper around gdb_test_multiple that looks for a list of expected
+# output elements, but which can appear in any order.
+# CMD is the gdb command.
+# NAME is the name of the test.
+# ELM_FIND_REGEXP specifies how to partition the output into elements to
+# compare.
+# ELM_EXTRACT_REGEXP specifies the part of ELM_FIND_REGEXP to compare.
+# RESULT_MATCH_LIST is a list of exact matches for each expected element.
+# All elements of RESULT_MATCH_LIST must appear for the test to pass.
+#
+# A typical use of ELM_FIND_REGEXP/ELM_EXTRACT_REGEXP is to extract one line
+# of text per element and then strip trailing \r\n's.
+# Example:
+# gdb_test_list_exact "foo" "bar" \
+#     {[^\r\n]+[\r\n]+} \
+#     {[^\r\n]+} \
+#     { \
+#	{expected result 1} \
+#	{expected result 2} \
+#     }
+
+proc gdb_test_list_exact { cmd name elm_find_regexp elm_extract_regexp result_match_list } {
+    global gdb_prompt
+
+    set matches [lsort $result_match_list]
+    set seen {}
+    gdb_test_multiple $cmd $name {
+	"$cmd\[\r\n\]" { exp_continue }
+	-re $elm_find_regexp {
+	    set str $expect_out(0,string)
+	    verbose -log "seen: $str" 3
+	    regexp -- $elm_extract_regexp $str elm_seen
+	    verbose -log "extracted: $elm_seen" 3
+	    lappend seen $elm_seen
+	    exp_continue
+	}
+	-re "$gdb_prompt $" {
+	    set failed ""
+	    foreach got [lsort $seen] have $matches {
+		if {![string equal $got $have]} {
+		    set failed $have
+		    break
+		}
+	    }
+	    if {[string length $failed] != 0} {
+		fail "$name ($failed not found)"
+	    } else {
+		pass $name
+	    }
+	}
+    }
+}
 \f
 proc gdb_reinitialize_dir { subdir } {
     global gdb_prompt
diff --git a/gdb/version.in b/gdb/version.in
index 66977b4..56f1de5 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-7.1.50.20100707-cvs
+7.1.90.20100720-cvs


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


             reply	other threads:[~2010-07-20 18:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20 18:54 jkratoch [this message]
2010-09-03  7:32 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100720185420.7182.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).