CN114490338A - Multithreading debugging method, device, equipment and storage medium - Google Patents

Multithreading debugging method, device, equipment and storage medium Download PDF

Info

Publication number
CN114490338A
CN114490338A CN202111656912.0A CN202111656912A CN114490338A CN 114490338 A CN114490338 A CN 114490338A CN 202111656912 A CN202111656912 A CN 202111656912A CN 114490338 A CN114490338 A CN 114490338A
Authority
CN
China
Prior art keywords
debugging
data
breakpoint
displaying
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111656912.0A
Other languages
Chinese (zh)
Inventor
杨庆华
朱云峰
石金博
王红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
QKM Technology Dongguan Co Ltd
Original Assignee
QKM Technology Dongguan Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by QKM Technology Dongguan Co Ltd filed Critical QKM Technology Dongguan Co Ltd
Priority to CN202111656912.0A priority Critical patent/CN114490338A/en
Publication of CN114490338A publication Critical patent/CN114490338A/en
Priority to PCT/CN2022/143240 priority patent/WO2023125768A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1602Programme controls characterised by the control system, structure, architecture
    • B25J9/161Hardware, e.g. neural networks, fuzzy logic, interfaces, processor
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1656Programme controls characterised by programming, planning systems for manipulators
    • B25J9/1661Programme controls characterised by programming, planning systems for manipulators characterised by task planning, object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Robotics (AREA)
  • Mechanical Engineering (AREA)
  • Computer Hardware Design (AREA)
  • Artificial Intelligence (AREA)
  • Quality & Reliability (AREA)
  • Evolutionary Computation (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a multithreading debugging method, a device, equipment and a storage medium, wherein the multithreading debugging method comprises the following steps: code data input by a user are obtained, and multithreading debugging data are generated according to the code data; generating a corresponding debugging instruction according to the multithread debugging data, and sending the debugging instruction to the control equipment; when a debugging result fed back by the control equipment based on the debugging instruction is received, displaying the debugging result; the invention can ensure the processing progress of control equipment such as a robot by debugging under multiple threads, thereby improving the execution efficiency.

Description

Multithreading debugging method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to, but not limited to, the technical field of computers, and in particular relates to a multithreading debugging method, device, equipment and storage medium.
Background
At present, the debugging problem of a control device, such as a robot, is always an essential core link in robot development, production, bug correction and later maintenance. However, an effective means for debugging control equipment such as a robot is still lacked, so that the overall progress is directly influenced, and the efficiency is low.
Disclosure of Invention
The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
The embodiment of the invention provides a multithreading debugging method, a multithreading debugging device, equipment and a storage medium, wherein the multithreading debugging can ensure the processing progress of control equipment such as a robot, and further the execution efficiency is improved.
In a first aspect, an embodiment of the present invention provides a multithread debugging method, which is applied to a compiler, where the compiler communicates with a control device, and the method includes:
code data input by a user are obtained, and multithreading debugging data are generated according to the code data;
generating a corresponding debugging instruction according to the multithread debugging data, and sending the debugging instruction to the control equipment;
and when a debugging result fed back by the control equipment based on the debugging instruction is received, displaying the debugging result.
In a second aspect, an embodiment of the present invention further provides a multithread debugging apparatus, including:
the system comprises an acquisition module, a data processing module and a data processing module, wherein the acquisition module is used for acquiring code data input by a user and generating multithreading debugging data according to the code data;
the sending module is used for generating a corresponding debugging instruction according to the multithread debugging data and sending the debugging instruction to the control equipment;
and the display module is used for displaying the debugging result when the debugging result fed back by the control equipment based on the debugging instruction is received.
In a third aspect, an embodiment of the present invention further provides a multithreading debugging device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor executing the computer program as a multi-threaded debugging method according to any one of the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions, where the computer-executable instructions are configured to execute the multithread debugging method according to any one of the first aspect.
According to the above-mentioned embodiments of the application, at least the following beneficial effects are achieved: the method comprises the steps of obtaining code data input by a user, generating multi-thread debugging data according to the code data, generating corresponding debugging instructions according to the multi-thread debugging data, sending the debugging instructions to control equipment, displaying the debugging results when the debugging results fed back by the control equipment based on the debugging instructions are received, and further realizing communication between the user and a compiler and communication between the compiler and the control equipment under multi-thread.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the claimed subject matter and are incorporated in and constitute a part of this specification, illustrate embodiments of the subject matter and together with the description serve to explain the principles of the subject matter and not to limit the subject matter.
FIG. 1 is a flowchart illustrating a multithread debugging method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a thread state display according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a thread state corresponding to a color marker according to an embodiment of the present invention;
FIG. 4 is a schematic interface diagram of a thread state corresponding to a color marker according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating an embodiment of updating variable data;
FIG. 6 is a flowchart illustrating a process of periodically polling variable data according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an interface for periodically polling variable data according to an embodiment of the present invention;
FIG. 8 is a flow chart illustrating variable data display according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of an interface for displaying variable data according to an embodiment of the present invention;
FIG. 10 is a flow chart illustrating variable data display according to another embodiment of the present invention;
FIG. 11 is a flow chart illustrating variable data display according to another embodiment of the present invention;
FIG. 12 is a flow chart illustrating breakpoint data according to an embodiment of the present invention;
FIG. 13 is an interface diagram of breakpoint data according to an embodiment of the present invention;
FIG. 14 is a schematic interface diagram of breakpoint data according to another embodiment of the present invention;
FIG. 15 is a flowchart illustrating a first breakpoint data according to an embodiment of the invention;
FIG. 16 is a flowchart illustrating a task thread list according to an embodiment of the invention;
FIG. 17 is a flowchart illustrating an embodiment of updating breakpoint locations;
FIG. 18 is a flowchart illustrating clearing first breakpoint data according to an embodiment of the invention;
FIG. 19 is an interface diagram illustrating multi-threaded operation according to an embodiment of the invention;
FIG. 20 is a block diagram of a multi-thread debugging apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It is noted that while functional block divisions are provided in device diagrams and logical sequences are shown in flowcharts, in some cases, steps shown or described may be performed in sequences other than block divisions within devices or flowcharts. The terms first, second and the like in the description and in the claims, and the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
At present, the debugging problem of a control device, such as a robot, is always an essential core link in robot development, production, bug correction and later maintenance. However, an effective means for debugging control equipment such as a robot is still lacked, so that the overall progress is directly influenced, and the efficiency is low.
Based on this, embodiments of the present invention provide a multithreading debugging method, apparatus, device and storage medium, where debugging under multithreading can ensure the processing progress of a control device, such as a robot, and further improve execution efficiency.
The method of the embodiments of the present application will be further explained with reference to the drawings.
Referring to fig. 1, in a first aspect, an embodiment of the present invention provides a multithread debugging method applied to a compiler, the compiler communicating with a control device, where the method includes:
s100, code data input by a user are obtained, and multithreading debugging data are generated according to the code data;
step S200, generating a corresponding debugging instruction according to the multithreading debugging data, and sending the debugging instruction to the control equipment;
and step S300, when a debugging result fed back by the control equipment based on the debugging instruction is received, displaying the debugging result.
It should be noted that, in the process of application development of a control device such as a robot, in order to implement application requirements of multitask parallel operation and debugging, for example, simultaneously operating the control device such as robot motion, controlling PLC, industrial camera vision processing, and the like, it is necessary to provide debugging interactive operation of multiple threads of the LUA of a user.
According to the embodiment of the invention, code data input by a user are obtained, multithreading debugging data are generated according to the code data, corresponding debugging instructions are generated according to the multithreading debugging data, the debugging instructions are sent to the control equipment, when the debugging results fed back by the control equipment based on the debugging instructions are received, the debugging results are displayed, and further, communication between the user and a compiler and communication between the compiler and the control equipment are realized under multithreading, the control equipment can be debugged based on the debugging instructions, the processing progress of the control equipment such as a robot can be ensured, and the execution efficiency of threads is further improved.
Referring to FIG. 2, it will be appreciated that after generating multi-threaded debug data from code data, the method further comprises:
and step S110, displaying the thread state of multiple threads corresponding to the multi-thread debugging data.
In order to realize the visualization of the thread state of the multiple threads, a user can conveniently obtain the compiling state of the compiler, and then the thread state of the multiple threads corresponding to the debugging data of the multiple threads can be displayed after the debugging data of the multiple threads is generated according to the code data. For example, the thread states of multiple threads corresponding to the multi-thread debugging data are displayed by setting a display device.
Referring to fig. 3, it can be understood that, in step S110, displaying the thread states of multiple threads corresponding to the multi-thread debugging data includes:
and step S111, marking the corresponding thread states with different colors, wherein the colors correspond to the thread states one by one.
In order to mark different thread states, the corresponding thread states are displayed in different colors. For example, according to the thread priority, the urgency degree, the running state and the like, different colors are set for marking so as to be distinguished, and the debugging convenience is improved while the visualization effect is improved.
In some embodiments, thread states of multiple threads corresponding to the multi-threaded debug data may be displayed in the form of a list.
Specifically, the corresponding different thread states may also be color-labeled, for example: the thread state during initialization (initialization), the thread state after initialization (Initialized), the thread state during Running (Running), the thread state during Pausing (using), the thread state during Pausing (used), the thread state during Pausing (Paused), the thread state during Stopping (Stopping), the thread state during Stopping (Stopped), the thread state during exiting (exiting), and the thread state after exiting (exited).
For example, as shown in fig. 4, the thread states of multiple threads corresponding to the multi-thread debugging data are shown, for example, the thread state of the last line shows that MyThreadFun-Stopped corresponds to a Stopped thread state.
When the method is applied, for example, in a debugging operation bar, the suspended thread state/stopped thread state can be marked by yellow, and the running thread state can be marked by green, so that a user can know the thread state condition of multiple threads conveniently and quickly.
Referring to fig. 5, it can be understood that after step S300, that is, after the debugging result fed back by the control device based on the debugging instruction is received and the debugging result is displayed, the method further includes:
s400, acquiring variable data input by a user;
and S500, updating variable data according to the debugging result.
It can be understood that the variable data input by the user is obtained, so that the variable data can be updated according to the debugging result. Specifically, the variable data includes local variable data that is valid within the defined function and global variable data that is valid from where the definition is made to where the thread ends. The global variable data is distributed on the stack through a compiler, and the local variable data is created on the stack in runtime.
For a compiler, information is stored by inputting variable data in the compiler according to a user. For example by assigning values to the variable data to link the variable data with some names that can be described, i.e. by defining the variable data to names such that the names have different meanings. In some embodiments, variable data allocates storage space for names. For variable data, the size of the variable data may be determined by a compiler to open up space in memory to hold the variable data. According to the debugging result, the variable data is updated so that the calculation result can be stored in the compiler or the name can be expressed.
It is understood that the types of global variable data include: boolean (GBool), integer (gitt), double precision (GDouble), string (GString). The set global variable data can provide a scheduling channel for multi-thread interactive transmission data, and communication among multiple threads is realized.
Referring to fig. 6, it can be understood that after step S400, i.e., after acquiring the variable data input by the user, the method further includes:
step S410, adding variable data to a variable query list;
and step S420, periodically polling variable data according to the variable query list.
It should be noted that, in the variable data input by the user, that is, the variable data defined in the user engineering may be subjected to query operation, specifically, after the variable data is added to the variable query list, the variable data may be periodically polled according to the variable query list, so that in the process of program debugging by the control device, such as a robot, according to the debugging instruction, the variable data may be periodically polled according to the variable query list by adding the variable data to the variable query list.
For example, as shown in fig. 7, variable data may be periodically polled through a variable query list.
Referring to fig. 8, further, after step S400, i.e., after acquiring the variable data input by the user, the method further includes:
step S430, acquiring a trigger hovering position;
and step S440, displaying variable data according to the trigger hovering position.
It should be noted that, the variable data may be queried and displayed by triggering a hovering manner. Specifically, the variable data is stayed at the position of the variable data in the code data through a mouse or touch mode, so that the variable data is automatically inquired.
For example, as shown in FIG. 9, the variable data, specifically the variable name, the associated thread, and the current value, are displayed by triggering the hover position. 5. 6, 7, and 8 indicate line number data.
Referring to fig. 10, it can be appreciated that, in step S440, variable data is displayed according to the triggered hovering position, including:
step S441, obtaining a trigger hovering time corresponding to the trigger hovering position;
and step S442, when the trigger hovering time is greater than or equal to the preset time, displaying variable data according to the trigger hovering position.
In order to prevent false touch, in the embodiment of the invention, the trigger hovering time corresponding to the trigger hovering position is acquired first, and when the trigger hovering time is greater than or equal to the preset time, variable data is displayed according to the trigger hovering position. For example, the preset time may be set to 1s or 3s, and the preset time may be set according to actual situations, and this is not particularly limited in the embodiment of the present invention.
Referring to fig. 11, it can be understood that, in step S440, variable data is displayed according to the triggered hovering position, including:
step S443, outputting a selection execution instruction to the user according to the triggered hovering position response;
and step 444, when a trigger execution instruction fed back by the user based on the selection execution instruction is received, displaying variable data according to the trigger execution instruction.
The embodiment of the invention can also realize the interaction between the user and the compiler, specifically, the selection execution instruction comprises a trigger execution instruction and a rejection execution instruction, when the trigger execution instruction fed back by the user based on the selection execution instruction is received, the variable data is displayed according to the trigger execution instruction, and when the rejection execution instruction fed back by the user based on the selection execution instruction is received, the variable data is rejected and displayed according to the rejection execution instruction. The embodiment of the invention can realize the control of variable data display according to the user operation.
Referring to fig. 12, it can be understood that the method of the embodiment of the present invention further includes:
s600, acquiring and displaying breakpoint data input by a user;
the broken point data is displayed by a preset mark, or the broken point data is displayed by a list in a gathering way.
In particular, the embodiment of the present invention may set various ways to display breakpoint data. For example, the breakpoint data is displayed with a preset mark, that is, whether breakpoint data is set in a current code line is identified by a red dot in a left edge column of the code text box, it is understood that the red dot is only one embodiment, and in other embodiments, other manners, such as a square frame, a triangle, and the like, may also be set to identify the breakpoint data, so that the breakpoint data is displayed with the preset mark, which is not limited specifically. In addition, breakpoint data may also be displayed in summary by a list.
For example, as shown in FIG. 13, the dots on the left identify that the current code line is set with breakpoint data. That is, when the line number data is 9, breakpoint data is set.
For example, as shown in fig. 14, the broken point data is collectively displayed by a list.
Referring to fig. 15, it can be understood that, in step S600, acquiring and displaying the breakpoint data input by the user includes:
step S610, determining a plurality of first task threads and starting a first hook function corresponding to the first task threads;
step S620, a plurality of first breakpoint data applied to the corresponding first task thread are set in the first hook function;
and step S630, displaying the first breakpoint data.
It can be understood that the specific process of obtaining breakpoint data in the embodiment of the present invention is as follows: the method comprises the steps of firstly determining a plurality of first task threads, starting a first hook function corresponding to the first task threads, and then setting a plurality of first breakpoint data applied to the corresponding first task threads in the first hook function, so as to display the first breakpoint data.
It can be understood that the Lua is embedded in C/C + +, and the debugging function is realized by calling a Hook function (i.e. Hook function) of the Lua by directly calling an interface in C + +.
For a plurality of first task threads, for example, adding a plurality of first breakpoint data, since each task thread may reach the first breakpoint data, after the first breakpoint data exists, it is ensured that the first hook function is injected/set in the virtual machine/the compiler.
Referring to fig. 16, it can be understood that, in step S610, before determining a number of first task threads and starting a first hook function corresponding to the first task threads, the method includes:
step S601, acquiring a plurality of created first task threads;
step S602, creating and storing a task thread list according to the plurality of first task threads.
It can be understood that, before determining a plurality of first task threads and starting the first hook function corresponding to the first task threads, the embodiments of the present invention need to create a plurality of first task threads first, so as to create and save a task thread list according to the acquired created plurality of first task threads, thereby facilitating storage and recording of the first task threads and improving reliability.
It is understood that the first hook function is implemented by the Lua language.
It is understood that the embodiment of the present invention may implement the setting of the first hook function of the plurality of first task threads through the Lanes library.
In the related technology, the Lua native language does not support multithreading in the true sense, although the coroutine carried by the Lua can simulate multithreading operation, the coroutine is defective and cannot realize a multitask parallel application scene, so the embodiment of the invention supports multithreading debugging of the Lua, and the requirement of a user for developing and debugging multitask application can be met through the multithreading debugging.
Referring to fig. 17, in some embodiments, after step S630, that is, after displaying the first breakpoint data, the method further includes:
step S631, obtaining line number data corresponding to the adjusted code data;
and step S632, updating the breakpoint position corresponding to the first breakpoint data according to the line number data.
It can be understood that, after the first breakpoint data is displayed, the line number in the code data may also be adjusted, specifically, the line number data corresponding to the adjusted code data is obtained, and then the breakpoint position corresponding to the first breakpoint data is updated according to the line number data. The embodiment of the invention is different from the breakpoint operation of the Lua IDE on the Internet, and the embodiment of the invention supports the change of line number data edited in user code data. After the line number data corresponding to the code data is adjusted, the breakpoint position corresponding to the set first breakpoint data automatically adapts to the change of the line number data, and the intellectualization is effectively improved.
Referring to fig. 18, in some embodiments, after step S630, that is, after displaying the first breakpoint data, the method further includes:
step S633, acquiring a breakpoint removing instruction;
step S634, clearing the first breakpoint data according to the breakpoint clearing instruction.
It can be understood that the embodiment of the present invention can also clear the first breakpoint data according to a requirement, specifically, clear the first breakpoint data by obtaining a breakpoint clearing instruction and then clearing the first breakpoint data according to the breakpoint clearing instruction.
The clearing of the breakpoint of the embodiment of the invention not only supports the operation aiming at the current file, but also supports the operation aiming at the file of the whole project, and simultaneously can prompt the user to confirm the clearing operation.
It is to be understood that clearing the first breakpoint data according to the breakpoint clearing instruction includes: and closing the first hook function of the first task thread according to the breakpoint clearing instruction, wherein the first breakpoint of the first hook function is null.
It is understood that the embodiment of the present invention closes the first hook function of the first task thread according to the breakpoint clearing instruction, and specifically, the first breakpoint data of the first hook function is null, which indicates that the first breakpoint data is cleared.
Referring to fig. 19, it can be understood that, in engineering, a user can know the operation condition of multiple threads by outputting monitoring windows to look at the real-time operation interaction information of multiple threads.
Referring to fig. 20, in a second aspect, an embodiment of the present invention further provides a multithreading debugging apparatus, including:
an obtaining module 100, configured to obtain code data input by a user, and generate multithread debugging data according to the code data;
the sending module 200 is configured to generate a corresponding debugging instruction according to the multithread debugging data, and send the debugging instruction to the control device;
and the display module 300 is configured to display the debugging result when receiving the debugging result fed back by the control device based on the debugging instruction.
It should be noted that the contents of the method embodiment of the present invention are all applicable to the apparatus embodiment, the functions specifically implemented by the apparatus embodiment are the same as those of the method embodiment, and the beneficial effects achieved by the apparatus embodiment are also the same as those achieved by the method, which is not described herein again.
In addition, an embodiment of the present invention further provides a multithread debugging apparatus, including: a memory, a processor, and a computer program stored on the memory and executable on the processor.
The processor and memory may be connected by a bus or other means.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
It should be noted that the multi-thread debugging apparatus in this embodiment may be applied to the multi-thread debugging method in the foregoing embodiment, and the multi-thread debugging apparatus in this embodiment and the multi-thread debugging method in the foregoing embodiment have the same inventive concept, so that these embodiments have the same implementation principle and technical effect, and are not described in detail here.
Non-transitory software programs and instructions required to implement the multi-thread debugging method of the above-described embodiment are stored in the memory, and when executed by the processor, perform the multi-thread debugging method of the above-described embodiment, for example, perform the above-described method steps S100 to S300 in fig. 1, the method step S110 in fig. 2, the method step S111 in fig. 3, the method steps S400 to S500 in fig. 5, the method steps S410 to S420 in fig. 6, the method steps S430 to S440 in fig. 8, the method steps S441 to S442 in fig. 10, the method steps S443 to S444 in fig. 11, the method step S600 in fig. 12, the method steps S610 to S630 in fig. 15, the method steps S601 to S602 in fig. 16, the method steps S631 to S632 in fig. 17, and the method steps S633 to S634 in fig. 18.
The above described embodiments of the multi-threaded debugging device are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, which are executed by a processor or a controller, for example, by a processor in the above-mentioned multi-thread debugging device embodiment, and can make the above-mentioned processor execute the multi-thread debugging method in the above-mentioned embodiment, for example, execute the above-mentioned method steps S100 to S300 in fig. 1, the method step S110 in fig. 2, the method step S111 in fig. 3, the method steps S400 to S500 in fig. 5, the method steps S410 to S420 in fig. 6, the method steps S430 to S440 in fig. 8, the method steps S441 to S442 in fig. 10, the method steps S443 to S444 in fig. 11, the method step S600 in fig. 12, the method steps S610 to S630 in fig. 15, the method steps S601 to S602 in fig. 16, the method steps S110 to S442 in fig. 15, Method steps S631 to S632 in fig. 17, method steps S633 to S634 in fig. 18.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
While the preferred embodiments of the present invention have been described in detail, it will be understood by those skilled in the art that the foregoing and various other changes, omissions and deviations in the form and detail thereof may be made without departing from the scope of this invention.

Claims (19)

1. A multi-threaded debugging method applied to a compiler, the compiler communicating with a control device, the method comprising:
code data input by a user are obtained, and multithreading debugging data are generated according to the code data;
generating a corresponding debugging instruction according to the multithread debugging data, and sending the debugging instruction to the control equipment;
and when a debugging result fed back by the control equipment based on the debugging instruction is received, displaying the debugging result.
2. The method of claim 1,
after the generating multithreaded debug data from the code data, the method further comprises:
and displaying the thread state of multiple threads corresponding to the multi-thread debugging data.
3. The method of claim 2,
the displaying the thread state of multiple threads corresponding to the multi-thread debugging data comprises:
marking the corresponding thread states with different colors, wherein the colors correspond to the thread states one to one.
4. The method of claim 1,
after the debugging result fed back by the control device based on the debugging instruction is received and displayed, the method further comprises the following steps:
acquiring variable data input by a user;
and updating the variable data according to the debugging result.
5. The method of claim 4,
after the obtaining variable data input by the user, the method further comprises:
adding the variable data to a variable query list;
and polling the variable data periodically according to the variable query list.
6. The method of claim 4,
after the obtaining variable data input by the user, the method further comprises:
acquiring a trigger hovering position;
and displaying the variable data according to the trigger hovering position.
7. The method of claim 6,
the displaying the variable data according to the triggered hovering position includes:
acquiring trigger hovering time corresponding to the trigger hovering position;
and when the trigger hovering time is greater than or equal to the preset time, displaying the variable data according to the trigger hovering position.
8. The method of claim 6,
the displaying the variable data according to the triggered hovering position includes:
outputting a selection execution instruction to a user according to the trigger hovering position response;
and when a trigger execution instruction fed back by the user based on the selection execution instruction is received, displaying the variable data according to the trigger execution instruction.
9. The method according to any one of claims 1 to 8, further comprising:
acquiring and displaying breakpoint data input by a user;
wherein the breakpoint data is displayed with a preset mark, or,
and the breakpoint data is summarized and displayed through a list.
10. The method of claim 9, wherein the obtaining and displaying the breakpoint data input by the user comprises:
determining a plurality of first task threads and starting a first hook function corresponding to the first task threads;
setting a plurality of first breakpoint data applied to the corresponding first task thread in the first hook function;
and displaying the first breakpoint data.
11. The method according to claim 10, wherein prior to said determining a number of first task threads and initiating a first hook function corresponding to the first task threads, comprising:
acquiring a plurality of created first task threads;
and creating and storing a task thread list according to the plurality of first task threads.
12. The method of claim 10,
the first hook function is implemented by the Lua language.
13. The method of claim 12,
and realizing the setting of the first hook functions of the plurality of first task threads through a Lanes library.
14. The method of claim 10,
after the displaying the first breakpoint data, further comprising:
acquiring line number data corresponding to the adjusted code data;
and updating the breakpoint position corresponding to the first breakpoint data according to the line number data.
15. The method of claim 10,
after the displaying the first breakpoint data, further comprising:
acquiring a breakpoint clearing instruction;
and clearing the first breakpoint data according to the breakpoint clearing instruction.
16. The method of claim 15,
the clearing the first breakpoint data according to the breakpoint clearing instruction includes:
and closing the first hook function of the first task thread according to the breakpoint clearing instruction, wherein the first breakpoint of the first hook function is null.
17. A multi-threaded debugging apparatus, comprising:
the system comprises an acquisition module, a data processing module and a data processing module, wherein the acquisition module is used for acquiring code data input by a user and generating multithreading debugging data according to the code data;
the sending module is used for generating a corresponding debugging instruction according to the multithread debugging data and sending the debugging instruction to the control equipment;
and the display module is used for displaying the debugging result when the debugging result fed back by the control equipment based on the debugging instruction is received.
18. A multi-threaded debugging device, comprising:
memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program as a multi-threaded debugging method according to one of claims 1 to 16.
19. A computer-readable storage medium having stored thereon computer-executable instructions for performing at least the multi-threaded debugging method of any of claims 1-16.
CN202111656912.0A 2021-12-30 2021-12-30 Multithreading debugging method, device, equipment and storage medium Pending CN114490338A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111656912.0A CN114490338A (en) 2021-12-30 2021-12-30 Multithreading debugging method, device, equipment and storage medium
PCT/CN2022/143240 WO2023125768A1 (en) 2021-12-30 2022-12-29 Device debugging method, device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111656912.0A CN114490338A (en) 2021-12-30 2021-12-30 Multithreading debugging method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114490338A true CN114490338A (en) 2022-05-13

Family

ID=81508496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111656912.0A Pending CN114490338A (en) 2021-12-30 2021-12-30 Multithreading debugging method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114490338A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023125768A1 (en) * 2021-12-30 2023-07-06 东莞市李群自动化技术有限公司 Device debugging method, device, and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023125768A1 (en) * 2021-12-30 2023-07-06 东莞市李群自动化技术有限公司 Device debugging method, device, and storage medium

Similar Documents

Publication Publication Date Title
US8136097B2 (en) Thread debugging device, thread debugging method and information storage medium
US11392461B2 (en) Method and apparatus for processing information
CN105468529B (en) A kind of accurate traversal method of Android application UI controls and device
EP3101547A1 (en) Control system, method, program and information processing device
CN109165055B (en) Unmanned system component loading method and device, computer equipment and medium
US20120278790A1 (en) Collaborative Software Debugging In A Distributed System With Real-Time Variable Modification Indicators
CN111198739B (en) Application view rendering method, device, equipment and storage medium
US20130326484A1 (en) Synchronization point visualization for modified program source code
US6978399B2 (en) Debug thread termination control points
US20150058828A1 (en) Plc simulation system, plc simulator, recording medium, and simulation method
US20140040868A1 (en) Automatic repair of scripts
US9380001B2 (en) Deploying and modifying a service-oriented architecture deployment environment model
CN114490338A (en) Multithreading debugging method, device, equipment and storage medium
US8701093B2 (en) Event management in a non-stop debugging environment
CN112988185A (en) Cloud application updating method, device and system, electronic equipment and storage medium
US7865883B1 (en) Parallel and asynchronous debugger and debugging method for multi-threaded programs
CN114489972A (en) Equipment debugging method, equipment and storage medium
US11789775B2 (en) Progress visualization of computational job
WO2014136228A1 (en) Programmable controller, programmable controller system, and execute error information creation method
EP2713277A1 (en) Latent defect identification
US20130074042A1 (en) Visualizing thread state during program debugging
CN108108895B (en) Method, system, equipment and storage medium for dynamically controlling task state
CN103632099A (en) Underived Native API function acquiring method and device
CN108614704B (en) Code compiling method and device
US20220107877A1 (en) Data logger for a real-time robotic control system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination