HISE Logo Forum
    • Categories
    • Register
    • Login

    Getting debug output to the compiler console..

    Scheduled Pinned Locked Moved C++ Development
    17 Posts 4 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LindonL
      Lindon @d.healey
      last edited by

      @d-healey Thanks - I'll give that a try...

      HISE Development for hire.
      www.channelrobot.com

      1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @d.healey
        last edited by

        @d-healey said in Getting debug output to the compiler console..:

        JUCE command - DBG() - https://forum.juce.com/t/dbg-vs-printf-std-cout/16517

        well I cant get this to output anything - the debug version wont compile, but the release version compiles with this code in it -- so it should be sending the results somewhere.....any idea where?

        HISE Development for hire.
        www.channelrobot.com

        d.healeyD 1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey @Lindon
          last edited by

          @Lindon said in Getting debug output to the compiler console..:

          the debug version wont compile,

          Any idea why?

          so it should be sending the results somewhere.....any idea where?

          Nope, I haven't done much debugging in VS

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          LindonL 1 Reply Last reply Reply Quote 0
          • LindonL
            Lindon @d.healey
            last edited by Lindon

            @d-healey the debug build now tells me this:

            c:\hise\hi_modules\modulators\mods\controlmodulator.cpp(261): error C2280: 'juce::String &juce::operator <<(juce::String &,bool)': attempting to reference a deleted function (compiling source file ....\JuceLibraryCode\include_hi_modules_01.cpp)

            -- thats the line with one of the DBG statement in it...but tis one thats trying to show me a value - so I'm asking it not to send a string but a bool, hmm, wonder if I have to cast this somehow...

            HISE Development for hire.
            www.channelrobot.com

            LindonL 1 Reply Last reply Reply Quote 0
            • LindonL
              Lindon @Lindon
              last edited by

              @Lindon - OK I got the debug version to compile - still nothing coming out of the output window.... even for simple "we are here" text

              Meanwhile teh debug tells me this:

              Exception thrown at 0x00007FFA25C24ED9 in HISE Debug.exe: Microsoft C++ exception: hise::HiseJavascriptEngine::RootObject::Error at memory location 0x000000F59DD2EB48.

              Which I think has NOTHING to do with my problem....so either

              A. I dont know what I'm doing and the DBG statements are going somewhere else...<-- quite possible

              or

              B. none of the aftertouch code is getting executed at all

              HISE Development for hire.
              www.channelrobot.com

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @Lindon
                last edited by

                @Lindon Try putting the DBG somewhere else - like at the start of main, so you can rule out (a)

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                LindonL 1 Reply Last reply Reply Quote 0
                • LindonL
                  Lindon @d.healey
                  last edited by

                  @d-healey -- and "Main" is where in HISE?

                  HISE Development for hire.
                  www.channelrobot.com

                  1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey
                    last edited by

                    My guess is mainController.cpp is doing the same thing that main usually does.

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    LindonL 1 Reply Last reply Reply Quote 0
                    • LindonL
                      Lindon @d.healey
                      last edited by Lindon

                      @d-healey - yep that was my guess too so I put this in there:

                      
                      /** The entire HISE codebase
                      
                      
                      */
                      namespace hise { using namespace juce;
                      
                      #if HI_RUN_UNIT_TESTS
                      bool MainController::unitTestMode = false;
                      #endif
                      
                      DBG("in here at the start");
                      
                      MainController::MainController() :
                      
                      	sampleManager(new SampleManager(this)),
                      	javascriptThreadPool(new JavascriptThreadPool(this)),
                      	expansionHandler(this),
                      	allNotesOffFlag(false),
                      	maxBufferSize(-1),
                      	cpuBufferSize(0),
                      ...
                      ...
                      ...
                      

                      Compiled a release version and ran it -----

                      nothing showed up in the output window, so - its looking like a. (I dont know what I'm doing, not surprising...)

                      Where does DBG send statements to?

                      more research shows this:

                      DBG( "message" );
                      messages only show up in the output window in your IDE in debug builds, not release builds.
                      If you want to know how it works, right click on it, “Go to definition” and look at the source code. it’s just a macro.

                      use breakpoints. Xcode and Visual Studio have great support for breakpoints and debugging.

                      HISE Development for hire.
                      www.channelrobot.com

                      d.healeyD 1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @Lindon
                        last edited by

                        @Lindon

                        Where does DBG send statements to?

                        I work in the terminal so that's where I see the output. Someone else was asking me about debugging in VS a while ago, I suggested they search YouTube and find some proper instructions for debugging - I'll be doing this too when I do my next Windows build - they seemed to find it helpful.

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        LindonL 1 Reply Last reply Reply Quote 0
                        • LindonL
                          Lindon @d.healey
                          last edited by

                          @d-healey well I built another debug image - and still nothing is showing up... so youTube might be my next port of call...

                          • is this any easier in MacOS?

                          HISE Development for hire.
                          www.channelrobot.com

                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • d.healeyD
                            d.healey @Lindon
                            last edited by

                            @Lindon I'm a GNU/Linux guy :) You can debug on Windows and MacOS using the terminal though. Make a debug build and run it from the terminal.

                            Libre Wave - Freedom respecting instruments and effects
                            My Patreon - HISE tutorials
                            YouTube Channel - Public HISE tutorials

                            1 Reply Last reply Reply Quote 0
                            • Christoph HartC
                              Christoph Hart
                              last edited by

                              The DBG call must be inside a function body and is only available in Debug builds (hence the name). In your example you‘ve put it into global namespace which is basically a vacuum in C++.

                              LindonL B 2 Replies Last reply Reply Quote 1
                              • LindonL
                                Lindon @Christoph Hart
                                last edited by

                                @Christoph-Hart - yep I worked that out so I put it in the function...still I'm not seeing any output....:-(

                                HISE Development for hire.
                                www.channelrobot.com

                                1 Reply Last reply Reply Quote 0
                                • B
                                  Bob Stuck @Christoph Hart
                                  last edited by

                                  @Christoph-Hart Sent you a message.

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post

                                  24

                                  Online

                                  1.7k

                                  Users

                                  11.8k

                                  Topics

                                  102.8k

                                  Posts