From e354df01666a71881088ba0c6ac144f8b4fd023e Mon Sep 17 00:00:00 2001 From: "Nathan J. Williams" Date: Fri, 27 Aug 2004 18:03:32 +0000 Subject: [PATCH] * target.c (target_resize_to_sections): Check current_target.to_sections for an old value when updating. --- gdb/ChangeLog | 5 +++++ gdb/target.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0ac0540bce..e5fa2245fe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-08-27 Nathan J. Williams + + * target.c (target_resize_to_sections): Check + current_target.to_sections for an old value when updating. + 2004-08-27 Joel Brobecker * procfs.c (dbx_link_bpt_addr): New static global variable. diff --git a/gdb/target.c b/gdb/target.c index d577055974..5faf5a8472 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1415,6 +1415,13 @@ target_resize_to_sections (struct target_ops *target, int num_added) (*t)->to_sections_end = target->to_sections_end; } } + /* There is a flattened view of the target stack in current_target, + so its to_sections pointer might also need updating. */ + if (current_target.to_sections == old_value) + { + current_target.to_sections = target->to_sections; + current_target.to_sections_end = target->to_sections_end; + } } return old_count; -- 2.34.1