Variable search method and device in debugging environment and storage medium

CN122885260APending Publication Date: 2026-10-09INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610952357.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0004]本申请的主要目的在于提供一种调试环境下的变量搜索方法、装置及存储介质,以解决相关技术中在调试环境中搜索目标变量的效率低的问题

Benefits of technology

[0016]在本申请实施例中,通过在调试环境中接收目标用户输入的搜索指令,并基于搜索指令生成匹配变量名称的正则表达式;通过调试接口获取当前调试上下文中的起始对象集合,并初始化搜索队列,将起始对象集合中的对象引用依次加入搜索队列;采用广度优先搜索算法,在搜索队列不为空且未获取到搜索结果的情况下,循环执行以下搜索过程:从搜索队列头部取出一个当前对象引用,获取当前对象引用的所有成员字段,依次对当前对象引用的每个成员字段进行匹配检测,若成员字段的名称匹配正则表达式,则确定搜索结果为成员字段,记录成员字段的值和成员字段对应的访问路径,并终止循环;若成员字段的名称与正则表达式不匹配,且成员字段的类型为引用类型,则获取成员字段指向的子对象引用,检查已访问对象引用集合中是否存在子对象引用的已被访问标记;若已访问对象引用集合中不存在子对象引用的已被访问标记,则将子对象引用追加至搜索队列队尾,若已访问对象引用集合中存在子对象引用的已被访问标记,则跳过子对象引用,不再入队处理,解决了相关技术中在调试环境中搜索目标变量的效率低的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122885260A_ABST
    Figure CN122885260A_ABST
Patent Text Reader

Abstract

The application discloses a variable searching method and device in a debugging environment and a storage medium. It relates to the field of financial technology. The method comprises the following steps: receiving a search instruction input by a target user in a debugging environment, and generating a regular expression matching a variable name based on the search instruction; sequentially adding object references in a starting object set to a search queue; in the case that the search queue is not empty and no search result is obtained, a breadth-first search algorithm is used to perform the following search process in a loop: taking an object reference from the head of the search queue, obtaining all member fields of the object reference, sequentially performing matching detection on each member field of the object reference, determining that the search result is a member field if the name of the member field matches the regular expression, recording the value of the member field and the access path corresponding to the member field, and terminating the loop. Through the application, the problem of low efficiency in searching for a target variable in a debugging environment in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and more specifically, to a variable search method, apparatus, and storage medium in a debugging environment. Background Technology

[0002] In program debugging, quickly and accurately locating the target variable is crucial for analyzing program status and troubleshooting. This is especially true in the fintech field, where core business systems such as financial trading systems, clearing systems, and risk control platforms are evolving towards microservice and distributed architectures, resulting in extremely complex and deeply nested object structures. For example, a complex financial transaction order often contains multiple layers of nested sub-objects such as customer information, account details, risk control rules, and transaction logs, involving numerous collection types and dynamic proxy objects. However, existing debugging tools often lack automated variable search capabilities when handling such complex financial-grade data structures, forcing developers to manually expand the object structure layer by layer to find the target variable. This manual expansion and browsing method is not only cumbersome but also prone to omissions or errors due to the deep nesting or large number of variables, making the search process extremely time-consuming and inefficient. Existing technologies fail to provide a mechanism that can automatically traverse object reference relationships and accurately match target variables, forcing developers to spend a significant amount of time searching for variables, which severely restricts the improvement of debugging efficiency and the timeliness of troubleshooting in financial business systems.

[0003] There is currently no effective solution to the problem of low efficiency in searching for target variables in the debugging environment in related technologies. Summary of the Invention

[0004] The main objective of this application is to provide a variable search method, apparatus, and storage medium in a debugging environment to solve the problem of low efficiency in searching for target variables in a debugging environment in related technologies.

[0005] To achieve the above objectives, according to one aspect of this application, a variable search method in a debugging environment is provided. The method includes: receiving a search command input by the target user in the debugging environment, and generating a regular expression to match the variable name based on the search command; obtaining the set of starting objects in the current debugging context through the debugging interface, initializing the search queue, and adding the object references in the set of starting objects to the search queue in sequence; using a breadth-first search algorithm, and in the case that the search queue is not empty and no search result is obtained, performing the following search process in a loop: taking a current object reference from the head of the search queue, obtaining all member fields of the current object reference, performing a matching check on each member field of the current object reference in sequence, if the name of the member field matches the regular expression, then determining the search result as a member field, recording the value of the member field and the access path corresponding to the member field, and terminating the loop; if the name of the member field does not match the regular expression, and the type of the member field is a reference type, then obtaining the child object reference pointed to by the member field, checking whether there is an accessed marker for the child object reference in the set of accessed object references; if there is no accessed marker for the child object reference in the set of accessed object references, then appending the child object reference to the tail of the search queue; if there is an accessed marker for the child object reference in the set of accessed object references, then skipping the child object reference and not enqueuing it again.

[0006] Optionally, obtaining the set of starting objects in the current debugging context through the debugging interface includes: connecting to the program being debugged through the debugging interface and obtaining the stack frame data of the currently paused thread; extracting local variables, method parameters, and the current instance object from the stack frame data, and determining the local variables, method parameters, and the current instance object as the set of starting objects.

[0007] Optionally, matching and detecting each member field referenced by the current object includes: matching the name of each member field referenced by the current object based on a regular expression; generating an extended regular expression rule based on a search instruction if the regular expression matching fails; and matching the name of each member field referenced by the current object based on the extended regular expression rule.

