Runtime Property Insertion for Dynamic Language Debugging
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Dynamic languages lack the capability to distinguish and manage code debugging effectively, particularly when exceptions occur in library code, as they do not have compile-time attributes available at runtime.
Innovation Solution
Inserting statements into code that set properties to indicate whether a debugger should be notified for exceptions within specific scopes, allowing the runtime environment to determine whether to notify development tools based on these properties when exceptions occur.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If compile-time attributes are used to distinguish code for debugging, then debugging control is improved, but dynamic languages cannot utilize this capability since they lack compile-time attributes
Solution Approach 1:
The patent changes the parameter of code attribute availability from compile-time (static) to runtime (dynamic). By inserting statements that set properties on runtime objects, the system enables debugging control in dynamic languages without requiring compile-time processing, thus resolving the contradiction between debugging control and language compatibility
Solution Approach 2:
The patent introduces an intermediary mechanism (inserted statements that set runtime properties) between the code and the debugger. This intermediary allows the debugger to receive notifications about exceptions in library code versus user code by evaluating property values at runtime, bridging the gap between dynamic language execution and structured debugging control
2Loss of information
If the debugger is notified of all exceptions, then complete exception tracking is achieved, but unnecessary notifications for library code exceptions increase debugging noise
Solution Approach 1:
The patent applies local quality by setting different property values for different code regions. Library code is marked with properties indicating it should not trigger debugger notifications, while user code maintains default behavior. This allows the debugger to selectively notify based on the local context of where an exception occurs, filtering out noise from library code while preserving important user code exceptions
Solution Approach 2:
The patent performs preliminary action by inserting statements that set properties on runtime objects before exceptions can occur. These pre-set properties enable the debugger to immediately determine whether to notify about an exception when it occurs, without requiring complex analysis at exception time, thus efficiently separating library code exceptions from user code exceptions
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Aspects of the subject matter described herein relate to assisting development tools. In aspects, statements that influence runtime behavior may be inserted into code of a program. For example, a statement inserted into a function may set a property of a runtime object to indicate that a debugger is to be notified for exceptions that are encountered within the scope of the function. When a runtime environment encounters an exception, the runtime environment may determine whether the property applies to the currently-executing scope. If so, the runtime environment may notify or not notify a development tool of the exception based on the value of the property.