Flutter XHR auto break points on every call - flutter

When using VSCode to build a Flutter app that makes calls to an API every call auto break points which is incredibly annoying. By auto breaking, I mean that the code halts on lines that do not have break points set on them for code that is not ours - in this case it is framework code (browser_client.dart)
Success Response
Error Response
There is a weird yellow prompt that appears which I guess means current line but its icons pop up all over the place at random locations in code for no discernable reason other than to be very, very annoying. If the code errors out then I would expect the flow to fall through to the try..catch handler wrapping all these calls which it does but not before halting here.
If the call succeeds and it happens to be returning a list of 100 items, it will halt 100 times forcing us to F5 through the loop as it is read. By this I mean it will halt 100 times on the line shown in the success response image above, not in the loop of our application code. It's also only making one call so its not a case of it making 100 calls to the API and halting each time.
Debug only My Own Code is turned on and breakpoints are set only within our own code.
What setting is causing this halting issue and how do we turn it off?

Related

Anylogic: Running a model but stuck suddenly without any error

I'm new to Anylogic and created a simple traffic model. Only use 'carSource', 'CarMoveTo', 'Car Dispose' blocks to set the car routes. But After I ran the model, it worked for a while, then all the cars froze without any error occurring. ’Events‘ panel also stopped. How to solve it?
Most likely your model is running into an infinite loop somewhere in the logic. The first place to check would be all your loops that might become infinite,e.g Do loops, Do-while loops, iterator for loops where you perhaps change the counter variable manually...
If you have the professional version of AnyLogic the best option is to run the model in debug mode until you get this to the point where it freezes and then press pause. You will then see where in the code the model is getting stuck.
If this does not work you might need to start putting traceln in major functions and see ing you can spot the last traceln that gets printed and keep on adding more and more until you can find the point between two traceln where the model freezes
I had the same problem, that after a certain time, all cars froze and there wasn't a signle error.
The problem on my side was that the stop line was too close to the intersection, so I moved it a little bit farther.

XCTest errors and print messages get mixed up in AppCode

I have a longish test with several sections of this form:
let value = computationThatLogs()
XCTAssertEqual(value.a, 77)
I observe that the file:line:error messages from violated XCTAsserts frequently get mixed into the debug messages of the computation in the next section, often even on the same line as a debug message!
Why is that? How can I prevent that from happening? fflush(stderr); fflush(stdout) before every section does not seem to be enough.
In case that is relevant, the computations in each section are actually asynchronous; the test (i.e. the main thread) waits for them to complete using a DispatchSemaphore.
I observe this in AppCode; can not reproduce with XCode.
There are bugs in AppCode related to this:
OCUnit: synchronize stderr/stdout
XCTest parser incorrectly handles stderr output after assertions when continueAfterFailure is true

Peculiar error for transition coverage

Hi all,
I am facing a strange error message while debugging a code for functional coverage specifically transition coverage.There are two level pins for fifo1 and fifo2 respectively while doing coverage for the first level pin ie level1 the code is parsed successfully but for level2 pin its throwing an error which says:
***Error:Syntax error(probably an infinite recursion in macro expansion)
Before loading your code, do trace macro. This will show which macros are being expanded. Look in your docs for more details.
Also, unless you're just writing some simple prototyping code, 'tick notation' for accessing signals is VERY slow. It's the old method. Cadence's recommendation is to use ports instead of 'tick access'. We sped up our test runs by a factor of ~3-10x ( can't remember precisely) by using ports instead of ticks when we did the switch back in version 6.01 of Specman.

How a runloop actually works

Earlier this month I asked this question 'What is a runloop?' After reading the answers and did some tries I got it to work, but still I do not understand it completely. If a runloop is just an loop that is associated with an thread and it don't spawn another thread behind the scenes how can any of the other code in my thread(mainthread to keep it simple) execute without getting "blocked"/not run because it somewhere make an infinite loop?
That was question number one. Then over to my second.
If I got something right about this after having worked with this, but not completely understood it a runloop is a loop where you attach 'flags' that notify the runloop that when it comes to the point where the flag is, it "stops" and execute whatever handler that is attached at that point? Then afterwards it keep running to the next in que.
So in this case no events is placed in que in connections, but when it comes to events it take whatever action associated with tap 1 and execute it before it runs to connections again and so on. Or am I as far as I can be from understanding the concept?
"Sort of."
Have you read this particular documentation?
It goes into considerable depth -- quite thorough depth -- into the architecture and operation of run loops.
A run loop will get blocked if it dispatches a method that takes too long or that loops forever.
That's the reason why an iPhone app will want to do everything which won't fit into 1 "tick" of the UI run loop (say at some animation frame rate or UI response rate), and with room to spare for any other event handlers that need to be done in that same "tick", either broken up asynchronously, on dispatched to another thread for execution.
Otherwise stuff will get blocked until control is returned to the run loop.

Writing a very basic debugger

Is it possible to write a program under windows that will cause a remote process thread to break (stop execution in that thread) upon reaching a predefined address?
I have been experimenting with the Windows Debug API, but it seems very limited when it comes to setting breakpoints. The DebugBreakProcess function seemed promising, but I can't find any examples on how to use this API call.
You need to use WriteProcessMemory to write a breakpoint (on x86, an opcode of 0xCC) to the address.
On x86, when the debuggee hits that point in the code the 0xCC will generate an int 3 exception. This is picked up by your debugger's WaitForDebugEvent will return a DEBUG_EVENT with EXCEPTION_DEBUG_EVENT set.
You then need to patch the that address back to its original code before continuing. If you want to break again, you need to single step and then repatch the breakpoint opcode. To single step, you need to set the single step flag in EFlag in the thread context.
DebugBreakProcess is used to generate a remote break of a process you are debugging - it can't be used to break at an arbitrary point in the code.
Michael is right - also, if you want to break into an arbitrary process in the debugger once you've attached (i.e. if the user hits "Break into process" all of a sudden), the standard way is to create a remote thread whose routine issues an int3.