Cannot resolve breakpoint location

Sysprogs forums Forums VisualGDB Cannot resolve breakpoint location

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #808
    allard
    Participant

    Hi,

    I’m using VS 2012, v 11.0.50727.1 with visual gdb to debug some linux applications. I wrote two applications, they’re quite similar but somehow I can set breakpoints without problems in the first application, but when I set them in the 2nd, after compiling it says “The breakpoint will not currently be hit. Cannot resolve breakpoint location”, even if I place the breakpoint on the first line of my program entry (the main procedure) !

    Any idea’s why and how to solve that problem ?

    #3126
    allard
    Participant

    Hmm actually I think it’s a compiler flag, right ? I see that one that I cant debug has flag -O2 where the other has -g that would make sense, right ? πŸ™‚

    according to gcc manual, -g specifies debugging info ? And that can be used in combo with optimization flag -O2 ? Would that slow my program down ? Anyway I think I solved my own problem again, but will keep the thread in here, might be useful to other linux newbies πŸ˜‰ Will just debug using -g and compile final version using -O2.

    #3127
    support
    Keymaster

    Hi,

    The -g flag won’t slow down your program (as long as you keep the -O2 option), but will increase the binary size by putting debug symbols in it (that can be removed later by running the strip tool). However in the debug configuration it’s recommended to turn off the optimization (replace -O2 with -O0) as it will make debugging much easier (e.g. stepping through code can look semi-random with -O2 due to code reuse). We recommend using “-O2 -ggdb” options for the release build and the “-O0 -ggdb” options for the debug build.

    #3128
    allard
    Participant

    Thanks Bazis !! Really just LOVE your tool, makes life so much better πŸ™‚

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