Re: [PATCH/7.6] Fix wrong release (maybe crash GDB) in build_target_command_list

Tom Tromey
2013-04-24T14:31:03Z

>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:

Hui> 2013-04-24 Hui Zhu <hui@codesourcery.com>

Hui> * breakpoint.c (build_target_command_list): Change loc->cond_bytecode
Hui> to loc->cmd_bytecode.

Is it possible to make a test case for this?

The patch looks good.

I am curious about this code in build_target_command_list:

aexpr = parse_cmd_to_aexpr (bl->address,
loc->owner->extra_string);
loc->cmd_bytecode = aexpr;

if (!aexpr)
continue;

The "continue" seems to mean that null_command_or_parse_error will not
be set in the "parse error" case.

Also, parse_cmd_to_aexpr calls 'error' in a few spots but then in
another spot is careful not to. This seems somewhat odd.

Tom