* target.c (target_resize_to_sections): Check
authorNathan J. Williams <nathanw@wasabisystems.com>
Fri, 27 Aug 2004 18:03:32 +0000 (18:03 +0000)
committerNathan J. Williams <nathanw@wasabisystems.com>
Fri, 27 Aug 2004 18:03:32 +0000 (18:03 +0000)
        current_target.to_sections for an old value when updating.

gdb/ChangeLog
gdb/target.c

index 0ac0540bcec19a66e46cd9dbc8d883cb71767d62..e5fa2245fe1a53849572848fbc924c8a852b6667 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-27  Nathan J. Williams  <nathanw@wasabisystems.com>
+
+       * target.c (target_resize_to_sections): Check
+       current_target.to_sections for an old value when updating.
+
 2004-08-27  Joel Brobecker  <brobecker@gnat.com>
 
        * procfs.c (dbx_link_bpt_addr): New static global variable.
index d5770559740b8310112c19a6558fb0bb07e7892e..5faf5a84725c3fdf268958e20fa935a39b3bb23b 100644 (file)
@@ -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;