OzCode 推出新版 4.0 與最新的 Visual Studio 2019 同步升級，並強化 LINQ 程式碼偵錯功能
OzCode 藉由偵測並挑出 bug，讓修正它們的過程變的更容易。OzCode 大幅減少debug所需的時間，提升生產力。
OzCode debugger 跟 Visual Studio 內建 debugger 有何差異？
OzCode 跟 Visual Studio dubugger 整合互動，並擴張其機能。在許多功能中，OzCode 可搜尋 properties、比較物件、評估expression、並創建tracepoint、紀錄每一筆 debug 歷史－－都有助於快速並有效 debug。
OzCode 跟 Resharper 有何不同？
OzCode 專於 dubug、Resharper 專於 coding，兩者合作無間。研究顯示研發者平均花一半以上的時間在debug，OzCode 顯著減少這些成本。
LINQ Analysis Window
Understanding Exceptions in LINQ queries
Fluent and Query Syntax Support
Export allows you to save a textual representation of an object instance to a file or to the clipboard, to be used after the debugging session has ended.
With Export, a developer can “grab” objects and save them as either JSON, XML or even as a C# code that can be used to create Unit Tests with the values of the last debug run.
Once the exported instance is saved (or copied to the clipboard), it can be used to reproduce the instance state, analyzed or compared using external diff tools. For the JSON output, OzCode uses the industry-standard Newtonsoft Json.NET serializer, which makes it super easy to deserialize and work with the result.
Heads Up Display
Debugging complex expressions is never easy. How do you see what was returned by a method call? What did each boolean condition evaluate to in a long convoluted if statement? Without simplifying the code or adding variables to store individual results, answering these questions is difficult. With OzCode’s powerful “Simplify” visualization, you can instantly figure out exactly what is happening in your code! When stepping over an expression, a red/green color coding will tell you exactly which expressions returned false/true, respectively. The red X or green V indicate the result of the
Simply click the Simplify button and the expression will be visualized instantly, giving you the option to drill down and see individual expression results.
The nicest thing about Simplify is that you can see a historical view of your code’s execution. Each time you Step Over (F10) a line of code, a new Simplify button will appear, allowing you to look into the past! No longer will you have to restart debugging if you’ve Stepped Over too far! Simplify Time Travel Keyboard Shortcuts If you’re a keyboard person, we’ve made some useful shortcuts for you to time travel without lifting your palms: Hit + to visualize the current line and then use + to visualize the current line or + to navigate between the different lines of code.You can also hold down the key while debugging and then tap a digit ( – ) to directly pick the statement to visualize.
The Magic Glance, which can be toggled by clicking the Toolbar icon (or by pressing the + + shortcut), gives you amazing insight into your code by showing you a summary of each line of code you stepped through.
Predict the Future
OzCode v2.0 performs predictive analysis of code execution (or as we like to call it: Fortune telling!). In the following switch statement, OzCode is predicting the future: you can see the arrow pointing to where we’re going to go when we hit F10, and irrelevant code paths are made semi-transparent.
Predict brings a new meaning to the term “Live Coding” by giving you instant feedback on changes you make as you’re debugging, allowing you to fix silly little coding mistakes extremely quickly. If you’re using VS2015, Predict will even able to predict more complicated expressions, such as LINQ queries:
Conditional Breakpoints can make debugging so much more productive, but without OzCode, using them feels like a chore. OzCode makes adding a Conditional Breakpoint super easy! In just a single click, OzCode will set up a Conditional Breakpoint based on a specific property value, and pre-fill the predicate for you.
Want to add more predicates to the breakpoint? Take a shortcut! Simply hover over the relevant variable, and click the “Add Condition” button.
When Set... Break
The toughest bugs to figure out are those that involve mutating state. What do you do if at some point during the program’s execution, the state of some objects becomes invalid, but you have no idea exactly when and where it got that way? While inspecting values in the debugger, when you spot a problematic property value, use the Magic Wand and choose “When Set -> Break”. The next time the property value is changed, OzCode will break into the debugger and allow you to inspect the state of the program and figure exactly how that problematic value got there in the first place! These Setter Breakpoints work on both regular properties and auto-properties, and you can even add a Setter Breakpoint on properties you don’t have the source code to!
Without OzCode, investigating an exception is a dreary task – navigating through a trail of inner exceptions, scrolling through lengthy callstacks, and squinting through the exception’s associated data to try to make sense of the error. With OzCode, all the relevant information about the exception is presented in a handy tool-window. You can navigate through each inner-exception with a super- convenient breadcrumb control, and even launch a Google or stackoverflow search right from within Visual Studio!
OzCode’s Predict will alert you of an exception that’s about to happen. But that’s not all – if, for instance, OzCode detects an imminent NullReferenceException, you’ll see a red highlight showing exactly what expression is going to cause the exception!
predictive exception analysis makes it super-easy to fix an exception before it even happens, with the powerful of Edit &
When you’re debugging a tough problem, especially in debugging legacy code or a heavily multi-threaded scenario, stepping through the code to figure out what the system is doing feels like trying to juggle 12 balls in your head at once. With OzCode, when things get hairy, you can easily add dynamic logging on-the-fly at key points during the program’s execution, and then view the output using the fully featured integrated log-viewer that OzCode bakes into Visual Studio. No longer do you need to stop debugging, add logging code and then rebuild each time you want to add a simple trace! Simply use the “Create Tracepoint” command on the value you want to trace. A Tracepoint is just like a Breakpoint, except that instead of breaking the program’s execution, it writes a trace message. Then, add whatever bits of information you think might be related to the bug with the “Add To Tracepoint” button:
watch the trace messages come into the Tracepoints Viewer:
In many projects you can’t start a debugging session by just hitting F5. Instead, you have to use the “Attach to Process” option, find the correct process in the long list of processes, and finally connect to it. Later on, when you restart your debugging session, you have to do it all over again. And again. And again. With QuickAttach, OzCode makes the routine of attaching to a process super-fast. The QuickAttach window shows you the list of processes you attached to most recently. By clicking the Pin button, you can attach a shortcut key to that process:
And that’s it. From now on, whenever we
want to attach to ‘w3wp.exe’, we’ll just hit + + , and that’s it If the process you want to attach to is not in the “Recently Attached” list, you can always search for it, and even see a preview of what its UI looks like:
attaching to an IIS Application Pool super easy, by showing you exactly what web site you’re attaching to:
When debugging objects and collections, you are often looking for a specific property or field, or a value held within a property or field. Unfortunately, this usually involves either a lot of clicking and scrolling, or writing custom debug-specific code. Finding items even in simple structures is not easy, not to mention doing so in a complex object graph. With our “Search” feature, this is no longer the case. Quickly and effortlessly search member names and values, no matter the size of the collection or complexity of the object graph!
When stepping through a foreach loop during a debug session, you are likely to encounter some common issues such as determining where you are in the loop and navigating to a specific item in the collection. While Visual Studio does offer ways to answer these questions, they are far from easy. With OzCode’s innovative “Foresee” feature, dealing with foreach loops is simple and intuitive. Foresee is a debug visualizer that helps you keep track of where you are in the loop at all times and allows navigation to specific items in the collection. It gives you visual representation of the collection including items already iterated over, the current item and upcoming items. Interested in a particular item in the collection? Just right click on the item and choose ‘Run to item’ and the loop will execute and then break on the desired item. No need to setup and deal with conditional break points! Due to a limitation with Visual Studio, the Foresee feature is currently only supported in Visual Studio 2013
When you want to compare files, you use a diff application to spot the differences. Unfortunately, when you need to compare two (or more) objects, you have to trust your eyes and memory. With our Compare feature, you can now spend less time squinting, and let OzCode Compare objects and collections with a simple click! The results are displayed in a side-by-side view that helps you investigate the differences and the similarities between the two objects. Once an object is selected for comparison, OzCode will highlight all other local variables and fields that are comparable to the selected instance (meaning they are the same type or derive from the same type).
Compare items in a collection
What if you need to spot the difference between two or more items in the same collection? OzCode’s Compare makes comparing multiple items simple and fast. Comparing several items in the same collection is easy and the results are shown side by side.
Using external diff tool
When comparing two long strings – such as two XML or Json documents, Compare will automatically launch your favorite Diff tool, making it super easy to spot the difference between the two.
You can configure Compare to use either Visual Studio’s native diff tool, or an external diff tool, under OzCode->Options.
Currently supported options include Beyond Compare (v3 or v4), KDiff, WinMerge, Araxis Merge, and Tortoise.
The hardest bugs to solve are the ones that involve mysterious side effects. Consider a long and complicated method which takes an object and performs various mutations on it. Would you be able to tell what has actually changed? For a class with many members, which might also contain a few members themselves, finding the differences is difficult. With Compare you can now save an object’s state and later compare the object, during debugging, to its original saved state. After the function executes, you can choose the Compare to Snapshot option to see the differences.
When you save a snapshot of a given object, it will now persist across debugging sessions! You can save a snapshot of an object, stop your debugging session or even close Visual Studio, and then come back the next day and compare a live object to the snapshot you had saved!
Objects can have many properties, but when debugging, not all of them are useful to you. You’re usually interested only in a selected few. For a Customer class, it might be the ID and Username properties, for a Point in 3D space, it might be the X, Y, and Z fields. With our “Reveal” feature, you can finally focus on the data that actually matters. Star the properties you are interested in and they will appear right next to the object. If you have, for example, a collection of Customer objects and you are mostly concerned with their first and last names, simply star the FirstName and Surname properties and immediately all the objects in the collection show these properties next to them. Your choices will be persisted across debugging session and across different Visual Studio solution files.
When debugging, sometimes the information you need is not contained in the fields and properties of an object; rather, it’s a calculation or an expression that is based on your object. You might find yourself wishing you had a different set of properties just for this specific debugging session. For example, when you’re looking at a Player object in your game, you might like to see the distance from the nearest enemy without having to add such a property to its interface. With our Custom Expression feature, you can create multiple custom expressions on any object type, which will be displayed just like any other member of that type. You can even star the ones that interest you the most. For example, if a Customer class has a salary history among its properties, but what you really need to see in order to fix a bug is the customer’s due taxes for a certain year, simply use the “Add Custom Expression” option on the Customer variable, and write the expression that you’d like to see. The expression will be displayed as a property of the Customer class, containing the value of the expression.
Filtering a collection in code is relatively easy and there are plenty of ways to do it. But how do you filter while debugging? For example, you have a collection of Customer objects and you’d like to filter the ones that are older than 35 years. Visual Studio’s immediate window and watch windows don’t support lambdas. With our Filter Collections feature, you can apply a filter expression to any collection. To solve the customer problem, choose the collection of customers and set its filter to: DateTime.Today.Year – [obj].Birthday.Year > 35, press Enter and see the results right away. Once a collection is filtered, all the other features work on the filtered results as well.
OzCode’s Quick Actions offer you the most relevant actions, depending on your current context. Want to add a breakpoint to every method in the class? Trace every entry to a particular method? Quickly run forward to a particular line of code? Hit Alt+Shift+D to open up the Quick Actions menu or click the Magic Wand, and do some magic!
Show All Instances
OzCode makes it trivial to find specific objects in memory that you want to explore. Just open “Show All Instances of Type” and you’ll be able to see every object of that type that’s currently in memory. Why is that object still in memory? Are there any objects that contain this value? OzCode’s exciting new exploration tool effortlessly and instantly answers these questions and more.
Time Travel Debugging
Predict the Future
In regular debugging, once a breakpoint hits, we are able to see the state of the program as it is now. We can evaluate any expression and get its value as it is when the program hits our breakpoint. Time Travel Debugging in OzCode changes the game and allows you to Predict the Future.
While standing on any breakpoint, OzCode will run through the rest of the method and evaluate all the lines of code in the future. You will be able to see the result of the prediction with a Heads-up-display (HUD).
The evaluation is made using VIL, which is the same mechanism used in the Immediate window and Watch window.
Unlike the Immediate Window, OzCode evaluation of the future is in no-side-effects mode, so the program state is not changed.
The evaluation ends when reaching the end of the current method or when encountering Native Code. Native code can’t be evaluated in no-side-effects mode, so the prediction ends there. The scope of the prediction is represented with a vertical purple line:
The prediction is executed asynchronously, so it doesn’t affect Visual Studio performance. It’s always executed, but for convenience the predict HUD is turned off initially. To see the prediction HUD, simply click on the ‘Play’ button:
The regular DataTip (and Quick-Watch) of Visual Studio will show you the value of the expression at the time of the breakpoint. Not so in Predict mode. The DataTip will show the value of the expression at the time of the evaluated line of code:
Editing the Future
You can edit your code while on a breakpoint, and the future prediction will change as you go:
This utilizes Visual Studio’s Edit and Continue feature. The result is that you can see the result of your changes live.
Time Travel Loops
With loops, displaying the future is not straightforward. Each iteration will have different values inside.
While time travel debugging, OzCode will display a small adornment near each loop. The adornment shows the number of iterations. Clicking on it will open a data-tip that shows the value of the iterated variable at each iteration:
Initially, OzCode always displays the body of the last iteration. You can switch between iterations by opening that data-tip and clicking on any iteration. When chosen, the HUD will show the values during the chosen iteration.
Note that the iterations are 1-based index.
Time Travel Conditionals
When in a loop, if/else and switch statements are usually interesting for debugging. OzCode presents visually which if statements returned True and False. The same goes for switch and case statements.
An adornment appears near each such conditional statement, showing how much iterations met the condition. Clicking on the adornment will open a data-tip, that allows to navigate to the relevant iterations.
For private individuals purchasing with their own funds
Use it at home and at work!