Figure out why WinDBG is in "BUSY" state? - windbg

I'm unable to figure out why WinDBG is in a BUSY state:
Is there a way to find a description?

There is no way to find the exact reason why WinDbg is busy, but you can verify what the last event it was responding to, by using '.lastevent'. However, for your particular case, it is busy looking for symbols and source code for kernel32!CreateFileW. If you have an extension registered for events you would receive change symbol state
IDebugEventCallbacksWide::ChangeSymbolState
DEBUG_CSS_LOADS The engine has loaded some module symbols.
DEBUG_CSS_UNLOADS The engine has unloaded some module symbols.
DEBUG_CSS_SCOPE The current symbol scope has changed.
DEBUG_CSS_PATHS The executable image, source , or symbol search paths have changed.
DEBUG_CSS_SYMBOL_OPTIONS The symbol options have changed.
DEBUG_CSS_TYPE_OPTIONS The type options have changed.
Also check this:
IDebugEventCallbacksWide::ChangeEngineState
Those events are:
DEBUG_CES_CURRENT_THREAD The current thread has changed, which implies that the current target and current process might also have changed.
DEBUG_CES_EFFECTIVE_PROCESSOR The effective processor has changed.
DEBUG_CES_BREAKPOINTS One or more breakpoints have changed.
DEBUG_CES_CODE_LEVEL The code interpretation level has changed.
DEBUG_CES_EXECUTION_STATUS The execution status has changed.
DEBUG_CES_ENGINE_OPTIONS The engine options have changed.
DEBUG_CES_LOG_FILE The log file has been opened or closed.
DEBUG_CES_RADIX The default radix has changed.
DEBUG_CES_EVENT_FILTERS The event filters have changed.
DEBUG_CES_PROCESS_OPTIONS The process options for the current process have changed.
DEBUG_CES_EXTENSIONS Extension DLLs have been loaded or unloaded. (For more information, see Loading Debugger Extension DLLs.)
DEBUG_CES_SYSTEMS A target has been added or removed.
DEBUG_CES_ASSEMBLY_OPTIONS The assemble options have changed.
DEBUG_CES_EXPRESSION_SYNTAX The default expression syntax has changed.
DEBUG_CES_TEXT_REPLACEMENTS Text replacements have changed.

Related

Editing layer via Python script startEditing, do we have to "close" editing?

I'm working on a vector layer where I have to merge all n+i [id] attributes into entity(n)[id] where entities(n+i)[id] equals the entity(n)[id], then delete all n+i entities.
All works fine but I call several times startEditing functions before commiting changes, and my question is: does calling commitChanges closes startEditing, or does it let it opened, like if it was a file descriptor or a pointer which we needed to free after the job's done?
The code is:
olayer.startEditing()
olayer.changeAttributeValue(n,id_obj,id_obj_sum,NULL,True)
olayer.commitChanges()
olayer.startEditing()
i= i-1
while i >=1:
olayer.deleteFeature(n+i)
i=i-1
olayer.commitChanges()
As you can see, we call several times olayer.startEditing, even more because all that code is in while body...
So will that spawn hordes of startEditing "pointers" or will it just continuously set the olayer editable status as "open to edition" ?
Actually the code works, but it's painfully slow, is this the reason why ?
By and large, you should not start the edit mode more than once in your layer.
You can commit at the end of all your changes to the layer, so that your modifications stay in an edit buffer in the meantime.
QgsVectorLayer.commitChanges() can let the edit mode open if you pass a False as parameter (the parameter is called stopEditing, see the docs). Like this:
# If the commit is sucessful, let the edit mode open
layer.commitChanges(False)
Also, have a look at the with edit(layer): syntax in the QGIS docs. Using such syntax you avoid starting/committing/closing the edit mode, QGIS does it for you.
with edit(layer):
# All my layer modifications here
# When this line is reached, my layer modifications are already committed.

Wait until a symbol provider is available

I am writing a Go adapter extension for the Test Explorer extension for Visual Studio Code. My extension uses language services from Microsoft's Go extension:
const symbols = await vscode.commands.executeCommand('vscode.executeDocumentSymbolProvider', uri)
However, I have an issue. When I specify extensionDependencies and activationEvents correctly (in package.json), symbols don't initially load (the command returns undefined). If I set activationEvents to * or if I delay for long enough in my activate handler, symbols load. I thought about retrying until the command returns something, but "this file has no symbols" and "there is no symbol provider for this type of document" both return undefined.
Is there a way to delay until a symbol provider has been defined for a specific file extension/language? Waiting for the Go extension to be activated is not enough. I would use GoDocumentSymbolProvider directly, but the extension doesn't export anything.
It looks like it will be possible to add a delay time before your extension is activated. See https://github.com/microsoft/vscode/issues/98083 (Add support to eventually activate an extension on startup). And https://github.com/microsoft/vscode/issues/98990 (Delayed startup activation events).
Will be in v1.46. From v1.46 release notes onStartupFinished activation event:
We now have a new activation event, similar to the already existing *
activation event. The new onStartupFinished activation event should
be used when an extension wishes to be activated sometime soon after
VS Code startup, but not as part of the startup.
However, it is just a hard-coded delay, not based on other events but may still help your situation.
There is a new activation event which looks like e.g. onStartup:1000
or onStartup:5000. This means that the extension wants to be
activated 1000ms or 5000ms after startup. This is very similar to *
activation, but the extension indicates that it can wait a bit.

