HISE Logo Forum
    • Categories
    • Register
    • Login

    Debug in VS2022

    Scheduled Pinned Locked Moved General Questions
    50 Posts 6 Posters 2.5k 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.
    • d.healeyD
      d.healey @DanH
      last edited by

      @DanH Try stepping through the code (also going back through the call stack) to try to figure out the root of the issue. Does this actually cause a problem in a release build or is it just showing up in a debug build?

      Try to recreate the issue in a minimal project.

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

      DanHD 1 Reply Last reply Reply Quote 0
      • DanHD
        DanH @d.healey
        last edited by DanH

        @d-healey so the issue is crashing when switching presets. It could be any preset at any time. So rather than click through every preset (which I've done a lot of!) I made a timer which selects the next preset in the list every 2 seconds.

        • it's least stable running the debug within XCode / VS2022. I get call stacks I haven't seen before here.

        • The issue appears in release as well - hence the debugging.

        • So the error could be in the call stack and not necessarily the final file it points at?

        • In standalone builds the debug and release crash in the same thread (JUCE Message Thread Dispatch queue). The crash reports look different - I don't know how to reconcile this, in the sense that the numbers (e.g 0x10a2d7084) are different, but it's my assumption they are pointing at the same thing?

        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
        https://dhplugins.com/ | https://dcbreaks.com/
        London, UK

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

          @DanH Remove half of your presets and see if the problem is still there. If it is, remove half of the remaining presets and test again. Once you figure out which group of presets the problem one (or more than one) is keep repeating this process on that group until you find the culprit.

          I suspect the problem isn't a specific preset though and something to do with the way your project handles one of the controls that the preset is restoring.

          Yes the root cause of the issue isn't necessarily at the last point the call stack made it to. This is why you need to set break points and step through the code.

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

          DanHD 1 Reply Last reply Reply Quote 0
          • DanHD
            DanH @d.healey
            last edited by

            @d-healey Yes I don't think it's specific presets as it does seem random.

            Ok how do I set break points?!

            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
            https://dhplugins.com/ | https://dcbreaks.com/
            London, UK

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

              @DanH

              The same way you do in HISE ;)

              Now is the time for you to go to YouTube and search for Debugging in Visual Studio.

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

              DanHD 1 Reply Last reply Reply Quote 0
              • DanHD
                DanH @d.healey
                last edited by

                @d-healey you mean set break points in the source code?

                DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                https://dhplugins.com/ | https://dcbreaks.com/
                London, UK

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

                  @DanH I'm not sure what you mean. Break points are a feature of the IDE. You add them by clicking in the margin (I have a video on Patreon about HISE breakpoints).

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

                  DanHD 1 Reply Last reply Reply Quote 0
                  • DanHD
                    DanH @d.healey
                    last edited by

                    @d-healey ok let me do some research, thanks for all the help!

                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                    https://dhplugins.com/ | https://dcbreaks.com/
                    London, UK

                    DanHD 1 Reply Last reply Reply Quote 1
                    • DanHD
                      DanH @DanH
                      last edited by DanH

                      Right so through trial and error I've narrowed my bug search to the script below, which is to do with Macros.

                      I've made a mini project with the same script and modules etc, plus some presets for browsing through (which is where the crash happens) but I can't replicate the issue in that project, only my main much larger project.

                      Does anyone have any ideas on how to progress? If I have either part of the script (so either declaring the front end macros, or the laf script - or both) my project crashes. I'm not sure the stack trace is helping, but I could be wrong!

                      ///////////////  MACROS //////////////
                      
                       Engine.setFrontendMacros(["LFO1", "LFO2", "STEP", "X", "Y"]);
                       
                       
                       laf.registerFunction("drawNumberTag", function(g, obj)
                       {
                           var coloursmacros = [0xFF78016F, 0xFF006868, 0xAAFFCA00, 0xFF7B7B7B, 0xFF7B7B7B];
                           obj.area[0] += obj.area[2] - 15;
                           obj.area[1] += 0;
                           obj.area[2] = 14;
                           obj.area[3] = 14;
                           
                           g.setColour(coloursmacros[obj.macroIndex]);
                           g.fillRoundedRectangle(obj.area, 4);
                           g.setColour(0x73D6D6D6);
                           g.drawRoundedRectangle(obj.area, 4, 2);
                           
                           var letters = ["1", "2", "S", "X", "Y"];
                           g.setColour(0xFFE3E3E3);
                           g.drawAlignedText(letters[obj.macroIndex], obj.area, "centred");
                       });
                      

                      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                      https://dhplugins.com/ | https://dcbreaks.com/
                      London, UK

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

                        Duplicate your broken project and start removing stuff systematically until the problem goes away

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

                        DanHD 1 Reply Last reply Reply Quote 0
                        • DanHD
                          DanH @d.healey
                          last edited by DanH

                          @d-healey I’ve just done that. Which is how I ended up at this script. Unless you mean removing ui objects?

                          I went through each section one by one switching the ui objects save in preset function to off until nothing was save in preset and still I had the crash. I removed all scripts one by one until I hit this one.

                          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                          https://dhplugins.com/ | https://dcbreaks.com/
                          London, UK

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

                            @DanH If you comment out the laf function does it work?

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

                            DanHD 1 Reply Last reply Reply Quote 0
                            • DanHD
                              DanH @d.healey
                              last edited by

                              @d-healey It only works if the whole script above is commented out. If either part is there then it crashes.

                              It should also be said that this was apparently working fine in the previous edition of the software, created on a commit from last April. The script is identical.

                              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                              https://dhplugins.com/ | https://dcbreaks.com/
                              London, UK

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

                                @DanH I have no idea then, I'm not familiar with the macro panel.

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

                                DanHD 1 Reply Last reply Reply Quote 0
                                • DanHD
                                  DanH @d.healey
                                  last edited by

                                  @d-healey ok thanks for the help anyways!

                                  DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                  https://dhplugins.com/ | https://dcbreaks.com/
                                  London, UK

                                  ustkU Adam_GA 2 Replies Last reply Reply Quote 0
                                  • ustkU
                                    ustk @DanH
                                    last edited by

                                    @DanH is that not weird to re-assign the area object?

                                    Can't help pressing F5 in the forum...

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

                                      @ustk I hadn't noticed that. I usually make a copy with var a = obj.area but since obj.area is an array a is probably just a reference and it hasn't caused me any issues, so I think that it should be fine.

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

                                      1 Reply Last reply Reply Quote 1
                                      • Adam_GA
                                        Adam_G @DanH
                                        last edited by

                                        @DanH hey there did you ever find any more information about this? im having the same issue in one of my projects and i think its related.

                                        DanHD 1 Reply Last reply Reply Quote 0
                                        • DanHD
                                          DanH @Adam_G
                                          last edited by

                                          @Adam_G crikey, I can't remember. I think I was just trying to debug for the hell of it and found some things that were flagged up but ultimately it worked out fine...

                                          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                          https://dhplugins.com/ | https://dcbreaks.com/
                                          London, UK

                                          Adam_GA 1 Reply Last reply Reply Quote 0
                                          • Adam_GA
                                            Adam_G @DanH
                                            last edited by Adam_G

                                            @DanH you mentioned presets that had macro controls in them were causing access violations. did you resolve that?

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

                                            24

                                            Online

                                            1.8k

                                            Users

                                            11.9k

                                            Topics

                                            104.0k

                                            Posts