[RFC/RFA] target.c: Check current_target in target_resize_to_sections

Andrew Cagney cagney@gnu.org
Fri Aug 27 15:13:00 GMT 2004


> Andrew Cagney <cagney@gnu.org> writes:
> 
> 
>>>> > 2004-08-25  Nathan J. Williams  <nathanw@wasabisystems.com>
>>>> > 	* target.c (target_resize_to_sections): Check
>>>> > 	current_target.to_sections for an old value when updating.
>>
>>> 
>>> Can you just add some sort of brief comment noting why current_target
>>> also needs to be checked.  With that it's ok (but post the revised
>>> patch when committing).
> 
> 
> Sure. Should I add the comment to the ChangeLog, the code, or both?
> (The code already says what it's trying to do by updating all this
> stuff, and while it's not obvious when something like current_target
> is missing, it's pretty obvious when it's there).

The code.  The ChangeLog contains what was changed, the code why.
It's not so obvious, as otherwize you'd have not found yourself fixing 
the bug :-)  Just some sort of gentle reminder that current_target 
contains a flattened copy of the target stack and hence also needs to be 
updated.

Andrew




More information about the Gdb-patches mailing list