CN108829591B - Web-based collaborative debugging system and method - Google Patents

Web-based collaborative debugging system and method Download PDF

Info

Publication number
CN108829591B
CN108829591B CN201810552504.2A CN201810552504A CN108829591B CN 108829591 B CN108829591 B CN 108829591B CN 201810552504 A CN201810552504 A CN 201810552504A CN 108829591 B CN108829591 B CN 108829591B
Authority
CN
China
Prior art keywords
debugging
module
web
request
server
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.)
Active
Application number
CN201810552504.2A
Other languages
Chinese (zh)
Other versions
CN108829591A (en
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.)
Beijing Institute of Technology BIT
Original Assignee
Beijing Institute of Technology BIT
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 Beijing Institute of Technology BIT filed Critical Beijing Institute of Technology BIT
Priority to CN201810552504.2A priority Critical patent/CN108829591B/en
Publication of CN108829591A publication Critical patent/CN108829591A/en
Application granted granted Critical
Publication of CN108829591B publication Critical patent/CN108829591B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The invention relates to a Web-based collaborative debugging system and a Web-based collaborative debugging method, wherein a user can directly operate and debug a remote program on a browser interface, so that the system not only has a graphical interface with good support, but also can acquire debugging information in real time and finish debugging work in a more clear and intuitive mode; on the other hand, the cooperative debugging function enables a debugging user to set a local debugging environment without the need of setting the local debugging environment, and only needs to send a debugging request to the remote server, and once the debugging authority is obtained, the debugging can be carried out like the local, so that the debugging cost is greatly reduced, and the debugging efficiency is improved; meanwhile, the collaborative debugging system and method based on the Web can be expanded to other debugging applications except kernel-level debugging of an operating system, meet different debugging requirements, have the characteristics of strong expandability and wide application range, combine the advantages of Web technology and debugging technology, and provide a better solution for realizing cross-platform and visual debugging of the Web.

Description

