diff options
-rw-r--r-- | contrib/gdb/gdb/target.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/gdb/gdb/target.c b/contrib/gdb/gdb/target.c index ff47ac1..1f703dd 100644 --- a/contrib/gdb/gdb/target.c +++ b/contrib/gdb/gdb/target.c @@ -1425,6 +1425,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; |