From 6672f2ae34dee699919822bbca9817b43355e483 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 14 Apr 2004 15:18:06 +0000 Subject: [PATCH] * ia64-tdep.c (ia64_libunwind_frame_prev_register): Handle null value buffer. * libunwind-frame.c (libunwind_frame_prev_register): Likewise. --- gdb/ChangeLog | 6 ++++++ gdb/ia64-tdep.c | 4 ++++ gdb/libunwind-frame.c | 8 +++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 44a98f269b2..8a239e2f13e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-04-14 Andreas Schwab + + * 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 * vax-tdep.c (vax_store_arguments, vax_push_dummy_call) diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 3bc812927db..aefd3e3c8eb 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -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; diff --git a/gdb/libunwind-frame.c b/gdb/libunwind-frame.c index d7e8dbca3e4..3462625f3e4 100644 --- a/gdb/libunwind-frame.c +++ b/gdb/libunwind-frame.c @@ -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; -- 2.30.2