Program debugging method and device, equipment and storage medium
By providing multiple debugging modes in the applet development tool and not configuring the editor in the first debugging mode, the problem of excessive memory usage of applet development tools is solved, and the debugging function that meets the needs of developers without affecting performance is achieved.
Patent Information
- Application Number
- CN202311126253.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2025-03-07
AI Technical Summary
The memory usage of mini program development tools during operation is too high, resulting in performance degradation, and it is necessary to find a way to reduce memory usage.
A program debugging method is provided by deploying multiple debug modes in a program debugging system, wherein the first debug mode is not configured with an editor, launching the rendering process in response to a selected operation, and loading the front-end resource package and the common resource package in the rendering process to display the interactive interface and the debugger.
By reducing the configuration of the editor, the memory usage of the program debugging system when running in the first debug mode is reduced, and ensuring that the debugger runs normally without the editor configured, meeting the developer's usage needs.
Smart Images

Figure CN119576743A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a program debugging method, device, equipment and storage medium. Background Art
[0002] With the continuous development of computer technology, there are more and more types of application programs. Mini programs are one of the more popular types of applications. Developers can use mini program development tools to develop, debug, upload, and other tasks. The current mini program development tools include editors, simulators, debuggers, real-machine debugging and other main functions, as well as various auxiliary functions.
[0003] Since the mini program development tools occupy too much memory during operation, how to reduce the memory usage while meeting the needs of developers is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In order to solve the above technical problems, an embodiment of the present disclosure provides a program debugging method.
[0005] In a first aspect, the present disclosure provides a program debugging method, which is applied to a program debugging system, wherein the program debugging system includes at least two debugging modes, wherein the at least two debugging modes include a first debugging mode, wherein a front-end resource package and a public resource package of the first debugging mode are deployed in the program debugging system, and the first debugging mode is not configured with an editor;
[0006] The method comprises:
[0007] In response to a selection operation for the first debugging mode, starting a rendering process corresponding to the first debugging mode; wherein a view control of the debugger in the first debugging mode is mounted in the rendering process;
[0008] The front-end resource package of the first debugging mode and the public resource package are loaded in the rendering process to display an interactive interface of the first debugging mode, and the debugger is displayed on the interactive interface.
[0009] In an optional implementation manner, the interactive interface of the first debugging mode further displays a simulator and a stop control for the simulator, and the method further includes:
[0010] In response to a first trigger operation on the stop operation control, stop the simulator and release resources of the simulator;
[0011] And, the simulator in the stopped state is displayed on the interactive interface of the first debugging mode.
[0012] In an optional implementation manner, the method further includes:
[0013] In response to a second trigger operation on the stop operation control, the operation of the simulator is restarted.
[0014] In an optional implementation manner, the method further includes:
[0015] In response to a real machine debugging trigger operation on the interactive interface of the first debugging mode, a real machine debugging page is displayed, and a link identifier is displayed on the real machine debugging page; wherein the link identifier is used to establish a connection relationship with a terminal device to perform real machine debugging using the terminal device.
[0016] The method according to claim 1, characterized in that the method further comprises:
[0017] When a change in the width of the interactive interface of the first debugging mode is monitored, obtaining a current width value of the interactive interface of the first debugging mode;
[0018] Determine the non-displayable controls corresponding to the current width value based on the display width of each control in the toolbar on the interactive interface of the first debugging mode;
[0019] The non-displayable controls are displayed in the toolbar in the form of a drop-down list.
[0020] In an optional implementation manner, the method further includes:
[0021] In the process of loading the front-end resource package of the first debugging mode and the public resource package in the rendering process, based on the dependency injection method, a simulated application program interface API method is injected in the first debugging mode; wherein, the simulated API method is used to support the calling logic for the plug-in extension API in the first debugging mode.
[0022] In an optional implementation, the at least two debugging modes include a second debugging mode, a front-end resource package of the second debugging mode is also deployed in the program debugging system, and the second debugging mode is configured with the editor.
[0023] In a second aspect, the present disclosure provides a program debugging device, which is applied to a program debugging system, wherein the program debugging system includes at least two debugging modes, wherein the at least two debugging modes include a first debugging mode, wherein a front-end resource package and a public resource package of the first debugging mode are deployed in the program debugging system, and the first debugging mode is not configured with an editor;
[0024] The device comprises:
[0025] A starting module, configured to start a rendering process corresponding to the first debugging mode in response to a selection operation for the first debugging mode; wherein a view control of the debugger in the first debugging mode is mounted in the rendering process;
[0026] The first display module is used to load the front-end resource package of the first debugging mode and the public resource package in the rendering process to display the interactive interface of the first debugging mode and display the debugger on the interactive interface.
[0027] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the above method.
[0028] In a fourth aspect, the present disclosure provides a program debugging device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.
[0029] In a fifth aspect, the present disclosure provides a computer program product, wherein the computer program product comprises a computer program / instructions, and the computer program / instructions implement the above method when executed by a processor.
[0030] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has at least the following advantages:
[0031] The embodiment of the present disclosure provides a program debugging method, which is applied to a program debugging system, and the program debugging system has at least two debugging modes. The front-end resource package and the common resource package of the first debugging mode are deployed in the program debugging system, and the first debugging mode is not configured with an editor. Specifically, in response to the selection operation for the first debugging mode, the rendering process corresponding to the first debugging mode is started; the front-end resource package and the common resource package of the first debugging mode are loaded in the rendering process to display the interactive interface of the first debugging mode, and the debugger is displayed on the interactive interface. It can be seen that the embodiment of the present disclosure provides a program debugging method applied to a program debugging system including at least two debugging modes, and the editor is not configured in the first debugging mode to reduce the memory usage of the program debugging system when it runs in the first debugging mode. In addition, the embodiment of the present disclosure realizes the function of displaying the debugger after starting the first debugging mode by mounting the debugger on the rendering process, which ensures the normal operation of the debugger when the editor is not configured, and meets the use needs of the developer. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0034] Figure 1 A flowchart of a program debugging method provided by an embodiment of the present disclosure;
[0035] Figure 2 A schematic diagram of an underlying framework model of a first debugging mode in a program debugging system provided by an embodiment of the present disclosure;
[0036] Figure 3 A schematic diagram of an interactive interface of a first debugging mode provided by an embodiment of the present disclosure;
[0037] Figure 4 A schematic diagram of a simulator display interface provided by an embodiment of the present disclosure;
[0038] Figure 5 A schematic diagram of adjusting the display layout of a toolbar provided in an embodiment of the present disclosure;
[0039] Figure 6 A schematic diagram of the structure of a program debugging device provided by an embodiment of the present disclosure;
[0040] Figure 7 A schematic diagram of the structure of a program debugging device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0041] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0042] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0043] At present, with the continuous development of computer technology, there are more and more types of applications. Mini programs are a popular type of application. Developers can use mini program development tools to develop, debug, upload, etc. However, mini program development tools have the problem of excessive memory usage during operation.
[0044] To this end, the embodiment of the present disclosure provides a program debugging method, which is applied to a program debugging system, and the program debugging system has at least two debugging modes. The front-end resource package and the common resource package of the first debugging mode are deployed in the program debugging system, and the editor is not configured in the first debugging mode. Specifically, in response to the selection operation for the first debugging mode, the rendering process corresponding to the first debugging mode is started, and the front-end resource package and the common resource package of the first debugging mode are loaded in the rendering process to display the interactive interface of the first debugging mode, and the debugger is displayed on the interactive interface. It can be seen that the embodiment of the present disclosure provides a program debugging method applied to a program debugging system including at least two debugging modes, and the editor is not configured in the first debugging mode to reduce the memory usage of the program debugging system when it runs in the first debugging mode. In addition, the embodiment of the present disclosure realizes the function of displaying the debugger after starting the first debugging mode by mounting the debugger on the rendering process, thereby ensuring the normal operation of the debugger when the editor is not configured, and meeting the use needs of the developer.
[0045] Based on this, an embodiment of the present disclosure provides a program debugging method, which can be applied to a program debugging system. The program debugging system has at least two debugging modes.
[0046] Among them, program debugging refers to the process of testing the written program code manually or by compiling the program before putting it into actual operation to correct syntax errors and logical errors.
[0047] A program debugging system refers to a collection of unit modules that can integrate functions related to program debugging. For example, the program debugging system can be applied to small program development tools. Small program development tools include main functions such as editors, debuggers, simulators, real-machine debugging, and various auxiliary functions.
[0048] The program debugging system may include multiple debugging modes, wherein the first debugging mode refers to a program debugging mode without an editor configured. In addition, the multiple debugging modes of the program debugging system may be switched from one debugging mode to another through a mode switching control to meet the needs of different program debugging scenarios.
[0049] In addition, the present disclosure provides a method for debugging a program. Figure 1 , is a flowchart of a program debugging method provided by an embodiment of the present disclosure, the method specifically comprising:
[0050] S101: In response to a selection operation for a first debugging mode, starting a rendering process corresponding to the first debugging mode, wherein a view control of a debugger in the first debugging mode is mounted in the rendering process.
[0051] The program debugging method provided in the embodiment of the present disclosure can be applied to a program debugging system, wherein the program debugging system has at least two debugging modes, wherein at least two debugging modes include a first debugging mode, which is a debugging mode without a configuration editor, and at least two other debugging modes may also include a second debugging mode, which is a debugging mode with an editor configured. Developers can select the first debugging mode or the second debugging mode based on program debugging requirements.
[0052] The program debugging method provided by the embodiment of the present disclosure can be specifically run in the first debugging mode of the program debugging system.
[0053] Different debugging modes in the program debugging system correspond to different front-end resource packages. Specifically, the program debugging system is deployed with a front-end resource package of a first debugging mode and a public resource package, and the first debugging mode is not configured with an editor.
[0054] Among them, the front-end resource package refers to the use of front-end resource packaging tools to package the resources into resources that meet the deployment of the production environment according to the dependencies and rules of each module, that is, to integrate loose modules into resource packages that can be used in the production environment according to the dependencies and rules between modules.
[0055] In actual applications, in different product forms (modes) of the same application, because different product forms have different logics, if there is only one resource package, as the difference logic increases, the resource package will continue to grow, and the time to load the resource package will continue to grow, which will increase the cost of combing the code logic and reduce the R&D efficiency. In the disclosed embodiment, by packaging the resources corresponding to different product forms separately, the loading speed of the resource package can be increased, and the startup speed of the application in different product forms can be increased.
[0056] In actual applications, different product forms of the same application may also have some of the same processing logic. To increase code reuse, the common parts of different product forms can be packaged into a resource package for common use by different product forms.
[0057] In the disclosed embodiment, the first debugging mode and the second debugging mode are two different product forms in the program debugging system. Different front-end resources required in the first debugging mode and the second debugging mode are packaged and integrated into respective available front-end resource packages, and the common resource parts used in the first debugging mode and the second debugging mode are packaged into a public resource package. Among them, the front-end resource package can also be called a front-end resource product, and the public resource package can also be called a public resource product.
[0058] For example, assume that the underlying framework used by the program debugging system is the Electron framework (a desktop application framework), such as Figure 2 As shown, it is a schematic diagram of the underlying framework model of the first debugging mode in a program debugging system provided by the embodiment of the present disclosure. Specifically, it includes: a front-end resource package 201 corresponding to the first debugging mode, a common resource package 202, and a front-end resource package 203 corresponding to the second debugging mode. By using the main process and rendering process separation model provided by Electron, one main process can be used to start different rendering processes, and different front-end resource packages can be selected to load in the rendering process to achieve switching between different debugging modes.
[0059] In the process of packaging front-end resources in different debugging modes, three directories may be generated, two of which store resources related to the first debugging mode and the second debugging mode respectively, and the remaining one stores common resources, such as Figure 2 When the program debugging system switches to the first debugging mode, it only needs to close the second debugging mode and start the first debugging mode.
[0060] The disclosed embodiment packages resources corresponding to different debugging modes separately and packages common resources into one, thereby reducing loading time in different debugging modes and improving startup speed and code reuse rate of the debugging modes.
[0061] An optional implementation manner is to deploy a front-end resource package and a common resource package of a first debugging mode in a program debugging system, wherein the first debugging mode is not configured with an editor, and when a selection operation for the first debugging mode is received, a rendering process corresponding to the first debugging mode is started; wherein the view control of the debugger in the first debugging mode is mounted in the rendering process.
[0062] A rendering process is a process used to render an interactive interface. Different interactive interfaces may have different rendering processes.
[0063] The debugger is a module used to debug applications and display debugging information. In related technologies, the debugger is mounted on the editor node. However, the first debugging mode removes the editor. To this end, the embodiment of the present disclosure adjusts the mounting location of the debugger to the rendering process node to achieve the situation where the editor is not mounted in the first debugging mode, and the debugger is displayed normally on the interactive interface for debugging of the application.
[0064] In an embodiment of the present disclosure, a rendering process corresponding to the first debugging mode is used to render an interactive interface corresponding to the first debugging mode, wherein a view control of the debugger in the first debugging mode is mounted in the rendering process, and is used to render a visualization image of the debugger when rendering the interactive interface corresponding to the first debugging mode.
[0065] S102: Loading the front-end resource package of the first debugging mode and the public resource package in the rendering process to display an interactive interface of the first debugging mode, and displaying the debugger on the interactive interface.
[0066] The front-end resource package is a corresponding resource package in the first debugging mode, and the public resource package is a resource package shared by the first debugging mode and other debugging modes, for example, the public resource package is a resource package shared by the first debugging mode and the second debugging mode.
[0067] like Figure 3 As shown, it is a schematic diagram of an interactive interface of a first debugging mode provided by an embodiment of the present disclosure. By loading the rendering process corresponding to the first debugging mode, displaying the interactive interface of the first debugging mode and displaying the debugger on the interactive interface, such as Figure 3 As shown, the interactive page of the first debugging mode displays a simulator and a debugger, but does not display an editor.
[0068] The program debugging method provided by the embodiment of the present disclosure is applied to a program debugging system, which has at least two debugging modes, and the front-end resource package and the common resource package of the first debugging mode are deployed in the program debugging system, and the editor is not configured in the first debugging mode. Specifically, in response to the selection operation for the first debugging mode, the rendering process corresponding to the first debugging mode is started, and the front-end resource package and the common resource package of the first debugging mode are loaded in the rendering process to display the interactive interface of the first debugging mode, and the debugger is displayed on the interactive interface. It can be seen that the embodiment of the present disclosure provides a program debugging method applied to a program debugging system including at least two debugging modes, and the editor is not configured in the first debugging mode to reduce the memory usage of the program debugging system when it runs in the first debugging mode. In addition, the embodiment of the present disclosure realizes the function of displaying the debugger after starting the first debugging mode by mounting the debugger on the rendering process, thereby ensuring the normal operation of the debugger when the editor is not configured, and meeting the use needs of the developer.
[0069] In actual applications, in order to further reduce memory usage, a stop function can be set for the simulator in each debugging mode in the embodiment of the present disclosure. For example, a stop function can be set for the simulator displayed on the interactive interface of the first debugging mode. The stop control of the simulator can be triggered to release the corresponding resources of the simulator, thereby further reducing the memory usage of the program debugging system during operation.
[0070] Specifically, in response to the first trigger operation for stopping the control, the simulator is stopped, the simulator resources are released, and the simulator in the stopped state is displayed on the interactive interface of the first debugging mode.
[0071] For example, Figure 4 The figure is a schematic diagram of a simulator display interface provided by an embodiment of the present disclosure. The interface displays a stop operation control 401, which is triggered by Figure 4 If the 401 error appears on the simulator's running interface, the simulator will stop running and its resources will be released. Figure 4 aThe simulator running interface is displayed as Figure 4 bSimulator stops running interface.
[0072] In actual applications, in order to support the normal use of the simulator in the second debugging mode, the function of restarting the simulator can also be supported.
[0073] Specifically, in response to the second trigger operation for stopping the running control, the running of the simulator is restarted, and the running simulator is displayed on the interactive interface of the first debugging mode.
[0074] It should be noted that, in the embodiment of the present disclosure, stopping the simulator means releasing the simulator's resources, not hiding the simulator's display.
[0075] The disclosed embodiment provides a function of stopping the operation of the simulator, which can further reduce the memory usage during the operation of the program debugging system and improve the user experience.
[0076] Each debugging mode in the program debugging system can support the use of simulators to simulate debugging of applications. In order to achieve real debugging, it can also support real machine debugging function, that is, establish a connection relationship with the terminal device, so as to use the terminal device to debug the application.
[0077] In an optional implementation, in response to a real machine debugging triggering operation on the interactive interface of the first debugging mode, a real machine debugging page is displayed, and a link identifier is displayed on the real machine debugging page;
[0078] The link identifier is used to establish a connection relationship with the terminal device so as to use the terminal device for real machine debugging. Specifically, the link identifier can be a QR code, a website link, etc.
[0079] For example, the "real machine" control can be triggered in the toolbar on the interactive interface of the first debugging mode to display the real machine debugging page for displaying the real machine preview and debugging function controls related to the real machine debugging.
[0080] In the disclosed embodiment, a real machine debugging page is displayed in the first debugging mode, so that a link identifier (such as a QR code) used for real machine debugging is permanently displayed on the interactive interface, which facilitates users to view the debugging running status in real time and improves the user experience.
[0081] It should be noted that the real machine debugging page provided in the embodiment of the present disclosure can be displayed not only in the first debugging mode, but also in other debugging modes configured with an editor, and supports the real machine debugging QR code resident display function in each debugging mode.
[0082] In actual applications, since the first debugging mode does not have an editor configured, the width of the interactive interface of the first debugging mode is narrower than the width of the interactive interface of other debugging modes configured with an editor. In order to support the ability of the toolbar to adaptively adjust the display layout when adjusting the width of the interactive interface, the embodiment of the present disclosure adopts a method of folding the button display in the toolbar, and folds the buttons that cannot be displayed after adjusting the width in the same drop-down list control. The embodiment of the present disclosure does not limit the form of the control, for example, it can be a button, a text box, etc.
[0083] In an optional implementation, when a change in the width of the interactive interface in the first debugging mode is monitored, the current width value of the interactive interface in the first debugging mode is first acquired.
[0084] Then, based on the display width of each control in the toolbar on the interactive interface of the first debugging mode, the non-displayable controls corresponding to the current width value are determined, and the non-displayable controls are displayed in the toolbar in the form of a drop-down list.
[0085] like Figure 5As shown, it is a schematic diagram of a display layout adjustment of a toolbar provided by an embodiment of the present disclosure, and a total of 6 controls, namely "Control 1" to "Control 6", are displayed on the schematic diagram. When a change in the width of the toolbar is detected, the current width value of the interactive interface is obtained, and based on the display width of each control, the width of the space occupied by each control is cyclically superimposed from left to right. When it is found that the superimposed width value exceeds the current width value, the display style attribute of the currently superimposed control, such as "Control 4" and each subsequent control, is set to a hidden state, and the icons, titles, options and other data of these controls are extracted and put into an independent list, so as to realize the display of each control by using the list to render the controls in the drop-down menu, such as Figure 5 As shown in the figure, the drop-down menu in the form of a "More" button displays the hidden controls "Control 4", "Control 5" and "Control 6".
[0086] In addition, the above method can be applied to interactive interfaces in other debugging modes, that is, the interactive interfaces in each debugging mode can support the width adjustment function.
[0087] By folding the display mode of the controls, the ability of the toolbar display layout to adaptively change after the width of the interactive interface is adjusted is supported, and when the width of the interactive interface changes in the first debugging mode, the various controls in the toolbar can still be displayed, thereby improving the user experience.
[0088] In actual applications, the plug-in with the extended API call logic is the same plug-in as the plug-in that hosts the editor. Once the editor is removed from the first debugging mode, there is an API method call exception. Therefore, in the first debugging mode where the editor is not configured, in order to support normal operation of capabilities other than editing capabilities, the embodiment of the present disclosure injects a simulated application program interface API method in the first debugging mode based on the dependency injection method. Specifically:
[0089] In the process of loading the front-end resource package and the public resource package of the first debugging mode in the rendering process, based on the dependency injection method, the pre-simulated application program interface API method is injected in the first debugging mode. The simulated API method is used to support the calling logic for the plug-in extension API in the first debugging mode.
[0090] In the embodiment of the present disclosure, the simulation API method is a method that does not change the application logic and underlying code. This method simulates a copy of the API method to be called according to the dependency injection method at the original calling logic of the plug-in extension API, so as to ensure the normal operation of the calling logic for the plug-in extension API in the first debugging mode.
[0091] By adopting the dependency injection method, the program debugging system can be compatible with the calling logic of the plug-in extension API in the first debugging mode, thereby ensuring the normal operation of other capabilities in the first debugging mode of the program debugging system.
[0092] Based on the above method embodiment, the present disclosure also provides a program debugging device, which is applied to a program debugging system. The program debugging system includes at least two debugging modes, and the at least two debugging modes include a first debugging mode. The program debugging system is deployed with a front-end resource package and a public resource package of the first debugging mode, and the first debugging mode is not configured with an editor. Figure 6 , is a schematic diagram of the structure of a program debugging device provided by an embodiment of the present disclosure, the device comprising:
[0093] A starting module 601 is used to start a rendering process corresponding to the first debugging mode in response to a selection operation for the first debugging mode; wherein a view control of the debugger in the first debugging mode is mounted in the rendering process;
[0094] The first display module 602 is used to load the front-end resource package of the first debugging mode and the public resource package in the rendering process to display the interactive interface of the first debugging mode and display the debugger on the interactive interface.
[0095] In an optional implementation manner, the interactive interface of the first debugging mode further displays a simulator and a stop control for the simulator, and the device further includes:
[0096] A stop module, configured to stop the simulator and release resources of the simulator in response to a first trigger operation on the stop control;
[0097] And, a second display module is used to display the simulator in a stopped state on the interactive interface of the first debugging mode.
[0098] In an optional implementation, the device further includes:
[0099] A restart module is used to restart the operation of the simulator in response to a second trigger operation on the stop operation control.
[0100] In an optional implementation, the device further includes:
[0101] The third display module is used to display a real machine debugging page in response to a real machine debugging trigger operation acting on the interactive interface of the first debugging mode, and to display a link identifier on the real machine debugging page; wherein the link identifier is used to establish a connection relationship with a terminal device so as to use the terminal device to perform real machine debugging.
[0102] In an optional implementation, the device further includes:
[0103] an acquisition module, configured to acquire a current width value of the interaction interface in the first debugging mode when a change in the width of the interaction interface in the first debugging mode is detected;
[0104] A determination module, configured to determine, based on the display width of each control in the toolbar on the interactive interface of the first debugging mode, a non-displayable control corresponding to the current width value;
[0105] The third display module is used to display the non-displayable controls in the toolbar in the form of a drop-down list.
[0106] In an optional implementation, the device further includes:
[0107] In the process of loading the front-end resource package of the first debugging mode and the public resource package in the rendering process, based on the dependency injection method, a simulated application program interface API method is injected in the first debugging mode; wherein, the simulated API method is used to support the calling logic for the plug-in extension API in the first debugging mode.
[0108] In an optional implementation, the at least two debugging modes include a second debugging mode, a front-end resource package of the second debugging mode is also deployed in the program debugging system, and the second debugging mode is configured with the editor.
[0109] The program debugging method provided in the embodiment of the present disclosure is applied to a program debugging system, which has at least two debugging modes, and the front-end resource package and the common resource package of the first debugging mode are deployed in the program debugging system, and the editor is not configured in the first debugging mode. Specifically, in response to the selection operation for the first debugging mode, the rendering process corresponding to the first debugging mode is started, and the front-end resource package and the common resource package of the first debugging mode are loaded in the rendering process to display the interactive interface of the first debugging mode, and the debugger is displayed on the interactive interface. It can be seen that the embodiment of the present disclosure provides a program debugging method applied to a program debugging system including at least two debugging modes, and the editor is not configured in the first debugging mode to reduce the memory usage of the program debugging system when it runs in the first debugging mode. In addition, the embodiment of the present disclosure realizes the function of displaying the debugger after starting the first debugging mode by mounting the debugger on the rendering process, thereby ensuring the normal operation of the debugger when the editor is not configured, and meeting the use needs of the developer.
[0110] In addition to the above-mentioned method and apparatus, the embodiments of the present disclosure further provide a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device implements the program debugging method described in the embodiments of the present disclosure.
[0111] The embodiments of the present disclosure further provide a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the program debugging method described in the embodiments of the present disclosure is implemented.
[0112] In addition, the present disclosure also provides a program debugging device, see Figure 7 As shown, this may include:
[0113] Processor 701, memory 702, input device 703 and output device 704. The number of processors 701 in the program debugging device can be one or more. Figure 7 In some embodiments of the present disclosure, the processor 701, the memory 702, the input device 703 and the output device 704 may be connected via a bus or other means, wherein: Figure 7 The example of connecting through bus is taken in the following.
[0114] The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing of the program debugging device by running the software programs and modules stored in the memory 702. The memory 702 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc. In addition, the memory 702 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. The input device 703 can be used to receive input digital or character information, and generate signal input related to user settings and function control of the program debugging device.
[0115] Specifically in this embodiment, the processor 701 will load the executable files corresponding to the processes of one or more applications into the memory 702 according to the following instructions, and the processor 701 will run the applications stored in the memory 702, thereby realizing the various functions of the above-mentioned program debugging device.
[0116] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0117] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A program debugging method, characterized in that: Applied to a program debugging system, the program debugging system includes at least two debugging modes, the at least two debugging modes include a first debugging mode, a front-end resource package and a public resource package of the first debugging mode are deployed in the program debugging system, and the first debugging mode is not configured with an editor; The method comprises: In response to a selection operation for the first debugging mode, starting a rendering process corresponding to the first debugging mode; wherein a view control of the debugger in the first debugging mode is mounted in the rendering process; The front-end resource package of the first debugging mode and the public resource package are loaded in the rendering process to display an interactive interface of the first debugging mode, and the debugger is displayed on the interactive interface.
2. The method according to claim 1, characterized in that The interactive interface of the first debugging mode also displays a simulator and a stop control for the simulator. The method further includes: In response to a first trigger operation on the stop control, stop the simulator and release resources of the simulator; And, the simulator in the stopped state is displayed on the interactive interface of the first debugging mode.
3. The method according to claim 2, characterized in that The method further comprises: In response to a second trigger operation on the stop operation control, the operation of the simulator is restarted.
4. The method according to claim 1, characterized in that: The method further comprises: In response to a real machine debugging trigger operation on the interactive interface of the first debugging mode, a real machine debugging page is displayed, and a link identifier is displayed on the real machine debugging page; wherein the link identifier is used to establish a connection relationship with a terminal device to perform real machine debugging using the terminal device.
5. The method according to claim 1, characterized in that The method further comprises: When a change in the width of the interactive interface of the first debugging mode is monitored, obtaining a current width value of the interactive interface of the first debugging mode; Determine, based on the display width of each control in the toolbar on the interactive interface of the first debugging mode, a non-displayable control corresponding to the current width value; The non-displayable controls are displayed in the toolbar in the form of a drop-down list.
6. The method according to claim 1, characterized in that The method further comprises: In the process of loading the front-end resource package of the first debugging mode and the public resource package in the rendering process, based on the dependency injection method, a simulated application program interface API method is injected in the first debugging mode; wherein, the simulated API method is used to support the calling logic for the plug-in extension API in the first debugging mode.
7. The method according to claim 1, characterized in that The at least two debugging modes include a second debugging mode, a front-end resource package of the second debugging mode is also deployed in the program debugging system, and the second debugging mode is configured with the editor.
8. A program debugging device, characterized in that: Applied to a program debugging system, the program debugging system includes at least two debugging modes, the at least two debugging modes include a first debugging mode, a front-end resource package and a public resource package of the first debugging mode are deployed in the program debugging system, and the first debugging mode is not configured with an editor; The device comprises: A starting module, configured to start a rendering process corresponding to the first debugging mode in response to a selection operation for the first debugging mode; wherein a view control of the debugger in the first debugging mode is mounted in the rendering process; The first display module is used to load the front-end resource package of the first debugging mode and the public resource package in the rendering process to display the interactive interface of the first debugging mode and display the debugger on the interactive interface.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 7.
10. A program debugging device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.