IP Library Granted Patent US 12,293,166
Granted Patent B2
US 12,293,166 · App. 17/648,306 · Granted May 6, 2025

Enhanced exception handling for debugging

Inventors: Lei Wang (Beijing, CN); Xiao Ling Chen (Beijing, CN); Zheng Lei An (Beijing, CN); Yan Huang (Beijing, CN); Dong Chen (Beijing, CN)
Assignee: International Business Machines Corporation
G06F8/30G06F8/51
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,293,166
App. No.
17/648,306
Granted
May 6, 2025
Kind
B2
Abstract

A method, system, and computer program product for improving debugging efficiency through fallibility skip functionality are provided. The method initiates a fallibility skip mode within a programming environment. The method identifies a code module to be translated from a first coding language to a second coding language. The code module including a function statement. A modified function statement is generated based on the function statement and the initiation of the fallibility skip mode. One or more exception handling functions are added based on the modified function statement and the fallibility skip mode. The method generates a modified code module in the second coding language based on the fallibility skip mode.

Claims (53)

1. A computer-implemented method, comprising:

initiating, in response to a user interaction and a portion of code being passed through an automatic syntax tree (AST) generator, a fallibility skip mode within a programming environment;

identifying a code module to be translated from a first coding language to a second coding language, the code module including a function statement of an AST;

generating a modified function statement based on the function statement and the initiation of the fallibility skip mode, further comprising:

updating a decorator list of the function statement with a decorator function; and

adding the decorator function to a module body of the code module;

adding one or more exception handling functions based on the modified function statement and the fallibility skip mode, wherein the adding comprises searching, by the programming environment and in response to the identifying the code module, exception handling in the fallibility skip mode; and

generating a modified code module in the second coding language based on the fallibility skip mode.

2. The method of claim 1 , wherein generating the modified function statement further comprises:

generating a try statement configured to catch one or more exceptions; and

inserting a body of the function statement into the try statement.

3. The method of claim 2 , wherein the method further comprises:

setting one or more handlers of the try statement to an exception handling function of the one or more exception handling functions; and

inserting the try statement into the function statement.

4. The method of claim 3 , wherein the one or more exception handling functions is added to a module body of the code module.

5. The method of claim 1 , wherein the method further comprises:

adding the one or more exception handling functions to the module body of the code module with the decorator function.

6. A system, comprising:

one or more processors; and

a computer-readable storage medium, coupled to the one or more processors, storing program instructions that, when executed by the one or more processors, cause the one or more processors to perform operations comprising:

initiating, in response to a user interaction and a portion of code being passed through an automatic syntax tree (AST) generator, a fallibility skip mode within a programming environment;

identifying a code module to be translated from a first coding language to a second coding language, the code module including a function statement of an AST;

generating a modified function statement based on the function statement and the initiation of the fallibility skip mode, further comprising:

updating a decorator list of the function statement with a decorator function; and

adding the decorator function to a module body of the code module;

adding one or more exception handling functions based on the modified function statement and the fallibility skip mode, wherein the adding comprises searching, by the programming environment in response to the identifying the code module, exception handling in the fallibility skip mode; and

generating a modified code module in the second coding language based on the fallibility skip mode.

7. The system of claim 6 , wherein generating the modified function statement further comprises:

generating a try statement configured to catch one or more exceptions; and

inserting a body of the function statement into the try statement.

8. The system of claim 7 , wherein the operations further comprise:

setting one or more handlers of the try statement to an exception handling function of the one or more exception handling functions; and

inserting the try statement into the function statement.

9. The system of claim 8 , wherein the one or more exception handling functions is added to a module body of the code module.

10. The system of claim 6 , wherein the operations further comprise:

adding the one or more exception handling functions to the module body of the code module with the decorator function.

11. A computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions being executable by one or more processors to cause the one or more processors to perform operations comprising:

initiating, in response to a user interaction and a portion of code being passed through an automatic syntax tree (AST) generator, a fallibility skip mode within a programming environment;

identifying a code module to be translated from a first coding language to a second coding language, the code module including a function statement of an AST;

generating a modified function statement based on the function statement and the initiation of the fallibility skip mode, further comprising:

updating a decorator list of the function statement with a decorator function; and

adding the decorator function to a module body of the code module;

adding one or more exception handling functions based on the modified function statement and the fallibility skip mode, wherein the adding comprises searching, by the programming environment in response to the identifying the code module, exception handling in the fallibility skip mode; and

generating a modified code module in the second coding language based on the fallibility skip mode.

12. The computer program product of claim 11 , wherein generating the modified function statement further comprises:

generating a try statement configured to catch one or more exceptions; and

inserting a body of the function statement into the try statement.

13. The computer program product of claim 12 , wherein the operations further comprise:

setting one or more handlers of the try statement to an exception handling function of the one or more exception handling functions; and

inserting the try statement into the function statement.

14. The computer program product of claim 13 , wherein the one or more exception handling functions is added to a module body of the code module.

15. The computer program product of claim 11 , wherein the operations further comprise:

adding the one or more exception handling functions to the module body of the code module with the decorator function.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 19, 2022
From: WANG, LEI; CHEN, XIAO LING; AN, ZHENG LEI; HUANG, YAN; CHEN, DONG
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 058687/0215 →
Continuity (1)
Related Publication 20230229400A1 · Jul 20, 2023
References Cited (14)
US 8762953B2 · French · 2014 [cited by examiner]
US 11544099B2 · Bailey · 2023 [cited by examiner]
US 20170300400A1 · Davis · 2017 [cited by applicant]
US 20200192785A1 · Chen · 2020 [cited by applicant]
CN 105824754B · 2016 [cited by applicant]
CN 106599628B · 2017 [cited by applicant]
CN 112181815A · 2021 [cited by applicant]
Shah et al., “Why Do Developers Neglect Exception Handling?”, 2008, ACM, pp. 62-68. (Year: 2008). [cited by examiner]
Stack Overflow, “General decorator to wrap try except in python?”, 2014, https://stackoverflow.com/questions/15572288/general-decorator-to-wrap-try-except-in-python , 13 pages. (Year: 2014). [cited by examiner]
Stack Overflow, “How to skip over line throwing exception when debugging”, 2017, https://stackoverflow.com/questions/45746921/how-to-skip-over-line-throwing-exception-when-debugging , 3 pages (Year: 2017). [cited by examiner]
Zhang et al., “Accelerating Iterators in Optimizing AST Interpreters”, 2014, ACM, pp. 727-743. (Year: 2014). [cited by examiner]
Mell et al., “The NIST Definition of Cloud Computing,” Recommendations of the National Institute of Standards and Technology, U.S. Department of Commerce, Special Publication 800-145, Sep. 2011, 7 pgs. [cited by applicant]
Van De Vanter et al., “Fast, Flexible, Polyglot Instrumentation Support for Debuggers and other Tools, ” arXiv 1803.10201, Mar. 27, 2018, 30 pages. [cited by applicant]
“IBM/clai: Command Line Artificial Intelligence or CLAI is an open-sourced project from IBM Research aimed to bring the power of AI to the command line interface”, GitHub, downloaded from the Internet on Aug. 11, 2023, … [cited by applicant]