Web-based collaborative debugging system and method
Technical Field
The invention relates to the technical field of internet, in particular to a collaborative debugging system and method based on Web.
Background
With the development of Web 2.0 technology, the realization of system-level applications based on Web technology has become the mainstream of modern technology. Application technologies in the C/S (client/server) mode have gradually shifted to low-cost, lightweight applications mainly in the B/S (browser/server) mode, and are widely used in various industries.
The J2EE technology is an enterprise-level Web application development solution based on Java, not only inherits many advantages of a Java platform, but also provides comprehensive support for EJB (Enterprise JavaBeans), Java Server APIs, JSP (Java Server pages) and XML technologies, and greatly simplifies enterprise-level application development. In addition, as an integrated development platform technology, the J2EE has the advantages of strong usability, high reliability, good expandability and the like.
Debugging is an essential link in modern software development, and special debugging tools such as the current popular debugging tool GDB are often needed for kernel-level debugging of an operating system, so that on one hand, developers need to configure a specific debugging environment, and the debugging cost is increased; on the other hand, debugging information is often difficult to directly understand, and debugging difficulty of common users is increased.
GDB/MI is a more important command interface provided by GDB besides CLI (Command Line interface) commands, and is usually used for building a debugging tool of a complex system, and exists as a debugging component in the complex system. For example, a GUI debug implemented in Insight with GDB as a debugging tool takes full advantage of GDB/MI. However, the output information format of the GDB/MI is complex and needs to be familiar with the format for proper understanding.
QEMU is an open source simulator widely used on GNU/Linux platform, and has the advantages of light weight, high speed, support of various platform architectures and the like. The QEMU supports two working modes, namely a user-level mode and a system-level mode, wherein the system-level working mode can enable an unmodified kernel or an unmodified operating system to run in a simulation environment, and a good platform is provided for system debugging and cross-platform application operation.
The existing debugging tools for operating system kernel-level applications generally do not have friendly GUI interfaces, and the debugging process is complex and requires high debugging cost.
Disclosure of Invention
In view of the above problems, the present invention provides a Web-based collaborative debugging system and method, which is based on mature Web development technology and platform, and can implement convenient, friendly and efficient system debugging.
In a first aspect, an embodiment of the present invention provides a collaborative debugging system based on a Web, including a graphical debugging platform based on a Web and a system debugging framework;
the Web-based graphical debugging platform comprises:
the Web client browser module is used for sending a debugging request to the HTTP server module and presenting debugging information returned by the GDB server debugging module to a user;
the HTTP server module is used for receiving the debugging request and returning the output result of the GDBWrapper message conversion module to the user client browser;
the GDBWrapper message conversion module is used for receiving the debugging request processed by the HTTP server module and sending the debugging request to the GDB server debugging module; receiving a debugging result sent by the GDB server debugging module, and returning the debugging result to the HTTP server module;
and the GDB server debugging module is used for debugging the target system and the application program corresponding to the debugging request and returning a debugging result to the GDBWrapper message conversion module.
The collaborative debugging framework comprises:
the cooperative debugging user management module is used for dividing all debugging users into a plurality of debugging groups for management, and creating a new debugging group for the users or adding the users into the existing debugging group according to the user request; each debugging group has a unique representation ID, and debugging information received by users in the same debugging group is the same;
the collaborative debugging authority management module is used for determining whether the user to be debugged of each debugging group has a unique Token; each debugging group Session maintains a unique Token, and when a user with the Token has authority to send a debugging command;
and the cooperative debugging message management module is used for adopting a unified management mechanism for the debugging requests and the debugging results, returning each debugging request and each debugging result to all debugging members of the corresponding debugging group, and ensuring the consistency of debugging information by adopting a database cache mechanism.
In one embodiment, the debug request includes one or more of the following commands:
pause, Run, Step single Step, Set Breakpoint break, delete Breakpoint Remove, Set Watchpoint, delete Watchpoint Remove, view specified Memory information Memory, view Register information Register, and exit Quit.
In one embodiment, the debug information includes one or more of the following:
the system comprises thread stack information during system operation, GDB debugging information returned by command execution, breakpoint list information, observation point list information, specified memory data information and register data information.
In an embodiment, the gdbwwrapper message conversion module is specifically configured to convert JSON-format data sent by the Web client browser module into a debugging command executable by the GDB server, and convert a debugging result returned by the GDB server debugging module into HTML-format data displayed by the Web client browser module.
In one embodiment, the JSON-format data debug command has a specific format:
[ GID ] [ COMMAND ] [ DEBUGGING EVENT ].
In one embodiment, the format of the debug result is:
[ GID ] [ COMMAND ] [ DEBUGGING EVENT ] [ THREAD STACK ] [ BREAK LIST ] [ MEMORY INFORMATION ] [ register information ].
In a second aspect, an embodiment of the present invention provides a collaborative debugging method based on a Web, where the method includes: the method comprises the steps of Web-based graphical debugging platform preprocessing operation, collaborative debugging preprocessing operation, breakpoint debugging operation and collaborative debugging operation;
the Web-based graphical debugging platform preprocessing operation comprises the following steps:
(11) the Web-based graphical debugging platform starts an HTTP server module according to a pre-configured debugging port and records a server address URL;
(12) the Web client browser module inputs a server address URL and sends an HTTP request to the HTTP server module;
(13) the GDBWrapper message conversion module and the GDB server debugging module carry out initialization operation;
the cooperative debugging preprocessing operation comprises the following steps:
(21) a debugging user logs in a debugging system through a corresponding authority;
(22) the collaborative debugging user management module creates a new debugging group for a user or adds the new debugging group into an existing debugging group according to a user request;
the breakpoint debugging operation comprises the following steps:
(31) the Web-based graphical debugging platform searches related functions or global variables according to a user request, and selects the related functions or global variables needing to set breakpoints in a Web client browser module;
(32) the Web client browser module sends a breakpoint setting request and sends the breakpoint setting request and a related function or a global variable to an HTTP server module;
(33) the HTTP server module sends the breakpoint request to a GDBWrapper message conversion module for message conversion, and sends the breakpoint setting request and a debugging request corresponding to a related function or a global variable to a GDB server debugging module to execute a debugging command;
(34) the GDB server debugging module returns the returned breakpoint list information, thread information and console information to the GDBWrapper message conversion module for message conversion, and returns the converted debugging result to the HTTP server module;
a co-debugging operation comprising the steps of:
(41) the cooperative debugging user management module creates a debugging example for a first debugging user, and the debugging example maintains debugging group information and a debugging Token;
(42) the debugging users newly added into the debugging group send out a Token acquisition request to the collaborative debugging authority management module; after the request is confirmed, obtaining a debugging authority;
(43) and the cooperative debugging message management module returns the same debugging information for all debugging members of the debugging group when the debugging information is returned every time.
In one embodiment, the gdbwwrapper message conversion module and the GDB server debugging module perform initialization operations, including the following steps:
(131) the GDB server debugging module is used for debugging an operating system or an application program by establishing TCP connection with the operating system or the application program operated in the QEMU;
(132) the GDBWrapper message conversion module establishes TCP connection with the GDB server debugging module for communication, and establishes connection communication with the HTTP server module through Web Socket.
In one embodiment, the step of sending the breakpoint setting request and the debugging request corresponding to the relevant function or the global variable to the GDB server debugging module and executing the debugging command includes the following steps:
(331) the HTTP server module analyzes the debugging request sent by the Web client browser module and executes corresponding operation, and the method mainly comprises the following steps:
(a) when the received debugging request is a Quit command, a command for interrupting the GDB server is sent out;
(b) when the received debugging request is Set/Remove Breakpoint or Set/Remove Watchpoint, sending a command for setting or deleting a Breakpoint/observation point to a GDB server debugging module;
(c) when the received debugging request is that the Memory checks the Memory information or the Register checks the Register information, a command for checking the relevant format of the Memory information or the Register information is sent to a debugging module of the GDB server;
(d) when the received debugging request is a Pause Pause or Run continuous execution command, sending an interrupt execution or continuous execution command to a GDB server debugging module;
(e) and when the received debugging request is a Step single-Step execution command, sending the single-Step debugging command to the GDB server debugging module, and performing single-Step execution by taking a function as a basic debugging unit.
(332) The HTTP server module sends the analyzed debugging request to the GDBWrapper message conversion module, the GDBWrapper message conversion module converts the debugging request into GDB/MI commands executable by the GDB server debugging module, receives a debugging result returned by the GDB server debugging module, converts the debugging result into a corresponding data format and returns the corresponding data format to the HTTP server module.
The technical scheme provided by the embodiment of the invention has the beneficial effects that at least:
according to the Web-based collaborative debugging system provided by the embodiment of the invention, a user can directly operate and debug the remote program on the browser interface, so that the Web-based collaborative debugging system not only has a graphical interface with good support, but also can acquire debugging information in real time and finish debugging work in a more clear and intuitive manner; on the other hand, the cooperative debugging function enables a debugging user to set a local debugging environment without the need of setting the local debugging environment, and only needs to send a debugging request to the remote server, and once the debugging authority is obtained, the debugging can be carried out like the local, so that the debugging cost is greatly reduced, and the debugging efficiency is improved; meanwhile, the collaborative debugging system and method based on the Web can be expanded to other debugging applications except kernel-level debugging of an operating system, meet different debugging requirements, have the characteristics of strong expandability and wide application range, combine the advantages of Web technology and debugging technology, and provide a better solution for realizing cross-platform and visual debugging of the Web.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by 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.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic block diagram of a Web-based collaborative debugging system according to an embodiment of the present invention;
fig. 2 is a schematic overall architecture diagram of a Web-based collaborative debugging system according to an embodiment of the present invention;
fig. 3 is a schematic view of a debugging interface of the Web-based collaborative debugging system according to the embodiment of the present invention;
fig. 4 is a flowchart of a collaborative debugging method based on Web according to an embodiment of the present invention;
fig. 5 is a flowchart of step S1 according to an embodiment of the present invention;
fig. 6 is a flowchart of step S13 according to an embodiment of the present invention;
fig. 7 is a flowchart of step S2 according to an embodiment of the present invention;
fig. 8 is a flowchart of step S3 according to an embodiment of the present invention;
fig. 9 is a flowchart of step S33 according to an embodiment of the present invention;
fig. 10 is a flowchart of step S4 according to an embodiment of the present invention;
fig. 11 is a flowchart of step S1 according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Referring to fig. 1, the Web-based collaborative debugging system provided by the embodiment of the present invention is based on a mature Web development technology and platform, and can implement convenient, friendly and efficient system debugging; the system comprises: a Web-based graphical debugging platform and a system debugging framework;
wherein:
the graphical debugging platform of the Web comprises:
the Web client browser module 11 can clearly show the system debugging function in a graphical interface form through HTML, CSS and Javascript technologies, and sends a debugging request to the HTTP server module to present debugging information returned by the GDB server debugging module to a user;
the HTTP server module 12 receives a Web client browser module 11, namely a user browser debugging request, and returns an output result of the GDBWrapper message conversion module to the user client browser;
the GDBWrapper message conversion module 13 is connected with the HTTP server module in a Web Socket form, simultaneously realizes that a Java-based GDB MI debugging interface is connected with the GDB server debugging module, sends the debugging request to the GDB server debugging module by receiving a user browser debugging request processed by the HTTP server module, and returns the debugging result of the GDB server to the HTTP server module;
and the GDB server debugging module 14 is connected to the QEMU simulator, the debugging target system and the application program through TCP, returns the debugging result information to the GDBWrapper message conversion module, and finally returns the debugging result information to the user browser through the HTTP server module.
The above-mentioned cooperative debugging framework includes:
the collaborative debugging user management module 21 manages all debugging users in groups, each debugging group has a unique representation ID, the debugging information received by the users of the same debugging group is the same, and the users can join a certain existing debugging group or create the debugging group by themselves;
the collaborative debugging authority management module 22 maintains a unique Token for each debugging group Session, only the user with Token can send a debugging command to the server, the user who wants to debug can send a Token request to the server, and once the Token is obtained, the user can send the debugging command to the server to debug;
the cooperative debugging message management module 23 uses a unified management mechanism for the debugging requests and the debugging result information, and each debugging request and the debugging result information are returned to all the debugging members of the debugging group, and the consistency of the debugging information is ensured by using a database cache mechanism.
In practical use, all modules and components in the Web-based collaborative debugging system are tightly combined and coordinated, wherein the graphical debugging platform and the collaborative debugging framework module are coordinated for use, the graphical debugging platform mainly completes tasks of preprocessing, debugging process control and the like of debugging work, and the system debugging module completes tasks of debugging user management, debugging permission coordination, debugging information return and the like in the debugging process, so that the whole debugging process is an organic unified whole.
In the embodiment, a user can directly operate the debugging remote program on the browser interface, so that the method has a graphical interface with good support, and can acquire debugging information in real time to finish debugging work in a clearer and more intuitive mode; on the other hand, the cooperative debugging function enables a debugging user to set a local debugging environment without the need of setting the local debugging environment, and only needs to send a debugging request to the remote server, and once the debugging authority is obtained, the debugging can be carried out like the local, so that the debugging cost is greatly reduced, and the debugging efficiency is improved; meanwhile, the collaborative debugging system and method based on the Web can be expanded to other debugging applications except kernel-level debugging of an operating system, meet different debugging requirements, have the characteristics of strong expandability and wide application range, combine the advantages of Web technology and debugging technology, and provide a better solution for realizing cross-platform and visual debugging of the Web.
Referring to fig. 2, a schematic diagram showing an overall architecture of a debugging platform of the Web-based collaborative debugging system is shown, in which a Linux kernel is taken as an example for explanation, and the Web-based graphical debugging platform includes:
the Web client browser displays a debugging function to a user through a graphical interface, and interacts with the HTTP server through a network to complete the debugging function;
the HTTP server is connected with the GDBWrapper through a Web Socket to send out a debugging command request and return debugging information to the client browser;
the GDBWrapper message conversion module acquires a debugging request of an HTTP server side through Web Socket connection on one hand, and returns a debugging result of the GDB server to the HTTP server on the other hand;
the GDB server is connected to the QEMU simulator through TCP on one hand to debug the Linux kernel, and on the other hand, the debugging information is returned to the GDBWrapper message conversion module;
which comprises 7 steps:
firstly, a user sends out a debugging command through a Web browser;
the HTTP server forwards the received debugging command to a computer where the GDB Wrapper is located;
the GDBWrapper converts the debugging command and sends the debugging command to the GDB server;
the GDB server communicates with the QEMU to carry out system debugging operation;
collecting debugging information output by QEMU by the GDB Wrapper;
sending the debugging return information to the HTTP server by the GDB Wrapper;
and the HTTP server returns the debugging return information to the client browser for display after performing visual processing on the debugging return information.
Referring to fig. 3, a schematic diagram of a debugging interface displayed by the Web client browser module 11 of the Web-based collaborative debugging system is shown.
The QEMU simulator and the Linux kernel are used as a debugging target platform and application, which are only selected examples of the invention, and the QEMU simulator can also support the debugging of the coincidence and application programs in other operating systems; the embodiment of the present invention is not limited thereto.
And the database server stores the debugging information collected by the HTTP server so as to analyze and playback trace later.
In one embodiment, the debug request may include one or more of the following commands:
pause, Run, Step single Step, Set Breakpoint break, delete Breakpoint Remove, Set Watchpoint, delete Watchpoint Remove, view specified Memory information Memory, view Register information Register, and exit Quit.
The debugging information may also include one or more of the following information:
the system comprises thread stack information during system operation, GDB debugging information returned by command execution, breakpoint list information, observation point list information, specified memory data information and register data information.
In an embodiment, the gdbwwrapper message conversion module 13 is specifically configured to convert JSON-format data sent by the Web client browser module 11 into a debugging command executable by the GDB server, and convert a debugging result returned by the GDB server debugging module 14 into HTML-format data displayed by the Web client browser module 11.
Wherein: the specific format of the debugging command of the JSON format data is as follows:
[ GID ] [ COMMAND ] [ DEBUGGING EVENT ].
The format of the debugging result is as follows:
[ GID ] [ COMMAND ] [ DEBUGGING EVENT ] [ THREAD STACK ] [ BREAK LIST ] [ MEMORY INFORMATION ] [ register information ].
Based on the same inventive concept, the embodiment of the present invention further provides a collaborative debugging method based on Web, and because the principle of the problem solved by the method is similar to that of the foregoing collaborative debugging system based on Web, the implementation of the method can refer to the implementation of the foregoing system, and repeated details are not repeated.
The embodiment of the present invention further provides a collaborative debugging method based on Web, and based on the collaborative debugging system based on Web provided in any of the above embodiments, the method, as shown in fig. 4, includes:
s1, preprocessing operation of a Web graphical debugging platform;
s2, performing cooperative debugging preprocessing operation;
s3, performing breakpoint debugging operation;
s4, performing cooperative debugging operation;
wherein: step S1 is a Web-based graphical debugging platform preprocessing operation, and with reference to fig. 5, includes:
s11, the Web-based graphical debugging platform starts an HTTP server module according to a preset debugging port and records a server address URL; the server address URL format may be, for example: http:// [ server address ]: port ]/[ pathname ].
S12, the Web client browser module inputs a server address URL and sends an HTTP request to the HTTP server module;
s13, the GDBWrapper message conversion module and the GDB server debugging module carry out initialization operation;
further, referring to fig. 6, the step S13 includes:
s131, the GDB server debugging module establishes TCP connection with an operating system or an application program running in QEMU to debug the operating system or the application program;
and S132, the GDBWrapper message conversion module establishes TCP connection with the GDB server debugging module for communication, and establishes connection communication with the HTTP server module through Web Socket.
The GDBWrapper message conversion module and the HTTP server module establish a Web Socket connection format as follows: [ server address ] [ debug port ].
The GDBWrapper message conversion module and the GDB server debugging module establish a TCP connection format as follows: [127.0.0.1] port.
The cooperative debugging preprocessing operation described in step S2, as shown in fig. 7, includes the following steps:
s21, logging in the debugging system by the debugging user through the corresponding authority;
s22, the collaborative debugging user management module creates a new debugging group for the user or adds the new debugging group into an existing debugging group according to the user request;
the breakpoint debugging operation in step S3, as shown in fig. 8, includes the following steps:
s31, searching related functions or global variables by the Web-based graphical debugging platform according to a user request, and selecting the related functions or global variables needing to set breakpoints in a Web client browser module;
s32, the Web client browser module sends a breakpoint setting request, and sends the breakpoint setting request and the related function or the global variable to the HTTP server module;
s33, the HTTP server module sends the breakpoint request to a GDBWrapper message conversion module for message conversion, and sends the breakpoint setting request and a debugging request corresponding to a related function or a global variable to a GDB server debugging module for executing a debugging command;
specifically, referring to fig. 9, step S33 includes:
s331, the HTTP server module analyzes the debugging request sent by the Web client browser module, and executes corresponding operation, and the method mainly comprises the following steps:
(a) when the received debugging request is a Quit command, a command for interrupting the GDB server is sent out;
(b) when the received debugging request is Set/Remove Breakpoint or Set/Remove Watchpoint, sending a command for setting or deleting a Breakpoint/observation point to a GDB server debugging module;
(c) when the received debugging request is that the Memory checks the Memory information or the Register checks the Register information, a command for checking the relevant format of the Memory information or the Register information is sent to a debugging module of the GDB server;
(d) when the received debugging request is a Pause Pause or Run continuous execution command, sending an interrupt execution or continuous execution command to a GDB server debugging module;
(e) and when the received debugging request is a Step single-Step execution command, sending the single-Step debugging command to the GDB server debugging module, and performing single-Step execution by taking a function as a basic debugging unit.
S332, the HTTP server module sends the analyzed debugging request to the GDBWrapper message conversion module, the GDBWrapper message conversion module converts the debugging request into GDB/MI commands executable by the GDB server debugging module, receives a debugging result returned by the GDB server debugging module, converts the debugging result into a corresponding data format and returns the corresponding data format to the HTTP server module.
S34, the GDB server debugging module returns the returned breakpoint list information, thread information and console information to the GDBWrapper message conversion module for message conversion, and returns the converted debugging result to the HTTP server module;
step S4, in conjunction with the debugging operation, as shown in fig. 10, includes the following steps:
s41, the collaborative debugging user management module creates a debugging instance for a first debugging user, and the debugging instance maintains a debugging group information and a debugging Token;
s42, the debugging user newly joining the debugging group sends a Token acquisition request to the collaborative debugging authority management module; after the request is confirmed, obtaining a debugging authority;
and S43, the cooperative debugging message management module returns the same debugging information for all the debugging members of the debugging group every time the debugging information is returned.
Referring to fig. 11, a flowchart of a collaborative debugging process of the Web-based collaborative debugging method is shown, where the collaborative debugging process includes the following steps:
step 111, start;
step 112, starting an HTTP server module; starting an HTTP server module by the Web-based graphical debugging platform according to a pre-configured debugging port, and recording a URL (Uniform resource locator) address of the server
Step 113, opening a Web client browser, and inputting an HTTP server URL address; the Web client browser module opens the browser, inputs the server address URL, and sends an HTTP request to the HTTP server module
Step 114, initializing a GDBWrapper message conversion module and a GDB server debugging module;
step 115, inputting a user name and a password by a debugging user to log in a debugging system;
step 116, judging that the login is successful; otherwise, go to step 115, if yes, go to step 117;
step 117, selecting whether to create a debugging group by a user; if yes, go to step 118, otherwise go to step 124; the collaborative debugging user management module creates a new debugging group for a user or adds the new debugging group into an existing debugging group according to a user request; after an existing debugging group is selected to be added, the cooperative debugging information in the same group can be directly acquired from the HTTP server side.
Step 118, obtaining debugging permission and starting debugging;
step 119, setting a debugging breakpoint; searching related functions or global variables by a Web-based graphical debugging platform according to a user request, and selecting the functions or global variables needing to set breakpoints in a Web client browser;
step 120, sending a debugging command to the HTTP server; the Web client browser which obtains the debugging permission sends a breakpoint setting request, and sends the breakpoint setting request and a related function or a global variable to the HTTP server;
step 121, the GDBWrapper performs message conversion and sends a debugging command to the GDB server; the HTTP server sends the breakpoint and the request to the GDBWrapper for message conversion, and sends a debugging request command to the GDB server to execute the debugging command;
step 122, the GDB server executes the debugging command and returns a debugging result; the GDB server returns the returned breakpoint list information, thread information and console information to the GDBWrapper for message conversion, returns the processed debugging information to the HTTP server, and finally returns the debugging information to the client browser in an HTML form.
Step 123, saving the debugging command and the returned debugging result to a database server;
step 124, directly obtaining the cooperative debugging information in the same group from the HTTP server;
and step 125, ending.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (9)

