This is the mail archive of the gdb-cvs@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]

[binutils-gdb] Fix compilation error in ia64-tdep.c with libunwind-ia64


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5d691c8829d0e5c4c4b9cfb147c8a873ce18085b

commit 5d691c8829d0e5c4c4b9cfb147c8a873ce18085b
Author: Simon Marchi <simark@simark.ca>
Date:   Sat Jul 7 11:10:49 2018 -0400

    Fix compilation error in ia64-tdep.c with libunwind-ia64
    
    Commit
    
      9018be22e022 ("Make target_read_alloc & al return vectors")
    
    failed to update the code in ia64-tdep.c, for HAVE_LIBUNWIND_IA64_H.
    This patch fixes that.
    
    gdb/ChangeLog:
    
    	* ia64-tdep.c (ktab_buf): New global.
    	(getunwind_table): Return a gdb::optional<gdb::byte_vector>.
    	(get_kernel_table): Adjust.

Diff:
---
 gdb/ia64-tdep.c | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 0df62e2..2fab60c 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -69,6 +69,7 @@ struct ia64_table_entry
   };
 
 static struct ia64_table_entry *ktab = NULL;
+static gdb::optional<gdb::byte_vector> ktab_buf;
 
 #endif
 
@@ -2647,11 +2648,9 @@ ia64_access_mem (unw_addr_space_t as,
 }
 
 /* Call low-level function to access the kernel unwind table.  */
-static LONGEST
-getunwind_table (gdb_byte **buf_p)
+static gdb::optional<gdb::byte_vector>
+getunwind_table ()
 {
-  LONGEST x;
-
   /* FIXME drow/2005-09-10: This code used to call
      ia64_linux_xfer_unwind_table directly to fetch the unwind table
      for the currently running ia64-linux kernel.  That data should
@@ -2660,10 +2659,8 @@ getunwind_table (gdb_byte **buf_p)
      we should find a way to override the corefile layer's
      xfer_partial method.  */
 
-  x = target_read_alloc (current_top_target (), TARGET_OBJECT_UNWIND_TABLE,
-			 NULL, buf_p);
-
-  return x;
+  return target_read_alloc (current_top_target (), TARGET_OBJECT_UNWIND_TABLE,
+			    NULL);
 }
 
 /* Get the kernel unwind table.  */				 
@@ -2674,15 +2671,12 @@ get_kernel_table (unw_word_t ip, unw_dyn_info_t *di)
 
   if (!ktab) 
     {
-      gdb_byte *ktab_buf;
-      LONGEST size;
-
-      size = getunwind_table (&ktab_buf);
-      if (size <= 0)
+      ktab_buf = getunwind_table ();
+      if (!ktab_buf)
 	return -UNW_ENOINFO;
 
-      ktab = (struct ia64_table_entry *) ktab_buf;
-      ktab_size = size;
+      ktab = (struct ia64_table_entry *) ktab_buf->data ();
+      ktab_size = ktab_buf->size ();
 
       for (etab = ktab; etab->start_offset; ++etab)
         etab->info_offset += KERNEL_START;


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