This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix bug 15433 - GDB crashes when using agent dprintf, %s format, and an in-line string
- From: Yao Qi <yao at codesourcery dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Mon, 13 May 2013 15:13:09 +0800
- Subject: Re: [PATCH] Fix bug 15433 - GDB crashes when using agent dprintf, %s format, and an in-line string
- References: <CANFwon1MsCu4Abzdh75jB5i-+rXZizYb_Rwx++cnBxzJhV5_Cw at mail dot gmail dot com>
On 05/11/2013 01:54 PM, Hui Zhu wrote:
@@ -2302,6 +2302,9 @@ build_target_command_list (struct bp_loc
need to parse the command to bytecodes again. */
aexpr = parse_cmd_to_aexpr (bl->address,
loc->owner->extra_string);
+ if (aexpr == NULL)
+ error (_("Agent is not support commands of breakpoint %d."),
+ bl->owner->number);
loc->cmd_bytecode = aexpr;
if (!aexpr)
The existing code has considered the situation that we have a NULL
bytecode expression. Several lines of code below this line of patch do
something,
/* If we have a NULL bytecode expression, it means something
went wrong or we have a null command expression. */
if (!loc->cmd_bytecode)
{
null_command_or_parse_error = 1;
break;
}
}
}
/* If anything failed, then we're not doing target-side commands,
and so clean up. */
if (null_command_or_parse_error)
Your patch doesn't look right, and probably we need to examine why
dprintf breakpoint is not handled well in this part.
--
Yao (éå)