1. A collaborative debugging system based on Web is characterized by comprising a graphical debugging platform based on Web and a collaborative debugging framework;
the Web-based graphical debugging platform comprises:
the Web client browser module is used for sending a debugging request to the HTTP server module and presenting debugging information returned by the GDB server debugging module to a user;
the HTTP server module is used for receiving the debugging request and returning the output result of the GDBWrapper message conversion module to the user client browser;
the GDBWrapper message conversion module is used for receiving the debugging request processed by the HTTP server module and sending the debugging request to the GDB server debugging module; receiving a debugging result sent by the GDB server debugging module, and returning the debugging result to the HTTP server module;
the GDB server debugging module is used for debugging the target system and the application program corresponding to the debugging request and returning a debugging result to the GDBWrapper message conversion module;
the collaborative debugging framework comprises:
the cooperative debugging user management module is used for dividing all debugging users into a plurality of debugging groups for management, and creating a new debugging group for the users or adding the users into the existing debugging group according to the user request; each debugging group has a unique representation ID, and debugging information received by users in the same debugging group is the same;
the collaborative debugging authority management module is used for determining whether the user to be debugged of each debugging group has a unique Token; each debugging group Session maintains a unique Token, and when a user with the Token has authority to send a debugging command;
and the cooperative debugging message management module is used for adopting a unified management mechanism for the debugging requests and the debugging results, returning each debugging request and each debugging result to all debugging members of the corresponding debugging group, and ensuring the consistency of debugging information by adopting a database cache mechanism.
2. The Web-based collaborative debugging system of claim 1, wherein the debugging request comprises one or more of the following commands:
pause, Run, Step single Step, Set Breakpoint break, delete Breakpoint Remove, Set Watchpoint, delete Watchpoint Remove, view specified Memory information Memory, view Register information Register, and exit Quit.
3. The Web-based collaborative debugging system of claim 1, wherein the debugging information comprises one or more of the following:
the system comprises thread stack information during system operation, GDB debugging information returned by command execution, breakpoint list information, observation point list information, specified memory data information and register data information.
4. The Web-based collaborative debugging system of claim 1, wherein the gdbwwrapper message transformation module is specifically configured to transform JSON-formatted data sent by the Web client browser module into debugging commands executable by a GDB server, and transform debugging results returned by the GDB server debugging module into HTML-formatted data displayed by the Web client browser module.
5. The Web-based collaborative debugging system according to claim 4, wherein the debugging command of the JSON-formatted data has a specific format:
[ GID ] [ COMMAND ] [ DEBUGGING EVENT ].
6. The Web-based collaborative debugging system of claim 4, wherein the debugging result is formatted as follows:
[ GID ] [ COMMAND ] [ DEBUGGING EVENT ] [ THREAD STACK ] [ BREAK LIST ] [ MEMORY INFORMATION ] [ register information ].
7. A collaborative debugging method based on Web is characterized by comprising the following steps: the method comprises the steps of Web-based graphical debugging platform preprocessing operation, collaborative debugging preprocessing operation, breakpoint debugging operation and collaborative debugging operation;
the Web-based graphical debugging platform preprocessing operation comprises the following steps:
(11) starting an HTTP server module by the Web-based graphical debugging platform according to a pre-configured debugging port, and recording a server address URL;
(12) a Web client browser module inputs a server address URL and sends an HTTP request to an HTTP server module;
(13) the GDBWrapper message conversion module and the GDB server debugging module carry out initialization operation;
the cooperative debugging preprocessing operation comprises the following steps:
(21) a debugging user logs in a debugging system through a corresponding authority;
(22) the collaborative debugging user management module creates a new debugging group for a user or adds the new debugging group into an existing debugging group according to a user request;
the breakpoint debugging operation comprises the following steps:
(31) the Web-based graphical debugging platform searches related functions or global variables according to a user request, and selects the related functions or global variables needing to set breakpoints in a Web client browser module;
(32) the Web client browser module sends a breakpoint setting request and sends the breakpoint setting request and a related function or a global variable to an HTTP server module;
(33) the HTTP server module sends the breakpoint setting request to the GDBWrapper message conversion module for message conversion, and sends the breakpoint setting request and a debugging request corresponding to a related function or a global variable to the GDB server debugging module to execute a debugging command;
(34) the GDB server debugging module returns the returned breakpoint list information, thread information and console information to the GDBWrapper message conversion module for message conversion, and returns the converted debugging result to the HTTP server module;
the cooperative debugging operation comprises the following steps:
(41) the cooperative debugging user management module creates a debugging example for a first debugging user, and the debugging example maintains debugging group information and a debugging Token;
(42) the debugging users newly added into the debugging group send out a Token acquisition request to the collaborative debugging authority management module; after the request is confirmed, obtaining a debugging authority;
(43) and the collaborative debugging message management module returns the same debugging information for all debugging members of the debugging group when the debugging information is returned every time.
8. The Web-based collaborative debugging method according to claim 7, wherein the GDBWrapper message transformation module and GDB server debugging module perform initialization operations, comprising the steps of:
(131) the GDB server debugging module is used for debugging an operating system or an application program by establishing TCP connection with the operating system or the application program operated in the QEMU;
(132) and the GDBWrapper message conversion module establishes TCP connection with the GDB server debugging module for communication and establishes connection communication with the HTTP server module through Web Socket.
9. The Web-based collaborative debugging method according to claim 7, wherein the step of sending the breakpoint setting request and the debugging request corresponding to the related function or the global variable to the GDB server debugging module to execute the debugging command comprises the steps of:
(331) the HTTP server module analyzes the debugging request sent by the Web client browser module and executes corresponding operation, and the method mainly comprises the following steps:
(a) when the received debugging request is a Quit command, a command for interrupting the GDB server is sent out;
(b) when the received debugging request is Set/Remove Breakpoint or Set/Remove Watchpoint, sending a command for setting or deleting a Breakpoint/observation point to a GDB server debugging module;
(c) when the received debugging request is that the Memory checks the Memory information or the Register checks the Register information, a command for checking the relevant format of the Memory information or the Register information is sent to a debugging module of the GDB server;
(d) when the received debugging request is a Pause Pause or Run continuous execution command, sending an interrupt execution or continuous execution command to a GDB server debugging module;
(e) when the received debugging request is a Step single-Step execution command, sending a single-Step debugging command to a GDB server debugging module, and performing single-Step execution by taking a function as a basic debugging unit;
(332) the HTTP server module sends the analyzed debugging request to the GDBWrapper message conversion module, the GDBWrapper message conversion module converts the debugging request into GDB/MI commands executable by the GDB server debugging module, receives a debugging result returned by the GDB server debugging module, converts the debugging result into a corresponding data format and returns the corresponding data format to the HTTP server module.
CN201810552504.2A 2018-05-31 2018-05-31 Web-based collaborative debugging system and method Active CN108829591B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810552504.2A CN108829591B (en) 2018-05-31 2018-05-31 Web-based collaborative debugging system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810552504.2A CN108829591B (en) 2018-05-31 2018-05-31 Web-based collaborative debugging system and method