[0008] Optionally, in the case of failure of regular expression matching, generating extended regular expression rules based on search instructions includes: splitting the search instructions according to preset delimiters to obtain at least one keyword fragment; performing character escaping processing on each keyword fragment to obtain at least one processed fragment; and connecting the at least one processed fragment with a preset connector to generate extended regular expression rules.

[0009] Optionally, obtaining all member fields of the current object reference includes: obtaining the metadata of the class to which the current object reference belongs through reflection; traversing each member field in the metadata to obtain the name, type, and class information of each member field.

[0010] Optionally, obtaining the child object reference pointed to by the member field and checking whether there is an accessed marker for the child object reference in the set of accessed object references includes: obtaining the child object reference pointed to by the member field, calculating the unique identifier of the child object reference, and checking whether there is a unique identifier in the set of accessed object references; if there is a unique identifier in the set of accessed object references, determining that there is an accessed marker for the child object reference in the set of accessed object references; if there is no unique identifier in the set of accessed object references, determining that there is no accessed marker for the child object reference in the set of accessed object references.

[0011] Optionally, after appending the child object reference to the tail of the search queue, the method further includes adding a unique identifier of the child object reference to the set of visited object references.

[0012] To achieve the above objectives, according to another aspect of this application, a variable search device in a debugging environment is provided. The device includes: a generation unit, configured to receive a search instruction input by a target user in a debugging environment and generate a regular expression matching variable names based on the search instruction; a first acquisition unit, configured to acquire a set of starting objects in the current debugging context through a debugging interface, initialize a search queue, and sequentially add object references from the set of starting objects to the search queue; and a search unit, configured to employ a breadth-first search algorithm, and, if the search queue is not empty and no search result is obtained, cyclically execute the following search process: retrieve a current object reference from the head of the search queue, acquire all member fields of the current object reference, and sequentially perform matching checks on each member field of the current object reference; if the member field is not empty, perform a matching check on ... If the name of a segment matches a regular expression, the search result is determined to be a member field. The value of the member field and the access path corresponding to the member field are recorded, and the loop terminates. The second acquisition unit is used to acquire the sub-object reference pointed to by the member field if the name of the member field does not match the regular expression and the type of the member field is a reference type. It checks whether there is an accessed mark for the sub-object reference in the set of accessed object references. The append unit is used to append the sub-object reference to the tail of the search queue if there is no accessed mark for the sub-object reference in the set of accessed object references. If there is an accessed mark for the sub-object reference in the set of accessed object references, the sub-object reference is skipped and not enqueued for processing.

[0013] According to another aspect of this application, a computer-readable storage medium is provided, which includes a stored program, wherein, when the program is running, it controls the device where the computer-readable storage medium is located to execute a variable search method under any debugging environment.

[0014] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a variable search method for performing any debugging environment.

[0015] According to another aspect of this application, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps of the variable search method in a debugging environment of any of the above.

[0016] In this embodiment, a search command input by the target user is received in the debugging environment, and a regular expression matching the variable name is generated based on the search command. The starting object set in the current debugging context is obtained through the debugging interface, and a search queue is initialized. Object references in the starting object set are added to the search queue sequentially. A breadth-first search algorithm is used. If the search queue is not empty and no search result is found, the following search process is executed cyclically: a current object reference is retrieved from the head of the search queue, all member fields of the current object reference are obtained, and each member field of the current object reference is checked for matching. If the name of a member field matches the regular expression, the search is confirmed. The search result is a member field. The value of the member field and the access path corresponding to the member field are recorded, and the loop terminates. If the name of the member field does not match the regular expression and the member field is a reference type, the sub-object reference pointed to by the member field is obtained. It is checked whether there is an accessed sub-object reference in the set of accessed object references. If there is no accessed sub-object reference in the set of accessed object references, the sub-object reference is appended to the tail of the search queue. If there is an accessed sub-object reference in the set of accessed object references, the sub-object reference is skipped and not enqueued. This solves the technical problem of low efficiency in searching for target variables in the debugging environment in related technologies.

[0017] In this application, by receiving user input and converting it into standard regular expressions, the ambiguous user intent is transformed into computer-executable matching rules. The initial set of objects in the current thread stack frame is obtained through a debugging interface, and an initial search queue is constructed. A breadth-first search algorithm is used to retrieve objects from the head of the search queue, traversing their member fields layer by layer. Regular expression matching is performed on the name of each member field. If a match is successful, the value of the member field and the access path are recorded, and the search terminates. This replaces the manual deep expansion and multiple clicks. If a match fails, before enqueuing the sub-object, it checks whether there is a visited marker in the already visited object reference set. If the sub-object has been visited, it is skipped; otherwise, it is marked and enqueued, preventing the search from getting stuck in an infinite loop. This achieves the technical effect of improving the efficiency of searching for target variables in the debugging environment. Attached Figure Description

[0018] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0019] Figure 1 A hardware block diagram of a computer terminal for implementing a variable search method in a debugging environment is shown.

[0020] Figure 2 This is a flowchart of a variable search method in a debugging environment provided according to an embodiment of this application;

[0021] Figure 3 This is an interactive diagram in a debugging environment provided according to an embodiment of this application;

[0022] Figure 4 These are module design diagrams provided in the debugging environment according to embodiments of this application;

[0023] Figure 5 This is a schematic diagram of a variable search device in a debugging environment provided according to an embodiment of this application;

