This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: value_contents_writeable cleanup in alpha-tdep.c


I'm checking this in.

As part of my optimized-out-pieces work, I audited all the calls to
value_contents_raw, value_contents_all_raw, and
value_contents_writeable, to see if they were ever being used
incorrectly.  Good news: there were very few questionable cases.

This patch fixes one problem case.  alpha_push_dummy_call was using
value_contents_writeable but never writing to the contents.

I don't have an alpha on which to test this, but I think it is obviously
correct.

Tom

2010-05-27  Tom Tromey  <tromey@redhat.com>

	* alpha-tdep.c (alpha_push_dummy_call): Make alpha_arg.contents
	const.  Use value_contents, not value_contents_writeable.

Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.198
diff -u -r1.198 alpha-tdep.c
--- alpha-tdep.c	23 Apr 2010 15:14:22 -0000	1.198
+++ alpha-tdep.c	27 May 2010 18:43:45 -0000
@@ -295,7 +295,7 @@
   int accumulate_size = struct_return ? 8 : 0;
   struct alpha_arg
     {
-      gdb_byte *contents;
+      const gdb_byte *contents;
       int len;
       int offset;
     };
@@ -393,7 +393,7 @@
       m_arg->len = TYPE_LENGTH (arg_type);
       m_arg->offset = accumulate_size;
       accumulate_size = (accumulate_size + m_arg->len + 7) & ~7;
-      m_arg->contents = value_contents_writeable (arg);
+      m_arg->contents = value_contents (arg);
     }
 
   /* Determine required argument register loads, loading an argument register
@@ -415,7 +415,7 @@
   /* `Push' arguments on the stack.  */
   for (i = nargs; m_arg--, --i >= 0;)
     {
-      gdb_byte *contents = m_arg->contents;
+      const gdb_byte *contents = m_arg->contents;
       int offset = m_arg->offset;
       int len = m_arg->len;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]