Multiple nested breakpoints

Sysprogs forums Forums VisualGDB Multiple nested breakpoints

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13147
    BitFlipper
    Participant

    Hi,

    I sometimes run into this issue where if I place a single breakpoint, VS would show multiple nested breakpoints for the same line. Usually this doesn’t interfere, but sometimes I noticed if there are many such nested breakpoints (I counted 1 parent breakpoint with 9 nested child breakpoints on the same source line), GDB would not respond for a long time and VGDB says GDB break in request is taking too long to complete. In those cases I have to stop debugging (which itself is annoying since VS locks up for some reason for some time while debugging is being stopped – And I need to tell VGDB twice to stop debugging as it pops up 2 dialogs).

    Any idea what is causing these multiple breakpoints when I place a single one, and why they are causing problems?

    #13148
    support
    Keymaster

    Hi,

    The multiple nested breakpoints occur when one line of source code corresponds to multiple addresses (and hence needs multiple physical breakpoints). The usually happens with inlined functions or templates (e.g. list<int>::sort() vs list<string>::sort()).

    It is hard to say why would this make VS hang. One guess would be that gdb needs to update too many physical breakpoints each time you stop the session and this takes time. You can try running the “set breakpoint always-inserted on” command to prevent gdb from updating breakpoints each time the session stops.

    If this doesn’t help, we would recommend narrowing it down to a specific breakpoint (e.g. measuring break-in delay with and without it) and checking if this can also be reproduced without VisualGDB. If not, some gdb options or initialization commands could be affecting it. If yes, it’s likely a limitation of gdb and not much could be done to work around it other than generally speeding up connection to your target.

    #13343
    BitFlipper
    Participant

    Oops, sorry to say thanks, I realized later that since I was using template functions, it was inserting a breakpoint for each type for which it created a template function. As for the slow response, never figure out what that was. It did eventually seem to go away as it might have had something to do with path mappings that were not set up properly at that time.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.