[0024] Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0027] It should be noted that all relevant information (including at least one of the following debugging data information, user page information, etc.) and data (including at least one of the following data used for display, analysis data, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties. For example, if there is an interface between this system and the relevant user or organization, before obtaining the relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information from the aforementioned user or organization.

[0028] Example 1

[0029] According to an embodiment of this application, a method embodiment for variable search in a debugging environment is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0030] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a variable search method in a debugging environment is shown. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include at least one of the following: a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0031] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0032] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the variable search method in the debugging environment in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the variable search method in the debugging environment described above. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of the above-mentioned networks include at least one of the following: the Internet, corporate intranet, local area network, mobile communication network, and combinations thereof.

[0033] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0034] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0035] Under the aforementioned operating environment, this application provides the following: Figure 2 The variable search method shown is used in the debugging environment. Figure 2 This is a flowchart of a variable search method in a debugging environment according to Embodiment 1 of this application.

[0036] Step S201: Receive the search command input by the target user in the debugging environment, and generate a regular expression to match the variable name based on the search command.

[0037] Optionally, the system can receive search commands manually entered by the target user in the search input box of the user interface module. The search command can be a keyword, wildcard, or regular expression string. If the search command entered by the target user is a regular keyword, wildcards can be added (e.g., ...). This feature converts search commands into regular expressions that support prefixes, suffixes, or inclusion matching. If the target user's search command already contains regular expression symbols, its syntax validity can be directly validated. If the validation passes, it can be used directly; if it fails, the target user can be prompted to correct it, or the query can be automatically completed to the default regular expression mode. Furthermore, special characters in the search command can be escaped before generating the regular expression to prevent regular expression injection attacks or parsing errors.

[0038] Step S202: Obtain the set of starting objects in the current debugging context through the debugging interface, initialize the search queue, and add the object references in the set of starting objects to the search queue in turn.

[0039] Optionally, taking a Java debugging environment as an example, the Java Debug Interface (JDI) can be used to obtain a list of threads currently in a suspended state. Then, the stack frames of each thread can be traversed to extract references to all visible variable objects defined within the stack frames. If the target user specifies a particular debugging entry point, the instance object of the class containing the specified entry point can be used directly as the starting object set. The starting object set in the current debugging context can include local variables in the stack frame of the currently executing thread, the input parameter objects of the currently executing method, instance fields or static fields of the current class, and, if currently in a transaction processing or security authentication context, can also include the context object or session object bound to the current business logic.

[0040] Optionally, a first-in, first-out (FIFO) queue data structure can be created. Before adding object references to the queue sequentially, type filtering can be performed to exclude primitive data types and non-serializable internal system objects, retaining reference type objects for queuing. Next, a collection of accessed object references (such as a HashSet) is initialized to record all queued or processed object references, preventing infinite loops caused by circular references.

[0041] Step S203: Using a breadth-first search algorithm, if the search queue is not empty and no search result is obtained, the following search process is executed in a loop: take a current object reference from the head of the search queue, obtain all member fields of the current object reference, perform matching detection on each member field of the current object reference in turn, if the name of the member field matches the regular expression, then determine the search result as the member field, record the value of the member field and the access path corresponding to the member field, and terminate the loop.

[0042] Optionally, if the current object reference is a dynamic proxy object, the target class of the current object reference can be obtained first through reflection, and then the member fields of the target class can be obtained. If the current object reference is a collection type, each element in the collection can be traversed, and non-empty elements can be added to a temporary processing list as objects to be checked. Next, the name string of each member field is compared with the generated regular expression. If a match is found, the current runtime value of the matched member field can be obtained through the JDI's getFieldValue method. Combining the path prefix of the current object reference with the current field name, the access path of the member field can be generated. In addition to recording the value and access path of the matched member field, the fully qualified name and package name of the class to which the matched member field belongs can also be recorded to provide contextual information when displaying search results.

[0043] Optionally, during the search process using the breadth-first search algorithm, a maximum search depth threshold can be set. If the current traversal level exceeds the maximum search depth threshold, further expansion of the current branch will be stopped to avoid performance degradation caused by excessive depth.

[0044] Step S204: If the name of the member field does not match the regular expression and the type of the member field is a reference type, then obtain the sub-object reference pointed to by the member field and check whether there is an accessed marker for the sub-object reference in the set of accessed object references.

[0045] Optionally, the unique identifier of the sub-object reference can be obtained, and the unique identifier of the sub-object reference can be searched in the set of visited object references. If it exists, it is determined that the sub-object reference has been visited, and there may be a circular reference, so the skip logic is entered; if it does not exist, it is determined that the sub-object reference has not been visited, so the enqueue logic is entered.

[0046] In step S205, if there is no accessed marker for a child object reference in the set of accessed object references, the child object reference is appended to the tail of the search queue. If there is an accessed marker for a child object reference in the set of accessed object references, the child object reference is skipped and not enqueued.

[0047] Optionally, if there is no accessed marker for the child object reference in the set of accessed object references, the child object reference is appended to the tail of the search queue. At the same time as adding the child object reference to the tail of the queue, the unique identifier of the child object reference can be added to the set of accessed object references and marked as accessed. The parent object path and current field name of the child object reference can also be recorded so that a complete access path can be generated when backtracking the results later.

[0048] Optionally, if there is a visited marker for a child object reference in the collection of visited object references, the child object reference is skipped and not enqueued. Furthermore, all descendant objects of the visited child object references can be ignored, and no expansion or search is performed, thereby avoiding stack overflow or memory overflow caused by infinite recursion.

[0049] The variable search method in the debugging environment provided in this application receives user input and converts it into standard regular expressions, transforming ambiguous user intent into computer-executable matching rules. It obtains the initial object set in the current thread stack frame through the debugging interface, constructs an initial search queue, and employs a breadth-first search algorithm. Objects are retrieved from the head of the search queue, and their member fields are traversed layer by layer. Regular expression matching is performed on each member field name. If a match is successful, the value and access path of the member field are recorded, and the search terminates. This replaces manual deep expansion and multiple clicks. If a match fails, before enqueuing the sub-object, it checks whether there is an accessed marker in the already accessed object reference set. If the sub-object has been accessed, it is skipped; otherwise, it is marked and enqueued, preventing the search from getting stuck in an infinite loop. This solves the technical problem of low efficiency in searching for target variables in the debugging environment in related technologies, achieving a significant improvement in the efficiency of searching for target variables in the debugging environment.

[0050] To improve the response speed for locating target variables, optionally, in the variable search method in the debugging environment provided in this application embodiment, obtaining the set of starting objects in the current debugging context through the debugging interface includes:

[0051] The first step is to connect to the program being debugged through the debugging interface and obtain the stack frame data of the currently paused thread.

[0052] Optionally, it can respond to debugging control commands (such as pause, single-step execution, or breakpoint hit). Taking the Java debugging environment as an example, it can trigger the Java Debug Interface (JDI) event listener, obtain the list of threads currently in a suspended state from the event object, traverse the thread list, and obtain the stack frame data corresponding to each thread. The stack frame data contains runtime data such as the local variable table, operand stack, and method parameters during the execution of the current method.

[0053] The second step is to extract local variables, method parameters, and the current instance object from the stack frame data, and determine the local variables, method parameters, and the current instance object as the starting object set.

[0054] Optionally, all non-empty, reference-type local variable objects can be traversed and extracted based on the local variable table index of the current method. All input parameter object references (i.e., method parameters) of the currently executing method can be obtained through the method signature of the stack frame. If the method corresponding to the current stack frame is a non-static method, the implicit this reference (i.e., the current instance object) can be obtained through the stack frame. Then, the local variables, method parameters, and the current instance object are determined as the starting object set.

[0055] Optionally, before determining the initial set of objects, object references of basic data types (such as int, boolean, etc.) and internal system objects belonging to prohibited search packages can be removed, so that the search queue contains only valid objects related to the business.

[0056] In summary, by taking the above steps, obtaining stack frame data, and extracting local variables, method parameters, and the current instance object from the stack frame data, a set of starting objects most relevant to the current business logic can be constructed. This reduces the initial computational load of breadth-first search and improves the response speed and accuracy of target variable location.

[0057] To improve the fault tolerance of variable search, optionally, in the variable search method in the debugging environment provided in this application embodiment, the matching detection of each member field referenced by the current object includes:

[0058] The first step is to match the name of each member field referenced by the current object using regular expressions.

[0059] Optionally, the original name of the member field (such as userName) can be compared with the generated standard regular expression (e.g., ...). The system performs precise pattern matching on user.name. If a match is found, the member field is directly identified as the search result, and the relevant information is recorded. If a match fails, the system proceeds to perform fuzzy matching.

[0060] The second step is to generate extended regular expression rules based on the search instructions if the regular expression matching fails.

[0061] Optionally, keywords in the search query can be converted to lowercase (or uppercase) to generate case-insensitive extended regular expression rules. The system can identify whether the search query contains underscores or hyphens; if the original regular expression does not match, it can generate extended regular expression rules that support camelCase and underscore conversion to accommodate different team or framework naming conventions. If the target user's search query contains significant spelling errors, it can generate extended regular expression rules that include wildcards or optional characters based on edit distance or N-gram algorithms, tolerating single or multiple character input errors.

[0062] The third step is to match the name of each member field referenced by the current object based on extended regular expression rules.

[0063] Optionally, after generating extended regular expression rules, the name of each member field referenced by the current object can be matched. There may be one or more extended regular expression rules. If any extended regular expression rule successfully matches a member field, the successfully matched member field can be determined as the search result, and the value, access path and matching type of the successfully matched member field can be recorded.

[0064] In summary, by following the steps above and expanding from exact matching to fuzzy matching, we can improve the fault tolerance of variable search in complex debugging scenarios, thereby increasing the hit rate of target variable search in the debugging environment.

[0065] To improve the fault tolerance capability of searching for target variables in complex debugging environments, optionally, in the variable search method in the debugging environment provided in the embodiments of this application, in the case of failure based on regular expression matching, generating extended regular expression rules based on search instructions includes:

[0066] The first step is to split the search command according to the preset delimiter to obtain at least one keyword fragment.

[0067] Optionally, the default separator can be a space, comma, underscore, hyphen, or uppercase letter boundary in camelCase naming.

[0068] The second step is to perform character escaping on each keyword fragment to obtain at least one processed fragment.

[0069] Optionally, you can first check if each keyword fragment contains regular expression metacharacters. If a metacharacter is found, add an escape character "\" before it to prevent it from being parsed as a regular expression symbol. To enhance fuzzy matching capabilities, ordinary characters in the keyword fragment can be replaced with a pattern of "character + optional delimiter". For example, convert the fragment "user" to "user" or "u". s. e. r, thus supporting matching of various variants such as user_name, user-name, and u_s_e_r.

