User forums > Using Code::Blocks

GDB question and linked static libs...

<< < (3/3)

thomas:

--- Quote ---Guess what: this isn't going to work. You can't just count lines! What if these lines contain conditional blocks, like if-else?
--- End quote ---

Oh right, I entirely forgot about that... there might be for() or while() loops or something, too.

But on the good side, we have gdb's output after calling next:
At D:/Desktop/cb/src/main.cpp:534

Since we always know what line we're in, we could actually call next until the line number where the breakpoint should be is eventually reached.

The only problem is that it is possible that a breakpoint is never reached at all. In that case, we would be stepping through the program for forever and a day.
But... we do have the stack frame. Thus, we could set a breakpoint at the return address, and if that one is reached for whatever reason, assume that the breakpoint won't be hit any more and resume normal operation.
That way, we step through the code line by line until either the constructor is left or the breakpoint line is reached.

It is still a lot of work for rather little benefit, but I think it should work (and we'd be the one and only IDE for gcc having working breakpoints in constructors ;)).

killerbot:

--- Quote ---It is still a lot of work for rather little benefit, but I think it should work (and we'd be the one and only IDE for gcc having working breakpoints in constructors Wink).
--- End quote ---
:twisted: :twisted: :twisted: :twisted:

sethjackson:

--- Quote ---It is still a lot of work for rather little benefit, but I think it should work (and we'd be the one and only IDE for gcc having working breakpoints in constructors :wink:).

--- End quote ---

Actually one and only cross-platform IDE (to have this feature). :)  8)

Navigation

[0] Message Index

[*] Previous page

Go to full version