* ia64-tdep.c (ia64_libunwind_frame_prev_register): Handle null
authorAndreas Schwab <schwab@linux-m68k.org>
Wed, 14 Apr 2004 15:18:06 +0000 (15:18 +0000)
committerAndreas Schwab <schwab@linux-m68k.org>
Wed, 14 Apr 2004 15:18:06 +0000 (15:18 +0000)
value buffer.
* libunwind-frame.c (libunwind_frame_prev_register): Likewise.

gdb/ChangeLog
gdb/ia64-tdep.c
gdb/libunwind-frame.c

index 44a98f2..8a239e2 100644 (file)
@@ -1,3 +1,9 @@
+2004-04-14  Andreas Schwab  <schwab@suse.de>
+
+       * ia64-tdep.c (ia64_libunwind_frame_prev_register): Handle null
+       value buffer.
+       * libunwind-frame.c (libunwind_frame_prev_register): Likewise.
+
 2004-04-14  Mark Kettenis  <kettenis@gnu.org>
 
        * vax-tdep.c (vax_store_arguments, vax_push_dummy_call)
index 3bc8129..aefd3e3 100644 (file)
@@ -2583,6 +2583,10 @@ ia64_libunwind_frame_prev_register (struct frame_info *next_frame,
   libunwind_frame_prev_register (next_frame, this_cache, reg,
                                 optimizedp, lvalp, addrp, realnump, valuep);
 
+  /* No more to do if the value is not supposed to be supplied.  */
+  if (!valuep)
+    return;
+
   if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM)
     {
       ULONGEST prN_val;
index d7e8dbc..3462625 100644 (file)
@@ -1,6 +1,6 @@
 /* Frame unwinder for frames using the libunwind library.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    Written by Jeff Johnston, contributed by Red Hat Inc.
 
@@ -259,7 +259,8 @@ libunwind_frame_prev_register (struct frame_info *next_frame, void **this_cache,
   *lvalp = not_lval;
   *realnump = -1;
 
-  memset (valuep, 0, register_size (current_gdbarch, regnum));
+  if (valuep)
+    memset (valuep, 0, register_size (current_gdbarch, regnum));
 
   if (uw_regnum < 0)
     return;
@@ -281,7 +282,8 @@ libunwind_frame_prev_register (struct frame_info *next_frame, void **this_cache,
   if (ret < 0)
     return;
 
-  memcpy (valuep, ptr, register_size (current_gdbarch, regnum));
+  if (valuep)
+    memcpy (valuep, ptr, register_size (current_gdbarch, regnum));
 
   if (unw_get_saveloc_p (&cache->cursor, uw_regnum, &sl) < 0)
     return;