Publications (2)

Publication Number Publication Date
CN108829591A CN108829591A (en) 2018-11-16
CN108829591B true CN108829591B (en) 2021-05-04

Family

ID=64147021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810552504.2A Active CN108829591B (en) 2018-05-31 2018-05-31 Web-based collaborative debugging system and method

Country Status (1)

Country Link
CN (1) CN108829591B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727577B (en) * 2019-08-29 2023-06-09 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Debugging method, system and medium for probability reproduction problem in embedded system software
CN113760688A (en) * 2020-06-05 2021-12-07 腾讯科技(深圳)有限公司 Remote debugging method, system, webpage server, equipment and storage medium
CN114691483A (en) * 2020-12-30 2022-07-01 华为终端有限公司 Software debugging method, electronic equipment and debugging system
CN114968751A (en) * 2021-02-24 2022-08-30 中国联合网络通信集团有限公司 Program debugging method and program debugging device of code-free development platform

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6216237B1 (en) * 1998-06-19 2001-04-10 Lucent Technologies Inc. Distributed indirect software instrumentation

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1312588C (en) * 2004-04-02 2007-04-25 清华大学 Realizing method of cross regulator based on EJTAG components of targeting machine
US20080095143A1 (en) * 2006-10-19 2008-04-24 Research In Motion Limited System and method for providing debug information in session initiation protocol sessions
CN201491026U (en) * 2009-07-31 2010-05-26 福建升腾资讯有限公司 World-wide-web-based debugging system
CN101719093B (en) * 2009-12-09 2011-11-23 上海普元信息技术股份有限公司 System and method for realizing cross-browser Javascript debugging in enterprise Web application system
CN104683378A (en) * 2013-11-27 2015-06-03 上海墨芋电子科技有限公司 Computing and debugging system for novel cloud computing service platform adopting new technology

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6216237B1 (en) * 1998-06-19 2001-04-10 Lucent Technologies Inc. Distributed indirect software instrumentation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Remote cross-target debugging with GDB andGDBserver;Avi Rozen;《https://www.linux.com/news/remote-cross-target-debugging-gdb-and-gdbserver/》;20071128;全文 *

