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-vla: Merge commit 'origin/master' into archer-jankratochvil-vla
Date: Wed, 19 Aug 2009 15:23:00 -0000	[thread overview]
Message-ID: <20090819152303.28983.qmail@sourceware.org> (raw)

The branch, archer-jankratochvil-vla has been updated
       via  e37f6d28e5958f6e29fdf84efef97968954d2fb7 (commit)
       via  07663db7b9480b43d5e93c20b69131bcc310fc9d (commit)
       via  928bdc2ddae62d8a7a9d446344f5d008610f8b84 (commit)
       via  22a305763c1ce4e2c55a8c97bfdbbb3082f3d591 (commit)
       via  1d8d138bfb710bb139d29089f56cc618aaf5311c (commit)
       via  e39481508eb264b7cbed515b943263ea94d86393 (commit)
      from  244286fa8e51bc154bb5e67d9cf273a180571b41 (commit)

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

- Log -----------------------------------------------------------------
commit e37f6d28e5958f6e29fdf84efef97968954d2fb7
Merge: 244286fa8e51bc154bb5e67d9cf273a180571b41 07663db7b9480b43d5e93c20b69131bcc310fc9d
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Wed Aug 19 17:22:54 2009 +0200

    Merge commit 'origin/master' into archer-jankratochvil-vla
    
    Conflicts:
    	gdb/value.c

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

Summary of changes:
 ChangeLog                          |    4 ++
 MAINTAINERS                        |   47 +++++++++----------
 bfd/version.h                      |    2 +-
 gdb/ChangeLog                      |   21 ++++++++
 gdb/language.c                     |    5 +-
 gdb/remote.c                       |    3 +
 gdb/testsuite/ChangeLog            |    5 ++
 gdb/testsuite/gdb.base/gdbvars.c   |   16 ++++++
 gdb/testsuite/gdb.base/gdbvars.exp |   19 +++++++
 gdb/utils.c                        |    6 ++
 gdb/value.c                        |   92 ++++++++++++++++++++----------------
 gdb/version.in                     |    2 +-
 12 files changed, 152 insertions(+), 70 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/gdbvars.c

First 500 lines of diff:
diff --git a/ChangeLog b/ChangeLog
index 4ee1147..c7cad0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-18  Christopher Faylor  <me+cygwin@cgf.cx>
+
+	* MAINTAINERS: Perform some obvious fixups.
+
 2009-08-17  Ben Elliston  <bje@au.ibm.com>
 
 	* config.sub, config.guess: Update from upstream sources.
diff --git a/MAINTAINERS b/MAINTAINERS
index 3c2c6f1..a471c90 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10,20 +10,20 @@ Makefile.*; configure; configure.ac; src-release
 	be kept in sync with their counterparts in the GCC
 	repository.  Also please notify the following of
 	any committed patches:
-		binutils@sources.redhat.com
-		gdb-patches@sources.redhat.com
+		binutils@sourceware.org
+		gdb-patches@sourceware.org
 
 bfd/; binutils/; elfcpp/; gas/; gold/; gprof/; ld/; opcodes/; cpu/;
 BFD's part of include/
 
-	binutils: http://sources.redhat.com/binutils/
-	Patches to binutils@sources.redhat.com.
+	binutils: http://sourceware.org/binutils/
+	Patches to binutils@sourceware.org.
 	Please notify the following of any interface changes:
-		gdb-patches@sources.redhat.com
+		gdb-patches@sourceware.org
 
 cgen/; cgen parts of opcodes/, sim/ & include/
-	cgen: http://sources.redhat.com/cgen/
-	Patches to cgen@sources.redhat.com
+	cgen: http://sourceware.org/cgen/
+	Patches to cgen@sourceware.org
 	May need separate opcodes/ or sim/ approval for
 		commits of regenerated files there.
 
@@ -35,15 +35,15 @@ config.guess; config.sub; readline/support/config.{sub,guess}
 	in via a merge.  When updating any of these files, please be
 	sure to update all of them.
 	Please notify the following of any committed patches:
-		binutils@sources.redhat.com
-		gdb-patches@sources.redhat.com
+		binutils@sourceware.org
+		gdb-patches@sourceware.org
 
 depcomp
         Send bug reports and patches to bug-automake@gnu.org.
 
 gdb/; readline/; sim/; GDB's part of include/
 	GDB: http://www.gnu.org/software/gdb/
-	Patches to gdb-patches@sources.redhat.com.
+	Patches to gdb-patches@sourceware.org.
 	See also gdb/MAINTAINERS and sim/MAINTAINERS.
 
 include/
@@ -81,12 +81,12 @@ symlink-tree
 	See libiberty.
 
 newlib/; libgloss/
-	http://sources.redhat.com/newlib/
-	Patches to newlib@sources.redhat.com.
+	http://sourceware.org/newlib/
+	Patches to newlib@sourceware.org.
 
 sid/; SID's part of cgen/
-	sid: http://sources.redhat.com/sid/
-	Patches to sid@sources.redhat.com
+	sid: http://sourceware.org/sid/
+	Patches to sid@sourceware.org
 
 texinfo/texinfo.tex
 	texinfo: http://ftp.gnu.org.
@@ -95,14 +95,13 @@ texinfo/texinfo.tex
 	Please not use GCC's texinfo.  Please do not import texinfo.
 
 tcl/; tix/; itcl/; tk/; libgui/
-	insight: http://sources.redhat.com/insight/
-	Contact insight@sources.redhat.com.
+	insight: http://sourceware.org/insight/
+	Contact insight@sourceware.org.
 
 winsup/
-	cygwin: http://sources.redhat.com/cygwin
-	Patches to cygwin-patches@sources.redhat.com.
-	General discussion cygwin@sources.redhat.com.
-	See also winsup/MAINTAINERS.
+	cygwin: http://sourceware.org/cygwin
+	Patches to cygwin-patches@cygwin.com.
+	General discussion cygwin@cygwin.com.
 
 config-ml.in; makefile.vms; mkdep; setup.com;
 etc/; utils/;
@@ -117,11 +116,9 @@ config/
 	counterparts in the GCC repository.
 
 modules file
-	Obviously changes to this file should not go through
-	overseers@sources.redhat.com.  If you understand the file
-	format (or can cut-and-paste existing entries), modify it. If
-	it scares you, get someone who does understand it to help you.
-	Be prepared to fix it if you do break it.
+	If you understand the file format (or can cut-and-paste existing
+	entries), modify it. If it scares you, get someone who does
+	understand it to help you.  Be prepared to fix it if you do break it.
 
 /* Local variables: */
 /* change-log-default-name: "/dev/null" */
diff --git a/bfd/version.h b/bfd/version.h
index e217c6e..9edbf4d 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20090818
+#define BFD_VERSION_DATE 20090819
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cf5b0db..1c4c56d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,24 @@
+2009-08-19  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* value.c (enum internalvar_kind): Replace INTERNALVAR_SCALAR by
+	INTERNALVAR_INTEGER and INTERNALVAR_POINTER.
+	(union internalvar_data): Replace "scalar" member by "integer"
+	and "pointer".
+	(value_of_internalvar): Handle INTERNALVAR_INTEGER and
+	INTERNALVAR_POINTER instead of INTERNALVAR_SCALAR.
+	(get_internalvar_integer): Likewise.
+	(set_internalvar): Likewise.
+	(set_internalvar_integer): Likewise.
+	(preserve_one_internalvar): Likewise.
+	(value_from_pointer): Handle typedef'd pointer types.
+
+2009-08-18  Tom Tromey  <tromey@redhat.com>
+
+	* utils.c (add_internal_problem_command): Free set_doc and
+	show_doc.
+	* remote.c (add_packet_config_cmd): Free set_doc and show_doc.
+	* language.c (add_language): Free language_set_doc.
+
 2009-08-18  Tom Tromey  <tromey@redhat.com>
 
 	* Makefile.in (ALL_TARGET_OBS): Remove prologue-value.o, solib.o.
diff --git a/gdb/language.c b/gdb/language.c
index d975f23..51a49f8 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -884,7 +884,7 @@ add_language (const struct language_defn *lang)
   /* For the "set language" command.  */
   static char **language_names = NULL;
   /* For the "help set language" command.  */
-  static char *language_set_doc = NULL;
+  char *language_set_doc = NULL;
 
   int i;
   struct ui_file *tmp_stream;
@@ -943,7 +943,6 @@ local or auto    Automatic setting based on source file\n"));
 			  languages[i]->la_name + 1);
     }
 
-  xfree (language_set_doc);
   language_set_doc = ui_file_xstrdup (tmp_stream, NULL);
   ui_file_delete (tmp_stream);
 
@@ -955,6 +954,8 @@ Show the current source language."), NULL,
 			set_language_command,
 			show_language_command,
 			&setlist, &showlist);
+
+  xfree (language_set_doc);
 }
 
 /* Iterate through all registered languages looking for and calling
diff --git a/gdb/remote.c b/gdb/remote.c
index 4c58abb..e2672d3 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -865,6 +865,9 @@ add_packet_config_cmd (struct packet_config *config, const char *name,
 				set_remote_protocol_packet_cmd,
 				show_remote_protocol_packet_cmd,
 				&remote_set_cmdlist, &remote_show_cmdlist);
+  /* The command code copies the documentation strings.  */
+  xfree (set_doc);
+  xfree (show_doc);
   /* set/show remote NAME-packet {auto,on,off} -- legacy.  */
   if (legacy)
     {
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b56dfc4..9765281 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-19  Doug Evans  <dje@google.com>
+
+	* gdb.base/gdbvars.c: New file.
+	* gdb.base/gdbvars.exp: Test convenience vars with program variables.
+
 2009-08-14  Pedro Alves  <pedro@codesourcery.com>
 
 	* gdb.threads/killed.exp, gdb.threads/manythreads.exp,
diff --git a/gdb/testsuite/gdb.base/gdbvars.c b/gdb/testsuite/gdb.base/gdbvars.c
new file mode 100644
index 0000000..3a3ba24
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gdbvars.c
@@ -0,0 +1,16 @@
+/* Simple program to help exercise gdb's convenience variables.  */
+
+typedef void *ptr;
+
+ptr p = &p;
+
+int
+main ()
+{
+#ifdef usestubs
+    set_debug_traps ();
+    breakpoint ();
+#endif
+
+  return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gdbvars.exp b/gdb/testsuite/gdb.base/gdbvars.exp
index 1c29ea6..8246a14 100644
--- a/gdb/testsuite/gdb.base/gdbvars.exp
+++ b/gdb/testsuite/gdb.base/gdbvars.exp
@@ -22,6 +22,15 @@ if $tracelevel then {
 set prms_id 0
 set bug_id 0
 
+set testfile "gdbvars"
+set srcfile  ${testfile}.c
+set binfile  ${objdir}/${subdir}/${testfile}
+
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+    untested gdbvars.exp
+    return -1
+}
+
 proc test_convenience_variables {} {
     global gdb_prompt
 
@@ -101,13 +110,23 @@ proc test_value_history {} {
 	"Use value-history element in arithmetic expression"
 }
 
+proc test_with_program {} {
+    global hex
+    gdb_test "set \$prog_var = p" "" \
+	"Set a new convenience variable to a program variable"
+    gdb_test "print /x \$prog_var" " = $hex" \
+	"Print contents of new convenience variable of program variable"
+}
+
 # Start with a fresh gdb.
 
 gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
 
 send_gdb "set print sevenbit-strings\n" ; gdb_expect -re ".*$gdb_prompt $"
 
 test_value_history
 test_convenience_variables
+test_with_program
diff --git a/gdb/utils.c b/gdb/utils.c
index 5fa2f26..16ad084 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1098,6 +1098,9 @@ Show whether GDB will quit when an %s is detected"),
 			set_cmd_list,
 			show_cmd_list);
 
+  xfree (set_doc);
+  xfree (show_doc);
+
   set_doc = xstrprintf (_("\
 Set whether GDB should create a core file of GDB when %s is detected"),
 			problem->name);
@@ -1114,6 +1117,9 @@ Show whether GDB will create a core file of GDB when %s is detected"),
 			NULL, /* showfunc */
 			set_cmd_list,
 			show_cmd_list);
+
+  xfree (set_doc);
+  xfree (show_doc);
 }
 
 /* Print the system error message for errno, and also mention STRING
diff --git a/gdb/value.c b/gdb/value.c
index b83cade..76638f8 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -951,8 +951,11 @@ struct internalvar
       /* The internal variable holds a GDB internal convenience function.  */
       INTERNALVAR_FUNCTION,
 
-      /* The variable holds a simple scalar value.  */
-      INTERNALVAR_SCALAR,
+      /* The variable holds an integer value.  */
+      INTERNALVAR_INTEGER,
+
+      /* The variable holds a pointer value.  */
+      INTERNALVAR_POINTER,
 
       /* The variable holds a GDB-provided string.  */
       INTERNALVAR_STRING,
@@ -975,19 +978,22 @@ struct internalvar
 	  int canonical;
 	} fn;
 
-      /* A scalar value used with INTERNALVAR_SCALAR.  */
+      /* An integer value used with INTERNALVAR_INTEGER.  */
       struct
         {
 	  /* If type is non-NULL, it will be used as the type to generate
 	     a value for this internal variable.  If type is NULL, a default
 	     integer type for the architecture is used.  */
 	  struct type *type;
-	  union
-	    {
-	      LONGEST l;    /* Used with TYPE_CODE_INT and NULL types.  */
-	      CORE_ADDR a;  /* Used with TYPE_CODE_PTR types.  */
-	    } val;
-        } scalar;
+	  LONGEST val;
+        } integer;
+
+      /* A pointer value used with INTERNALVAR_POINTER.  */
+      struct
+        {
+	  struct type *type;
+	  CORE_ADDR val;
+        } pointer;
 
       /* A string value used with INTERNALVAR_STRING.  */
       char *string;
@@ -1113,16 +1119,16 @@ value_of_internalvar (struct gdbarch *gdbarch, struct internalvar *var)
       val = allocate_value (builtin_type (gdbarch)->internal_fn);
       break;
 
-    case INTERNALVAR_SCALAR:
-      if (!var->u.scalar.type)
+    case INTERNALVAR_INTEGER:
+      if (!var->u.integer.type)
 	val = value_from_longest (builtin_type (gdbarch)->builtin_int,
-				  var->u.scalar.val.l);
-      else if (TYPE_CODE (var->u.scalar.type) == TYPE_CODE_INT)
-	val = value_from_longest (var->u.scalar.type, var->u.scalar.val.l);
-      else if (TYPE_CODE (var->u.scalar.type) == TYPE_CODE_PTR)
-	val = value_from_pointer (var->u.scalar.type, var->u.scalar.val.a);
+				  var->u.integer.val);
       else
-        internal_error (__FILE__, __LINE__, "bad type");
+	val = value_from_longest (var->u.integer.type, var->u.integer.val);
+      break;
+
+    case INTERNALVAR_POINTER:
+      val = value_from_pointer (var->u.pointer.type, var->u.pointer.val);
       break;
 
     case INTERNALVAR_STRING:
@@ -1176,14 +1182,9 @@ get_internalvar_integer (struct internalvar *var, LONGEST *result)
 {
   switch (var->kind)
     {
-    case INTERNALVAR_SCALAR:
-      if (var->u.scalar.type == NULL
-	  || TYPE_CODE (var->u.scalar.type) == TYPE_CODE_INT)
-	{
-	  *result = var->u.scalar.val.l;
-	  return 1;
-	}
-      /* Fall through.  */
+    case INTERNALVAR_INTEGER:
+      *result = var->u.integer.val;
+      return 1;
 
     default:
       return 0;
@@ -1255,15 +1256,15 @@ set_internalvar (struct internalvar *var, struct value *val)
       break;
 
     case TYPE_CODE_INT:
-      new_kind = INTERNALVAR_SCALAR;
-      new_data.scalar.type = value_type (val);
-      new_data.scalar.val.l = value_as_long (val);
+      new_kind = INTERNALVAR_INTEGER;
+      new_data.integer.type = value_type (val);
+      new_data.integer.val = value_as_long (val);
       break;
 
     case TYPE_CODE_PTR:
-      new_kind = INTERNALVAR_SCALAR;
-      new_data.scalar.type = value_type (val);
-      new_data.scalar.val.a = value_as_address (val);
+      new_kind = INTERNALVAR_POINTER;
+      new_data.pointer.type = value_type (val);
+      new_data.pointer.val = value_as_address (val);
       break;
 
     default:
@@ -1300,9 +1301,9 @@ set_internalvar_integer (struct internalvar *var, LONGEST l)
   /* Clean up old contents.  */
   clear_internalvar (var);
 
-  var->kind = INTERNALVAR_SCALAR;
-  var->u.scalar.type = NULL;
-  var->u.scalar.val.l = l;
+  var->kind = INTERNALVAR_INTEGER;
+  var->u.integer.type = NULL;
+  var->u.integer.val = l;
 }
 
 void
@@ -1409,10 +1410,13 @@ value_types_mark_used (void)
 	type_mark_used (value_type (var->u.value));
 	break;
 
-      case INTERNALVAR_SCALAR:
-	type_mark_used (var->u.scalar.type);
+      case INTERNALVAR_INTEGER:
+	type_mark_used (var->u.integer.type);
 	break;
 
+      case INTERNALVAR_POINTER:
+	type_mark_used (var->u.pointer.type);
+	break;
       }
 
   for (chunk = value_history_chain; chunk != NULL; chunk = chunk->next)
@@ -1487,10 +1491,16 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile,
 {
   switch (var->kind)
     {
-    case INTERNALVAR_SCALAR:
-      if (var->u.scalar.type && TYPE_OBJFILE (var->u.scalar.type) == objfile)
-	var->u.scalar.type
-	  = copy_type_recursive (var->u.scalar.type, copied_types);
+    case INTERNALVAR_INTEGER:
+      if (var->u.integer.type && TYPE_OBJFILE (var->u.integer.type) == objfile)
+	var->u.integer.type
+	  = copy_type_recursive (var->u.integer.type, copied_types);
+      break;
+
+    case INTERNALVAR_POINTER:
+      if (TYPE_OBJFILE (var->u.pointer.type) == objfile)
+	var->u.pointer.type
+	  = copy_type_recursive (var->u.pointer.type, copied_types);
       break;
 
     case INTERNALVAR_VALUE:
@@ -2225,7 +2235,7 @@ struct value *
 value_from_pointer (struct type *type, CORE_ADDR addr)
 {
   struct value *val = allocate_value (type);
-  store_typed_address (value_contents_raw (val), type, addr);
+  store_typed_address (value_contents_raw (val), check_typedef (type), addr);
   return val;
 }
 
diff --git a/gdb/version.in b/gdb/version.in
index f2db57a..efdb7f2 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-6.8.50.20090818-cvs
+6.8.50.20090819-cvs


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


             reply	other threads:[~2009-08-19 15:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19 15:23 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-09-09 16:16 jkratoch
2009-09-01 11:53 jkratoch
2009-07-31 18:51 jkratoch
2009-07-30 21:17 jkratoch
2008-12-28 16:26 jkratoch
2008-12-14 23:51 jkratoch
2008-12-07  2:49 jkratoch
2008-11-27 15:52 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=20090819152303.28983.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).