[0070] The third step is to connect at least one processed fragment using a preset connector to generate an extended regular expression rule.

[0071] Optionally, the default connector can be any character connector, for example, using... Connect the fragments to generate the following: The extended regular expression rule for `user.name.` allows any number of arbitrary characters between segments; the default connector can also be a delimiter. Optional connectors, such as `[-.]?`, can be used to connect segments, generating an extended regular expression rule like `user[-.]?name`, which can be used to match naming conventions that mix camelCase and underscores. If multiple candidate extended regular expression rules are generated, they can be stored in a candidate list and attempted sequentially in subsequent matching and detection stages.

[0072] In summary, by breaking down the search command into independent keyword units, performing character escaping, and then concatenating them to generate extended regular expression rules, the fault tolerance capability for searching target variables in complex debugging environments can be improved.

[0073] To improve the completeness of variable search, optionally, in the variable search method in the debugging environment provided in this application embodiment, obtaining all member fields referenced by the current object includes:

[0074] The first step is to obtain the metadata of the class to which the current object reference belongs through reflection.

[0075] Optionally, the processor instance associated with the current object reference can be obtained through reflection, and the processor instance associated with the current object reference can be further parsed to extract and locate the real business class or target class being proxied. Based on the located real business class or target class, the metadata of the class to which the current object reference belongs can be obtained.

[0076] The second step is to iterate through each member field in the metadata and obtain the name, type, and class information of each member field.

[0077] Optionally, starting from the actual business class or target class, the inheritance relationship can be traversed upwards along its parent classes and implemented interfaces, merging all member fields declared in the parent classes and interfaces into the set of fields to be processed. For each member field in the set of fields to be processed, identification information (i.e., name), data type information, and class information can be extracted. The class information can be used to provide context ownership identifiers when constructing variable access paths later.

[0078] In summary, by following the steps above and extracting the noun, type, and class information of each member field from the metadata in a structured manner, we can completely obtain all potential fields referenced by the current object, thereby improving the completeness and accuracy of variable search.

[0079] To prevent infinite recursion loops, optionally, in the variable search method in the debugging environment provided in this application embodiment, obtaining the sub-object reference pointed to by the member field and checking whether there is an accessed marker for the sub-object reference in the set of accessed object references includes:

[0080] The first step is to obtain the child object reference pointed to by the member field, calculate the unique identifier of the child object reference, and check whether the unique identifier exists in the collection of visited object references.

[0081] Optionally, taking a Java debugging environment as an example, the `System.identityHashCode()` method in Java reflection can be used to generate a unique hash value or address code of the child object reference in the Java Virtual Machine heap memory as a unique identifier. Then, it is checked whether the unique identifier of the child object reference already exists in the collection of accessed object references.

[0082] The second step is to determine whether a unique identifier exists in the set of visited object references, and whether a child object reference exists in the set of visited object references. If no unique identifier exists in the set of visited object references, it is determined whether a child object reference exists in the set of visited object references.

[0083] Optionally, if a unique identifier exists in the set of visited object references, it can be determined that there are visited markers for child object references in the set. Further recursive searches of child object references and their subfields that have been visited can be stopped immediately to avoid duplicate processing. If no unique identifier exists in the set of visited object references, it can be determined that there are no visited markers for child object references in the set. The child object references can be added to the tail of the breadth-first search queue, awaiting subsequent traversal.

[0084] In summary, through the above steps and the object access state management mechanism based on unique identifiers, effective detection is achieved during the traversal process, infinite recursion is avoided, and the risk of memory overflow is reduced.

[0085] In order to ensure that objects already in the queue can be marked as processed in a timely manner during the breadth-first search process, optionally, in the variable search method in the debugging environment provided in the embodiments of this application, after appending the sub-object reference to the tail of the search queue, the method further includes: adding the unique identifier of the sub-object reference to the set of visited object references.

[0086] Optionally, while enqueuing the sub-object reference, a unique identifier of the sub-object reference can be written to the set of visited object references. This set can employ a hash set or a Bloom filter data structure to achieve constant-time lookup and insertion operations. By updating the access status immediately after enqueuing the object, the number of redundant elements in the search queue can be reduced, thus improving the speed of locating the target variable.

[0087] Figure 3 The diagram illustrates the module interaction in the debugging environment. First, the debugging module requests the stack frame data of the current thread from the Java Virtual Machine (JVM). The JVM returns the stack frame data to the debugging module. The user interface module inputs a variable name to the debugging module to search for the variable. After receiving the user input, the debugging module uses a breadth-first search algorithm. If the search queue is not empty and no search result is found, it iteratively executes the following search process: It retrieves a reference to the current object from the head of the search queue, obtains all member fields of the current object reference, and sequentially performs a matching check on each member field. If the name of a member field matches a regular expression, the search result is determined to be a member field. The value of the member field and its corresponding access path are recorded, and the loop terminates. After finding the target variable, the debugging module returns the data found based on the variable name, i.e., the target variable, to the user interface module.

[0088] Figure 4The diagram shows the module design in the debugging environment. The user interface module includes a search input box, a variable tree display, debug control buttons, and a results display panel. The debug core module connects the user interface module, connector, security filter, circular reference detector, breadth-first searcher, and the application being debugged. The target user enters the target variable name (supporting regular expressions or fuzzy matching) through the search input box in the user interface module and sends the search command to the debug core module. The debug core module, in collaboration with the connector, security filter, circular reference detector, breadth-first searcher, and the application being debugged, performs the search task. The connector establishes a debug session with the target JVM (Java Virtual Machine) to obtain the initial stack frame data of the current thread; the security filter performs permission verification on the access path, blocking traversal of core system classes and sensitive data; the circular reference detector identifies accessed objects using unique identifiers, blocking repeated traversal paths to prevent infinite recursion; the breadth-first searcher performs hierarchical traversal based on the breadth-first search algorithm and combines it with regular expressions for field matching; the application being debugged provides real-time, consistent runtime data support for objects in a paused state. After the search is complete, the variable tree display panel in the user interface module visually displays the nesting hierarchy and field relationships of objects in the thread stack frame in a tree structure. The debug control buttons provide graphical controls such as pause, resume, and step-by-step execution to control the execution status of the application being debugged. The results display panel centrally displays details of the matched target variables, including variable name, complete access path, current value, data type, and class information. In summary, through the coordination of various modules, the target variable can be quickly located, improving the efficiency of variable searching in the debugging environment.

[0089] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0090] Example 2

[0091] This application also provides a variable search device in a debugging environment. It should be noted that the variable search device in a debugging environment provided in this application can be used to execute the variable search method in a debugging environment provided in this application. The variable search device in a debugging environment provided in this application will be described below.

[0092] According to embodiments of this application, an apparatus for implementing the variable search method in the above-described debugging environment is also provided, such as... Figure 5 As shown, the device includes: a generation unit 501, a first acquisition unit 502, a search unit 503, a second acquisition unit 504, and an append unit 505.

[0093] The generation unit 501 is used to receive search instructions input by the target user in the debugging environment and generate regular expressions that match variable names based on the search instructions;

[0094] The first acquisition unit 502 is used to acquire the set of starting objects in the current debugging context through the debugging interface, initialize the search queue, and add the object references in the set of starting objects to the search queue in turn.

[0095] Search unit 503 is used to perform the following search process in a loop when the search queue is not empty and no search result is obtained, using a breadth-first search algorithm: take a current object reference from the head of the search queue, obtain all member fields of the current object reference, perform matching detection on each member field of the current object reference in turn, if the name of the member field matches the regular expression, determine the search result as the member field, record the value of the member field and the access path corresponding to the member field, and terminate the loop;

[0096] The second acquisition unit 504 is used to acquire the sub-object reference pointed to by the member field if the name of the member field does not match the regular expression and the type of the member field is a reference type, and check whether there is an accessed marker for the sub-object reference in the collection of accessed object references.

[0097] The append unit 505 is used to append the child object reference to the tail of the search queue if there is no accessed marker for the child object reference in the set of accessed object references, and to skip the child object reference and not enqueue it again if there is an accessed marker for the child object reference in the set of accessed object references.

[0098] The variable search device in the debugging environment provided in this application embodiment receives a search command input by a target user in the debugging environment through a generation unit 501, and generates a regular expression matching the variable name based on the search command; a first acquisition unit 502 acquires the set of starting objects in the current debugging context through a debugging interface, initializes a search queue, and adds object references in the set of starting objects to the search queue in sequence; the search unit 503 adopts a breadth-first search algorithm, and in the case that the search queue is not empty and no search result is acquired, it performs the following search process in a loop: taking a current object reference from the head of the search queue, acquiring all member fields of the current object reference, performing a matching detection on each member field of the current object reference in sequence, and determining the search result if the name of the member field matches the regular expression. For member fields, record the value of the member field and the access path corresponding to the member field, and terminate the loop; the second acquisition unit 504, if the name of the member field does not match the regular expression, and the type of the member field is a reference type, then acquire the sub-object reference pointed to by the member field, and check whether there is an accessed marker for the sub-object reference in the set of accessed object references; the append unit 505, if there is no accessed marker for the sub-object reference in the set of accessed object references, append the sub-object reference to the tail of the search queue, if there is an accessed marker for the sub-object reference in the set of accessed object references, then skip the sub-object reference and do not enqueue it for processing. This solves the technical problem of low efficiency in searching for target variables in the debugging environment in related technologies, and achieves the technical effect of improving the efficiency of searching for target variables in the debugging environment.

[0099] Optionally, in the variable search device in the debugging environment provided in the embodiments of this application, the first acquisition unit 502 includes: a first acquisition module, used to connect to the program being debugged through a debugging interface and acquire the stack frame data of the currently paused thread; and a determination module, used to extract local variables, method parameters and the current instance object from the stack frame data and determine the local variables, method parameters and the current instance object as the starting object set.

[0100] Optionally, in the variable search device in the debugging environment provided in this application embodiment, the search unit 503 includes: a first matching module, used to match the name of each member field referenced by the current object based on a regular expression; a generation module, used to generate extended regular expression rules based on search instructions when the matching based on the regular expression fails; and a second matching module, used to match the name of each member field referenced by the current object based on the extended regular expression rules.

[0101] Optionally, in the variable search device in the debugging environment provided in this application embodiment, the generation module includes: a splitting submodule, used to split the search instruction according to a preset delimiter to obtain at least one keyword fragment; a processing submodule, used to perform character escaping processing on each keyword fragment to obtain at least one processed fragment; and a generation submodule, used to connect at least one processed fragment through a preset connector to generate an extended regular expression rule.

[0102] Optionally, in the variable search device in the debugging environment provided in the embodiments of this application, the search unit 503 includes: a second acquisition module, used to acquire the metadata of the class to which the current object reference belongs through reflection mechanism; and a third acquisition module, used to traverse each member field in the metadata and acquire the name, type and class information of each member field.

