Why Debugger hits breakpoint below my target point?

Hi folks,

DEBUG is working again on VSCode, finally :slight_smile:

Now, I’ve a problem. If I place a breakpoint (for example) there at line 1074:

it ONLY stop at 1078. So can’t catch that condition, and not able to debugging at all (at 1078 it will trigger for each Param’s change, not only paramId 9 and value = 0.1).

What can be done? I compile with -O0, isn’t enough?

stop at 1072, the beginning of that function, not in the function itself

it doesn’t make sense: this will break at every function call. I just need to hit when paramId = 9 and value = 0.1f.

This is a bit of a wild stab, but try -ggdb3 rather than -g.

1 Like

Or fabs(value - 0.1) < 0.02 or some such. The param hitting 0.1 exactly is pretty unlikely yeah?

Seems a bit better, but still a pain :slight_smile: Can step-back be activated in VSCode/gdb? I would like to step back on previous lines of code, seeing how the situation was before that instructions etc.

@baconpaul For this specific case, I can intercept exactly 0.1f.

Well except it seems you can’t because the debugger won’t stop :slight_smile:

debuggers are great but when the fail me I often debug with print also. If you put a std::cout << "HERE" << std::endl in the if statement, do you see it and still not get a debugger stop? I would just do that to eliminate any ambiguity about values vs debug infrastructure.

sure I see it. Its like it can’t reach that exact point, dunno why. -ggdb3 seems help anyway.

Now: that’s not enough. I need to go step back instructions by instructions, since I think I’m in the territory of pointer alias and/or memory leaks, and its hard with breakpoint and debug message.

Is it possible to setup this feature with gdb (in VSCode, Windows/MinGW)?

UPDATE: tried -exec target record-full on DEBUG CONSOLE, but it says Process record: the current architecture doesn’t support record function. :sleepy: Can’t we do it on Windows with my actual architecture?

$ gcc -dumpmachine
x86_64-w64-mingw32

I’m sorry I’ve only ever run the rack debugger on mac and lin.

Which architeture do you have? Do you use GDB? Does it support reverse step? I could think to setup the environment…

I use clang in clion on mac and gcc in clion on linux

i have never stepped backwards but see my mac can’t seem to do it - and doc shows this as a gdb not lldb thing on a quick google. I don’t have a linux box with me now to check but the clion doc indicates it would work with gdb on linux.

1 Like

Anyone tried this? Using rr in an IDE · rr-debugger/rr Wiki · GitHub

Maybe can be a solution?

EDIT: doh!!! Only Linux :sleepy:

I assume this is all on a build with optimizations tuned off?

Yes of course. But it seems more catchable now with @Richie tricks.

The Jebrains IDE’s really are second to none, and notice that for FOSS projects you might get them for free @DerozerDSP: https://www.jetbrains.com/community/opensource/#support

1 Like