https://bugs.kde.org/show_bug.cgi?id=389424

            Bug ID: 389424
           Summary: [Wish] Give a hint to the debugger how you want to
                    view a variable and custom views
           Product: kdevelop
           Version: 5.2.1
          Platform: Gentoo Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: CPP Debugger
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: spalmr...@gmail.com
                CC: niko.s...@gmail.com
  Target Milestone: ---

I think it would be useful if I could put a hint in my code how I want to view
a variable in the debugger instead of having to manually change it every time I
debug.

Something like:

int func() {
    // Show this variable as 'hex' by default
    /// kdbg(format:hex)
    int a1 = 0x20;

    // Show this variable as 'binary' by default, filling the left side with
0's
    /// kdbg(format:bin,fill:'0')
    int a2 = 127;

    // Show this float variable with no exponent but with 9 significant digits
    /// kdbg(notation:noexp,digits:9)
    float a3 = 0.000004;

    ...
}

I've added a couple other bits of functionality here too such as 0-filling and
different formats for float variables. This can be ignored of course.

Expanding this a bit more, I would like to be able to write custom views of
variables in the debugger, for example being able to view matrices in an actual
matrix view. Then this notification mechanism could be used to tell the
debugger when to use this custom view. Example:


#include <glm/glm.h>

void render() {

    /// kdbg(format:glm-matrix4)
    glm::mat4 projection = GetProjectionMatrix();

    /// kdbg(format:glm-vec3)
    glm::vec3 direction = GetDirection();

    ...
}

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to