Can I enter the debugger by sending an interrupt/signal? [duplicate] - matlab

This question already has answers here:
Stop and continue execution from debugger possible?
(6 answers)
Closed 9 years ago.
Ctrl+C interrupts a program. If I have dbstop on error set to true, this will put me in the debugger, because an interruption is treated as an error. However, the program is still interrupted; I can not continue it.
If I have a Matlab program running, is it possible after it has started to enter the debugger without triggering an error? To achieve the effect that a breakpoint would normally have, so either to add a breakpoint for an already running program, or tell it 'break wherever you are right now'.
Is this possible?

Not easily..
As suggested in the answer for the question that was linked as a dup, you can create certain conditions outside the MATLAB environment that the MATLAB code can check for. Since MATLAB is more or less single threaded, it makes doing things like that reallly challenging.
The Better Way: (I think/Hope)
I have not tried this yet, but I am almost positive you are able to edit uicontrols even while code is running because that IS on a different "thread" of sorts. For example, you can check a checkbox even while your code is running. If you were to include in your code something that checks for this checkbox value to be a 1, and if it is a 1, enter debug mode, I think that would work for you.
The good things about this is that everything stays in MATLAB and you don't need to do things like create a file to debug. The bad thing is you still need to add extra code to check which sometimes isn't feasible.
Hope this will work for you.

Related

Launch on event with python

here I write my first question as programming beginner starting with python.
I have a small script that executes a loop, which function is to download a list from the server, compare it with other lists and see if something has happened. Usually the answer is NO, but sometimes something happens. When the answer becomes YES, I would like this script at this point to be able to "launch the second program", a similar script that from here takes care of the instructions to handle the specific event signaled while the " main program "continues to interrogate the server and compare the answers (that's the only thing he has to do).
considering that you can run it with two clicks from the desktop specifying only one variable (that comes from the first script), I thought it was easy to "trigger" the execution of a python file in a new window or something like that ...can anybody tell me how I can make it start at the request of the first script avoiding that the first script remains blocked waiting for answers and continues to execute its cycle?

" #SingleInstance force " is being ignored

SingleInstance force
is supposed to prevent the popup when I tell the script to reload... but it doesn't. I'm still getting the warning that a copy of the script is already running. Thoughts?
Without seeing your code, there are a few things I can think of that might be interfering. The first is that there may be a typo. Please verify that it is exactly #SingleInstance force. Another thing could be that it is not placed near the beginning of the script; possibly after a Return. Finally, from the help file,
AutoHotkey relies on the title of the script's main window to
identify other running instances of the script.
Is this script calling another script or is there anything the might affect the script name? If none of these things helps, it might be a good idea to post your code or at least a portion of it so we can better see what's going on.

Octave 4.2 Command Window is Adding Blank Lines

First, I am new to Octave, but fairly familiar with Matlab. After using Octave for a short time I've noticed that the cursor in the command window will regularly add a new, empty line. Sometime this can be in the middle of typing a command. If I let the window sit with no input, the cursor will eventually advance all the way down the page and keep going.
I have never seen anything like this, and I do not know where to even begin to fix it.
Thanks!
Command Window Screenshot
My alternative answer is that that a bug report should be filed so that this issue gets fixed. I have the exact same problem. Every 30 seconds, when system time hits an even minute and 30 seconds past the minute, the command window cursor skips to the next line. One can still type to the command line and hit enter in the end. The command line now split at random points to several lines will be successfully computed. The problem is that you can not edit the line back past the inserted line break and the whole thing looks really messy. I tried to un-install and re-install but that did not help in my case. I use octave-4.2.1-w64-installer.exe
Boring solution (and hopefully permanent): I uninstalled and reinstalled the same version of Octave and this bug seems to have gone away. Not very convenient, but worked for me.
This might be a problem caused by a 3rd party application. I've seen this issue on a computer with Druva inSync. Disabling the Druva inSync service (not the client) stops this. inSync injects itself in applications using the Windows file dialog. Apparently this code contains a bug and accidentally writes a line feed (LF) to a file handle belonging to the application. The problem might also go away with a different Octave version. In particular the 4.2.x and 4.4.x seem to behave differently.

MATLAB error in "ModularRobot/VR Sink": Initialization can not be evaluated

When i try to start a simulation that has been successfully executed before. I get two errors. Fist of them is a Model error. Second is the title. Here are the details:
Since i'm pretty much beginner in MATLAB, i tried to do some research in order to solve the problem, but the instructions wasn't simple enough to understand. What i really want to do is, execute the simulation, see how it works, and imitate the running function.
Sorry if the question is to lame to ask, but like i said, i had to start somewhere.
Marty, it's nice to see you still struggling to learn some cs stuff.
Now, listen to me carefully. That's not a real bug or something that happened because of your wrongdoings.
That's just one of the few things that happens when you use outdated software. Let me guess, u used MATLAB 9, right? Well, i guess this was your problem. Try version 10 instead.
We'll meet again.

How do I watch a variable in real-time when debugging on Eclipse?

I'm trying to watch a variable change in Eclipse's debug while my program run. But I can only find how to watch a variable when I have a breakpoint set, which pauses the program. I wanna watch the variable change in the eclipse window, while I'm using the program, without having the program pause each time the variable changes.
Is there any way to do that?
There is not a way to do this that I'm aware of. The closest I could imagine is to have a thread that captures the thing you want to monitor and periodically prints its value. You might have to synchronize access to that object at that point since multiple threads could be touching it.
For varX
Add System.out.println("varX = " + varX);
and see in console, or LogCat under tag = System.out
PS
You can see this answer in the link below, voted down! "Programmers" hate the simple solution, and for this reason the question remains unanswered.
Watching variables contents in Eclipse IDE