COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 08-16-2015, 12:59 PM   #1
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default How to troubleshoot/debug "abnormal terminations"?

How can you troubleshoot what causes "abnormal termination"s without randomly commenting parts of code out?

I heard about running in debug mode with Reaper somehow, but how is this done?

I'm using VS2013.

Last edited by mviljamaa; 08-16-2015 at 03:12 PM.
mviljamaa is offline   Reply With Quote
Old 08-16-2015, 03:10 PM   #2
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Here are some (old) instructions on how to debug your plug-in. Hopefully they aren't too outdated...

Windows: http://forum.cockos.com/showpost.php...4&postcount=11
Mac OS X: http://forum.cockos.com/showpost.php...61&postcount=8

If these don't work anymore, then post your development environment (VS2013, or Xcode 6, etc.), and hopefully someone using the same software can post a step-by-step instruction.
Tale is online now   Reply With Quote
Old 08-24-2015, 12:17 PM   #3
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

So I've set up the debugging project (like described here: http://forum.cockos.com/showpost.php...4&postcount=11) with the appropriate debug-built libraries. However, there's some strange fatal error C1083: Cannot open include file: 'Gamma/Gamma.h': No such file or directory, when I click "Local Window Debugger".

If I build the project, then it builds without problems.

Any idea what the problem is? Something related to the Gamma build perhaps?
Or maybe it somehow changes the directory when running the Debugger?

Last edited by mviljamaa; 08-24-2015 at 12:23 PM.
mviljamaa is offline   Reply With Quote
Old 08-24-2015, 12:42 PM   #4
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Ok for some reason the error went away and now I'm seeing a window with the title "REAPER Usage", which lists some -commands.



After this there's a list of
"Cannot find or open the PDB file." errors. And then reaper.exe exits with code 0.

How to interpret this? The debugger will not run, it merely displays this window every time.

Last edited by mviljamaa; 08-24-2015 at 01:38 PM.
mviljamaa is offline   Reply With Quote
Old 08-24-2015, 11:47 PM   #5
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

So I figured out that passing "reaper" as the command line argument runs Reaper, but how do I debug now? I can generate an abnormal termination, but how am I supposed to see what caused it?
mviljamaa is offline   Reply With Quote
Old 08-25-2015, 06:00 AM   #6
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by mviljamaa View Post
So I figured out that passing "reaper" as the command line argument runs Reaper, but how do I debug now? I can generate an abnormal termination, but how am I supposed to see what caused it?
By running your project under the debugger, F5 is the default shortcut key for that in Visual Studio. Ctrl+F5 runs the project without debugging. But in order for the debugging session to be useful your project must have been built in debug mode.



If Visual Studio's debugger doesn't show up when the abnormal termination happens, something is wrong in your project/settings.

You should see this :



If on the other hand you do see the debugger, the first thing you should examine is the Call Stack.



That shows the function calls leading up to the abnormal termination condition. The code probably has stopped somewhere in the guts of the C++ runtime, so you should go down the function list to IPlug's or your own code. If you are unlucky, you won't see IPlug's or your own functions in the stack. In that case debugging will be more complicated and you should probably post a screenshot of the call stack or something...
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 08-25-2015 at 06:08 AM.
Xenakios is offline   Reply With Quote
Old 08-25-2015, 06:23 AM   #7
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

I see nothing in the call stack. Like the debugger (and Reaper) is running, but does not display anything.

And the debugger does not "show up", when the abnormal termination happens.

Could it be the PDBs?

Or this one: http://forum.cockos.com/showpost.php...1&postcount=12

--

After the abnormal termination and then pausing the debugger I see a list of [External Code] and reaper.exe!0000... lines in the call stack, but none for IPlugMyPlug.dll.

Last edited by mviljamaa; 08-25-2015 at 06:33 AM.
mviljamaa is offline   Reply With Quote
Old 08-26-2015, 11:15 AM   #8
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Help?

Losing a lot of time because of this debug.
mviljamaa is offline   Reply With Quote
Old 08-26-2015, 01:42 PM   #9
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

You could try to manually start REAPER, then attach the debugger to REAPER, and then load your plug-in in REAPER. For testing purposes you could set a breakpoint in your constructor, that way the debugger should pause there (it does so here using VS2013).
Tale is online now   Reply With Quote
Old 09-02-2015, 12:46 AM   #10
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Quote:
Originally Posted by Tale View Post
You could try to manually start REAPER, then attach the debugger to REAPER, and then load your plug-in in REAPER. For testing purposes you could set a breakpoint in your constructor, that way the debugger should pause there (it does so here using VS2013).
I see the breakpoint "light up" from "empty circle" when I run and attach Reaper, but how it doesn't step into it.
mviljamaa is offline   Reply With Quote
Old 09-02-2015, 12:52 AM   #11
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Ok got it working, but can't see the symbols.
Do I need to load them from Microsoft Symbol Servers or what?
mviljamaa is offline   Reply With Quote
Old 09-02-2015, 02:38 AM   #12
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by mviljamaa View Post
Ok got it working, but can't see the symbols.
Do I need to load them from Microsoft Symbol Servers or what?
At my end it automatically finds the symbols (PDB file?) somewhere, even when I do a release build. So I'm sorry, but I have no idea.
Tale is online now   Reply With Quote
Old 09-02-2015, 02:44 AM   #13
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Quote:
Originally Posted by Tale View Post
At my end it automatically finds the symbols (PDB file?) somewhere, even when I do a release build. So I'm sorry, but I have no idea.
So how was your project constructed. By duplicating?
I could try rebuilding my whole project by basing it on a duplicated project.
Since in this one I've messed with the resource.h quite a bit already.
mviljamaa is offline   Reply With Quote
Old 09-02-2015, 03:25 AM   #14
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