[0103] Optionally, in the variable search device in the debugging environment provided in the embodiments of this application, the second acquisition unit 504 includes: a calculation module, used to acquire the sub-object reference pointed to by the member field, calculate the unique identifier of the sub-object reference, and check whether there is a unique identifier in the set of accessed object references; and a determination module, used to determine that there is an accessed mark of the sub-object reference in the set of accessed object references if there is a unique identifier in the set of accessed object references, and to determine that there is no accessed mark of the sub-object reference in the set of accessed object references if there is no unique identifier.

[0104] Optionally, in the variable search device in the debugging environment provided in the embodiments of this application, the device further includes: an adding unit, used to add the unique identifier of the sub-object reference to the set of visited object references after appending the sub-object reference to the tail of the search queue.

[0105] It should be noted that the above-mentioned generation unit 501, first acquisition unit 502, search unit 503, second acquisition unit 504, and append unit 505 correspond to steps S201 to S205 in Embodiment 1. The five units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above-mentioned modules can also be part of the device and run in the computer terminal 10 provided in Embodiment 1.

[0106] Example 3

[0107] Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.

[0108] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.

[0109] In this embodiment, the computer terminal described above can execute the program code for the following steps in the variable search method in the debugging environment: receiving the search command input by the target user in the debugging environment, and generating a regular expression matching the variable name based on the search command; obtaining the set of starting objects in the current debugging context through the debugging interface, initializing the search queue, and adding the object references in the set of starting objects to the search queue in sequence; using a breadth-first search algorithm, and in the case that the search queue is not empty and no search result is obtained, repeatedly executing the following search process: taking a current object reference from the head of the search queue, obtaining all member fields of the current object reference, and sequentially performing a search on each member field of the current object reference. The member field is matched and checked. If the name of the member field matches the regular expression, the search result is determined to be the member field, the value of the member field and the access path corresponding to the member field are recorded, and the loop terminates. If the name of the member field does not match the regular expression, and the member field is of reference type, the child object reference pointed to by the member field is obtained, and it is checked whether there is a marked child object reference that has been accessed in the set of accessed object references. If there is no marked child object reference that has been accessed in the set of accessed object references, the child object reference is appended to the tail of the search queue. If there is a marked child object reference that has been accessed in the set of accessed object references, the child object reference is skipped and not enqueued for further processing.

[0110] Optionally, the computer terminal described above can execute the program code for the following steps in the variable search method in the debugging environment: obtaining the set of starting objects in the current debugging context through the debugging interface includes: connecting to the program being debugged through the debugging interface and obtaining the stack frame data of the currently paused thread; extracting local variables, method parameters and the current instance object from the stack frame data, and determining the local variables, method parameters and the current instance object as the set of starting objects.

[0111] Optionally, the aforementioned computer terminal can execute program code for the following steps in the variable search method under a debugging environment: performing matching detection on each member field referenced by the current object includes: matching the name of each member field referenced by the current object based on a regular expression; generating an extended regular expression rule based on the search instruction if the matching based on the regular expression fails; and matching the name of each member field referenced by the current object based on the extended regular expression rule.

[0112] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the variable search method under the debugging environment: In the case of failure of matching based on regular expression, generating extended regular expression rules based on search instructions includes: splitting the search instructions according to preset delimiters to obtain at least one keyword fragment; performing character escaping processing on each keyword fragment to obtain at least one processed fragment; and connecting at least one processed fragment through a preset connector to generate extended regular expression rules.

[0113] Optionally, the computer terminal described above can execute the program code for the following steps in the variable search method in the debugging environment: obtaining all member fields of the current object reference, including: obtaining the metadata of the class to which the current object reference belongs through reflection mechanism; traversing each member field in the metadata and obtaining the name, type and class information of each member field.

[0114] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the variable search method under a debugging environment: obtaining the sub-object reference pointed to by the member field and checking whether there is an accessed marker for the sub-object reference in the set of accessed object references, including: obtaining the sub-object reference pointed to by the member field, calculating the unique identifier of the sub-object reference, and checking whether there is a unique identifier in the set of accessed object references; if there is a unique identifier in the set of accessed object references, determining that there is an accessed marker for the sub-object reference in the set of accessed object references; if there is no unique identifier in the set of accessed object references, determining that there is no accessed marker for the sub-object reference in the set of accessed object references.

[0115] Optionally, the computer terminal described above can execute program code for the following steps in the variable search method under a debugging environment: after appending the sub-object reference to the tail of the search queue, the method further includes: adding the unique identifier of the sub-object reference to the set of visited object references.

[0116] Optionally, Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6 (Only one is shown) Processor 602, memory 604, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0117] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the variable search method and apparatus in the debugging environment in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the variable search method in the debugging environment described above. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of the aforementioned networks include at least one of the following: the Internet, corporate intranet, local area network, mobile communication network, and combinations thereof.

[0118] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the variable search method under the debugging environment.

