[patch] Fix remote.c incorrectly using pop_target (wrt btrace)

Yao Qi yao@codesourcery.com
Mon Mar 18 02:09:00 GMT 2013


On 03/16/2013 03:54 AM, Jan Kratochvil wrote:
>> Since it is in remote_open_1, the remote target or exteneded-remote
>> >target is just pushed and top most, so pop_target should be fine
>> >here. It is not necessary to change it to remote_unpush_target.
> OK; but one should remove pop_target later, there remain only few uses of it.
> When its use is not incorrect it is at least fragile/dangerous.
>

Jan,
I can imagine that using pop_target is fragile in general, but is it 
fragile/dangerous to use pop_target in remote_open_1?  IMO, pop_target 
naturally fits the needs there (push target on stack -> setting up -> 
pop target out of stack on error).  pop_target is also used in 
tracepoint.c:tfile_open, which is similar to this case.

The rest of this patch looks right to me.

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list