And now the debugger won't light up anymore.
Any idea why it did at some point. Then I rebooted my computer and now I can't get debugger to produce those popups (with continue, break options).

--

Ok so the problem is that one has to attach to the plug-in process (reaper_host32.exe), not reaper.exe.

--

I also tried to add the plug-in's .pdb (which is found from the same folder where the .dll is placed when building) file manually.
It does not display the symbols.

Last edited by mviljamaa; 09-02-2015 at 06:38 AM.
mviljamaa is offline   Reply With Quote
Old 09-02-2015, 03:25 AM   #15
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by mviljamaa View Post
So how was your project constructed. By duplicating?
I could try rebuilding my whole project by basing it on a duplicated project.
Since in this one I've messed with the resource.h quite a bit already.
I have tried both with the IPlugEffect example project, and with a custom project duplicated from IPlugEffect, and both seem to work. So why don't you try the IPlugEffect example project as well? If that also doesn't work for you, then you are either doing something wrong, or these is something wrong with your build configuration. If the example project does work for you, then indeed something might be wrong with your own project.
Tale is online now   Reply With Quote
Old 09-02-2015, 03:31 AM   #16
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by mviljamaa View Post
Ok so the problem is that one has to attach to the plug-in process (reaper_host32.exe), not reaper.exe.
Well, that depends; if your plug-in is bridged (e.g. run in separate process, or 32-bit plug-in in 64-bit REAPER), then yeah.
Tale is online now   Reply With Quote
Old 09-02-2015, 04:32 AM   #17
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Quote:
Originally Posted by Tale View Post
I have tried both with the IPlugEffect example project, and with a custom project duplicated from IPlugEffect, and both seem to work. So why don't you try the IPlugEffect example project as well? If that also doesn't work for you, then you are either doing something wrong, or these is something wrong with your build configuration. If the example project does work for you, then indeed something might be wrong with your own project.
So what's the easiest way to create an exception in IPlugEffect that occurs while the plug-in is run?
mviljamaa is offline   Reply With Quote
Old 09-02-2015, 06:15 AM   #18
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Quote:
Originally Posted by Tale View Post
I have tried both with the IPlugEffect example project, and with a custom project duplicated from IPlugEffect, and both seem to work. So why don't you try the IPlugEffect example project as well? If that also doesn't work for you, then you are either doing something wrong, or these is something wrong with your build configuration. If the example project does work for you, then indeed something might be wrong with your own project.
I did a duplicate from IPlugGamma and then copied my code over there.
The problems I'm having were duplicated.

However, the debug is still missing the symbols (I'm in Release mode). I can see ProcessDoubleReplacing and VSTProcessDoubleReplacing methods, but not more than those.

Why is it that the IPlugEffect does not show any .pdb except Microsoft Symbol Servers?

Last edited by mviljamaa; 09-02-2015 at 06:40 AM.
mviljamaa is offline   Reply With Quote
Old 09-02-2015, 07:09 AM   #19
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,260
Default

Quote:
Originally Posted by mviljamaa View Post
I see the breakpoint "light up" from "empty circle" when I run and attach Reaper, but how it doesn't step into it.
If the circle isn't solid red, then there is a mismatch (wrong symbols, running version doesn't match the last compiled version/symbols etc. or symbols simply aren't pointed properly) It means VS can't align the project with what it is attached to and the breakpoint won't hit. You should point Visual Studio's symbol path to your project folder and also add Microsoft's public symbol store.: http://msdl.microsoft.com/download/symbols If the breakpoint is a solid red circle, I don't see how it wouldn't hit unless that code block didn't actually execute.

You can check for the status of symbol loading (when attached/running) in the modules window to see if it found them or not. You can find that window under Debug > Windows > Modules. You can right-click the module in question and choosing Symbols Settings, Symbol Load information and Load symbols to see what is missing and manually point it to the symbols while running etc. You need to be in debug mode too IMHO.




As general aside, you want the MS Symbol store included because if you need to review the call stack outside of your module, the debugger may only list the first exported function or entry point (or nothing) in any DLLs you don't have symbols for. That can be very misleading since the function you are seeing the in call stack may not be the actual function that is running in that stack frame.
__________________
Music is what feelings sound like.

Last edited by karbomusic; 09-02-2015 at 07:22 AM.
karbomusic is offline   Reply With Quote
Old 09-02-2015, 11:44 AM   #20
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

Quote:
Originally Posted by mviljamaa View Post
However, the debug is still missing the symbols (I'm in Release mode). I can see ProcessDoubleReplacing and VSTProcessDoubleReplacing methods, but not more than those.
Make sure you are building a Debug version. Release builds might hit breakpoints, but they rarely give you useful debugging information.

And to reiterate karbomusic, make sure the dll that Reaper is loading is the debug build that you just compiled. If the source code is different, edited, etc., the breakpoints may not work and they won't appear solid red after debugging or attaching to a process.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 04-29-2016, 12:28 PM   #21
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Ok I'm trying to set up this again.

A breakpoint is "empty" and it says that "The breakpoint will not currently be hit. No symbols have been loaded for this document.".

I've pointed Debug -> Options and Settings -> Symbols to my project's main folder. But is this not where it should be pointed?

This occurs even in the IPlugEffect example.

Last edited by mviljamaa; 04-29-2016 at 12:36 PM.
mviljamaa is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.