Bug 5503 - looping program hits infinite breakpoints
Summary: looping program hits infinite breakpoints
Status: RESOLVED WONTFIX
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Tim Moore
URL:
Keywords:
Depends on:
Blocks: 2246 5495
  Show dependency treegraph
 
Reported: 2007-12-17 16:26 UTC by Andrew Cagney
Modified: 2008-01-04 12:00 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cagney 2007-12-17 16:26:41 UTC
Consider:

main()
{
   while(1);
}

and:
  (fhpd) break main
  (fhpd) step
gets infinite reports of the breakpoint main being hit.

this is caused by the breakpoint code not injecting a "breakpoint-hit" event
into the stepping engine.
Comment 1 Tim Moore 2008-01-04 12:00:26 UTC
This function, even without optimization, degenerates to one instruction after
the function prologue: a jump to itself. The address of the breakpoint is this
instruction. For reference, gdb shows the same behavior with optimized and
optimized version of the function.