GDB in Qt not refreshing values correctly - qt

I am trying to use the debugger in a thread but the values of the watched variables dont get updated in them unless i remove the break point, make it run for a while then put break point back. They also get refreshed if a messageBox appears. Why is this?

There could be a number of reasons. My best guess is that you're putting break points in decompiled code, where as the compiled code may not occur in that order (as the compiler will move things around). You should consider setting your compiler to a lower level of optimization.

Related

Automake/autotools and using "--dry-run" and "--always-make" for make

I stumbled upon an issue when I recently switched to VSCode as editor.
I have several projects that have a full (medium-complex+) autotool
setup and they all work fine. However I discovered that the makefile plugin for VSCode in order to initialize itself (and finding all dependencies and targets) starts by running
make --dry-run --always-make
as first time initialization. This throws the makefile (or actually the
re-config) into an endless loop re-running "configure" (since the targets are never resolved to disk).
I have also confirmed this behavior with the smallest possible autoconf/automake
setup. I can also kind-of understand why this happens (and it seems make
have an internal way to discover this exact situation with the special
variable MAKE_RESTARTS that could possible be used to detect a cyclic
behavior)
Is there a known best-practice workaround ? or is it even a reasonable expectations that these two options in combination should work? (Good to have a second opinion before I go down the rabbit-hole of reminding myself of all the details I forgot about the magical land of autotools)?

IAR Embedded Workbench breakpoint failure

I've been using IAR embedded workbench for quite some time but there is still one thing I'm unable to wrap my head around. And that's the inconsistency of the breakpoint operation.
I have a quite big project which runs an RTOS (might this affect the problem?) and when I place a breakpoint there is no guarantee the debugger will stop at this breakpoint. Sometimes it does, sometimes it doesn't.
A workaround I found is manually stopping the processor and placing the breakpoint while the processor is paused. But even this has not a 100% success rate.
I'm generating debug information and I'm running in debug mode
Anyone had similar issues or anyone with some ideas?
Try to reduce number of breakpoints that you use (possibly just keep this one that causes problem), also you could use a “Log” breakpoint in order to print a message in the Debug Log window instead of stopping at that point (you may also want to try a different point in the same section of the code). If they don't help, I could say with a high degree of certainty that the debugger does not stop at the breakpoint because it simply does not hit it, and you do not enter that block of code. Consider that in an embedded project (especially when using an RTOS) some conditions are met only at the beginning or upon certain requests in certain conditions so you might want to figure out when the breakpoint is actually hit what conditions were met and what is the new state now.

Debugger jumping all over the place

I have added a reference to a DLL from another project (contained in the bin folder) and I have set Copy local to true. When I step through the code; the debugger jumps all over the place. I believe this is because the code is optimised. I have two questions:
Is this because the code is optimised
If (1) is true then why can I step through the code in the first place i.e. without Reflector.
My guess is the jumping is due to the PDB (symbols) being out of sync with the compiled DLL, thus the symbols tell VS to go to a line number that does not actually match up with what the code is actually doing; optimization may also play a part as well, because of in-lining functions.
Other things that influence the debugging experience are:
Just My Code setting
Methods explicitly marked with DebuggerNonUserCode attribute
Debugging optimized code may "jump around", as some functions become inlined. The most telling thing is that local variables usually get optimized away, giving a message to that effect when trying to read them.
If the jumping seems to make very little sense, though, then it's more likely you have the wrong PDB (which maps to line numbers) or source (which has the line numbers).

How can I find syntax errors in QML files?

I'm doing development for Blackberry 10 using Cascades, which includes QT and QML. I find that I sometimes make mistakes in my QML file, but they don't get picked up at compilation time. How can I check whether I've made a syntax error, or mis-named a function call, or other typical errors?
QML is a dynamic language that is evaluated at Runtime. There is no compilation step and due to the nature of javascript and the dynamic nature of the global context there is no way for it to tell if what you are writing is correct/incorrect until it is evaluated. QtCreator can help with some of the QML errors you will find, but there is unfortunately no good way to get syntax errors about your javascript until it is evaluated and it explodes.
Personally, I have found good usage of the debugger to be the key to making these sort of fixes easy.
tldr; Keep your javascript clean and to a minimum there is no compile time checking.
open terminal in IDE connect your device or emulator using blackberry-SSH after connecting enter slog2info it show syntax and all typical error JavaScript with description and line NO.
If there are any mistakes it will show those lines in RED marks. It is dynamically checks there is no need to worry about compile.
If you done wrong you will not see the DESIGN CONSOLE correctly.

Why does this code only work when I use a break point?

See code below, for some reason it only works when I put a breakpoint on line 2 (*) is there some delay? Is it starting the next line before it finishes the 2nd one?
dp.SSLCertStoreType = nsoftware.IBizPayPal.DirectpaymentSSLCertStoreTypes.sstPEMKey
*dp.SSLCertStore = My.Computer.FileSystem.ReadAllText(Server.MapPath("\cert_key_pem.txt"))
dp.SSLCertSubject = "*"
Note: The error is thrown on the 3rd line only when the breakpoint is set on the 2nd line, after releasing the break the program executes my paypal purchase via credit card.
I will post the error again I am replicating it now...
System error: Could not acquire security credentials: error 8009030E.
There it is, while it should say "Order Confirmed!" type message if working correctly.
Almost certainly a threading issue, but nobody is going to be able to answer definitively unless they're familiar with nsoftware.IBizPayPal
Sometimes you can find that breaking can mutate an object's state, due to the locals window evaluating object properties. If they have a side-effect, then all bets are off, unfortunately :( No idea whether this is happening in your case.
I have no knowledge of ASP, so just wondering aloud: Could this be due to multithreading? You know when you put a break point you sort of freeze execution of all threads, but not so in the real execution.

Resources