Openpanel and symbol communication not working

I am trying to make a patch that plays audio when a bang is pressed. I have put a symbol so that I don't need to keep reimporting the file. However it works sometimes but not all the time.
A warning in the Pd console reads: Start requested with no prior open
However I have imported an audio file
Is there something that I have done wrong?
Use [trigger] to get the order-of-execution correct.
One problem is, that whenever you send a [1( to [readsf~] you must have sent an [open ...( message directly beforehand.
Even if you have just successfully opened a file, but then stopped it (with [0() or played it through (so it has been closed automatically), you have to send the filename again.
The real problem is, that your messages are out of order: you should never have a fan-out (that is: connecting a message outlet to multiple inlets), as this will create undefined behavior.
Use [trigger] to get the order-of-execution correct.
(Mastering [trigger] is probably the single most important step in learning to program Pd)

Qt: Preferences not restored through signal and slot mechanism

In my Text Editor application, I save the users font format selection as a preference.
Signals and slots are first set up in the constructor, and then the preferences are read as in the code below:
Constructor:
boldAction->setCheckable(true);
italicAction->setCheckable(true);
underlineAction->setCheckable(true);
fontSizeSelector->setCheckable(false);
connect(boldAction,SIGNAL(changed()),this,SLOT(bold()));
connect(italicAction,SIGNAL(triggered()),this,SLOT(italic()));
connect(underlineAction,SIGNAL(triggered()),this,SLOT(underline()));
ReadUserPreferences():
void TextEditor::readUserPreferences()
{
QSettings userPreferences(QSettings::NativeFormat,QSettings::UserScope,ORGANIZATION_TITLE,APPLICATION_TITLE);
this->boldAction->setChecked( userPreferences.value("appearance/bold").toBool() );
this->italicAction->setChecked( userPreferences.value("appearance/italic").toBool() );
this->underlineAction->setChecked( userPreferences.value("appearance/underline").toBool());
//other code.
}
Now, in the readPreferences function, when boldAction->setChecked(true);, shouldn't the text become bold because the signal and slot mechanism has already been defined? If so, then why isn't it working on my application? The bold function itself works perfectly fine.
Is there a better way of doing this than what I'm doing? Thanks for your help
There appear to be two things wrong here.
Firstly, you are connecting to the wrong signals. The changed signal does not pass a value indicating the action's checked state, and triggered is not emitted at all when setChecked is called. You need to connect to the toggled signal.
Secondly, the signal will only be emitted if the checked state has changed. So if the action is already checked and the user preference evaluates to true, nothing will happen. You probably need to take steps to ensure the appropriate default state is set before connecting the signals.

Invoke process activity not logging any error in log file

I am trying to use Invoke process to invoke an executable from my windows workflow in my TFS 2010 build.
But when I am looking at the log file it is not logging any error.
I did use WriteBuildMessage and WriteBuildwarning inside my invoke process activity.
I also set the filename,workingdirectory etc in activity.
Can someone please point out why it is not logging?
You can do something like this:
In this case you have to ensure that Message are set as follows:
With those parameters set as depicted, I catch what you seem to be after.
Furthermore, you can check in the Properties of your InvokeProcess: Set the Result into a string-variable and then set in a subsequent WriteBuildMessage this string-variable to be the Message. This way, you 'll additionally catch the return of your invoked process.
EDIT
Another common thing that you 've possibly overlooked is the BuildMessageImportance: if it is not set as High, messages do NOT appear under default Logging Verbosity (= Normal). See here for some background.
In your Invoke Process, you want to set the Result property to update a variable (returns an Int, so lets call it ExitCode), under your Invoke Process (but still in the Agent Scope) you can drop in an If, so you can set the condition of this to ExitCode <> 0 and do whatever you like on a failure (such as failing the build).
Also, as a note, if your WriteBuildMessage is not showing anything in your log, you need to set the Importance to Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High, anything lower and it wont show in the Normal logging level.