public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* breakpoints/2544: Assertion failure in insert_single_step_breakpoint in breakpoint.c
@ 2008-10-27 16:48 richard.stuckey
0 siblings, 0 replies; only message in thread
From: richard.stuckey @ 2008-10-27 16:48 UTC (permalink / raw)
To: gdb-gnats
>Number: 2544
>Category: breakpoints
>Synopsis: Assertion failure in insert_single_step_breakpoint in breakpoint.c
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Oct 27 16:48:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: ARC International
>Release: 6.8
>Organization:
>Environment:
Linux
>Description:
The function insert_single_step_breakpoint may be called twice from the architecture-specific software_single_step function: once to set a breakpoint after the instruction that is to be stepped, and once to set a breakpoint on the instruction that is the destination of that instruction, if it is a branch.
If the second breakpoint set attempt fails (e.g. because an invalid target address has been given), the first breakpoint is left set; if insert_single_step_breakpoint is then called again twice from another invocation of software_single_step, it tries to use the array element single_step_breakpoints[1] twice (as element [0] is non-NULL), and the assertion "single_step_breakpoints[1] == NULL" fails on the second attempt.
>How-To-Repeat:
>Fix:
Change the code in the insert_single_step_breakpoint function from
if (*bpt_p == NULL)
error (_("Could not insert single-step breakpoint at 0x%s"),
paddr_nz (next_pc));
to
if (*bpt_p == NULL)
{
if (single_step_breakpoints[0] != NULL)
remove_single_step_breakpoints ();
error (_("Could not insert single-step breakpoint at 0x%s"),
paddr_nz (next_pc));
}
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-10-27 16:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-27 16:48 breakpoints/2544: Assertion failure in insert_single_step_breakpoint in breakpoint.c richard.stuckey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).