[0119] This application provides a variable search scheme in a debugging environment. It receives search commands input by the target user in the debugging environment and generates regular expressions matching variable names based on these commands. It obtains the set of starting objects in the current debugging context through a debugging interface and initializes a search queue, adding object references from the starting object set to the search queue sequentially. Using a breadth-first search algorithm, if the search queue is not empty and no search result is found, the following search process is executed iteratively: a current object reference is retrieved from the head of the search queue; all member fields of the current object reference are obtained; each member field of the current object reference is sequentially checked for matching; if the name of a member field matches the regular expression, the search result is determined to be a member field, and the value of the member field is recorded. The loop terminates after finding the access path corresponding to the member field. If the name of the member field does not match the regular expression and the member field is a reference type, the sub-object reference pointed to by the member field is obtained, and the accessed object reference is checked in the set of accessed object references. If the accessed object reference does not have an accessed sub-object reference, the sub-object reference is appended to the tail of the search queue. If the accessed object reference has an accessed sub-object reference, the sub-object reference is skipped and not enqueued. This solves the technical problem of low efficiency in searching for target variables in the debugging environment in related technologies and achieves the technical effect of improving the efficiency of searching for target variables in the debugging environment.

[0120] Those skilled in the art will understand that Figure 6 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 6 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 6 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 6 The different configurations shown.

[0121] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0122] Example 4

[0123] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the variable search method in the debugging environment provided in Embodiment 1.

[0124] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0125] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing variable search method steps in a debugging environment.

[0126] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0127] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0128] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.

[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0130] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0132] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A variable search method in a debugging environment, characterized in that, include: The system receives search instructions from the target user in the debugging environment and generates regular expressions that match variable names based on the search instructions. The set of starting objects in the current debugging context is obtained through the debugging interface, and the search queue is initialized. The object references in the set of starting objects are added to the search queue in turn. Using a breadth-first search algorithm, if the search queue is not empty and no search result is obtained, the following search process is executed cyclically: a current object reference is taken from the head of the search queue, all member fields of the current object reference are obtained, each member field of the current object reference is matched and detected in turn, if the name of the member field matches the regular expression, the search result is determined to be the member field, the value of the member field and the access path corresponding to the member field are recorded, and the loop is terminated; If the name of the member field does not match the regular expression, and the type of the member field is a reference type, then obtain the sub-object reference pointed to by the member field, and check whether there is an accessed marker for the sub-object reference in the set of accessed object references; If the accessed object reference does not have an accessed marker in the accessed object reference set, the sub-object reference is appended to the tail of the search queue. If the accessed object reference has an accessed marker in the accessed object reference set, the sub-object reference is skipped and not enqueued.

2. The method according to claim 1, characterized in that, The set of starting objects obtained through the debugging interface includes: The debugger connects to the program being debugged through the debug interface to obtain the stack frame data of the currently paused thread. Local variables, method parameters, and the current instance object are extracted from the stack frame data, and the local variables, method parameters, and the current instance object are determined to be the starting object set.

3. The method according to claim 1, characterized in that, The matching and detection for each member field referenced by the current object includes: The name of each member field referenced by the current object is matched based on the regular expression; In the event that the regular expression matching fails, an extended regular expression rule is generated based on the search instruction; The extended regular expression rules are used to match the name of each member field referenced by the current object.

4. The method according to claim 3, characterized in that, In the event that a match based on the regular expression fails, generating extended regular expression rules based on the search instruction includes: The search command is split according to a preset delimiter to obtain at least one keyword fragment; Each keyword fragment is subjected to character escaping processing to obtain at least one processed fragment; At least one processed fragment is connected using a preset connector to generate the extended regular expression rule.

5. The method according to claim 1, characterized in that, Retrieving all member fields referenced by the current object includes: The metadata of the class to which the current object reference belongs is obtained through reflection. Iterate through each member field in the metadata to obtain the name, type, and class information of each member field.

6. The method according to claim 1, characterized in that, Retrieve the sub-object reference pointed to by the member field, and check whether the accessed object reference exists in the collection of accessed object references, including: Obtain the sub-object reference pointed to by the member field, calculate the unique identifier of the sub-object reference, and check whether the unique identifier exists in the set of visited object references; If the unique identifier exists in the set of visited object references, it is determined that the visited mark of the sub-object reference exists in the set of visited object references; if the unique identifier does not exist in the set of visited object references, it is determined that the visited mark of the sub-object reference does not exist in the set of visited object references.

7. The method according to claim 1, characterized in that, After appending the sub-object reference to the tail of the search queue, the method further includes: Add the unique identifier of the sub-object reference to the set of accessed object references.

8. A variable search device in a debugging environment, characterized in that, include: The generation unit is used to receive search instructions input by the target user in the debugging environment and generate regular expressions that match variable names based on the search instructions; The first acquisition unit is used to acquire the set of starting objects in the current debugging context through the debugging interface, initialize the search queue, and add the object references in the set of starting objects to the search queue in sequence. The search unit is used to perform the following search process in a loop when the search queue is not empty and no search result is obtained, using a breadth-first search algorithm: take a current object reference from the head of the search queue, obtain all member fields of the current object reference, perform matching detection on each member field of the current object reference in turn, if the name of the member field matches the regular expression, determine the search result as the member field, record the value of the member field and the access path corresponding to the member field, and terminate the loop; The second acquisition unit is used to acquire the sub-object reference pointed to by the member field if the name of the member field does not match the regular expression and the type of the member field is a reference type, and to check whether there is an accessed marker for the sub-object reference in the set of accessed object references. The append unit is configured to append the sub-object reference to the tail of the search queue if the visited object reference set does not contain an visited marker for the sub-object reference; otherwise, it skips the sub-object reference and does not enqueue it for further processing.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the variable search method in a debugging environment as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, executes the variable search method in a debugging environment as described in any one of claims 1 to 7.

11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the variable search method in the debugging environment as described in any one of claims 1 to 7.