Also Published As

Publication number Publication date
CN108829591A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN108829591B (en) Web-based collaborative debugging system and method
EP3710939B1 (en) Assistive, language-agnostic debugging with multi-collaborator control
Mirzaei et al. Testing android apps through symbolic execution
US8028278B2 (en) Method of generating and utilizing debug history
Muccini et al. Using software architecture for code testing
US7472378B2 (en) Breakpoint management and reconciliation for embedded scripts in a business integration language specified program process
JP2000132424A (en) Software instrumentation method
US20050071243A1 (en) Non-disruptive business process debugging and analysis
CN103559445B (en) A kind of application program interaction control method and device
US20110004790A1 (en) Asynchrony Debugging Using Web Services Interface
CN102495802B (en) Method and device for testing software system, and computer system
US8656361B2 (en) Debugging code visually on a canvas
US20180129580A1 (en) Debugging in a private cloud environment
US9009673B2 (en) Collaborative software debugging in a distributed system with collaborative step over operation
US20120317552A1 (en) User-Specific Software Debugging
CN110362490B (en) Automatic testing method and system for integrating iOS and Android mobile applications
Masci et al. An integrated development environment for the prototype verification system
Ma et al. An automated testing platform for mobile applications
de Cleva Farto et al. Reuse of model-based tests in mobile apps
US11354221B2 (en) Contextual drill back to source code and other resources from log data
US6993749B2 (en) Conditional debug monitors
CN113641575B (en) Test method, device, equipment and storage medium
US6983454B2 (en) Extended “run to” function
US9405658B1 (en) Method and apparatus for debugging applications in development environments
CN116881174B (en) ECU application software closed-loop test method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant