Remote debugging method and system based on JDWP
By introducing debugger proxy and server proxy in JDWP remote debugging, analyzing and forwarding debugging instructions, the debugging difficulties caused by the unfixed server IP address and port in the big data sharing service cloud platform are solved, and remote without exposing the port is realized Debugging improves debugging efficiency and stability.
Patent Information
- Application Number
- CN201911402718.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-30
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2039-12-30
AI Technical Summary
In the big data sharing service cloud platform, the traditional JDWP remote debugging solution cannot run normally because the IP address and port of the server are not fixed, making it difficult for the client to set up connections. For security reasons, the server does not expose the ports, resulting in debugging difficulty.
Introduce debugger agent and server agent, receive debugging instructions through debugger agent, package and send them to server agent, parse out the service name and IP address, find the corresponding server and execute debugging instructions, return debugging results, and avoid directly from the client. Get the server IP address and port.
It realizes remote debugging without knowing the actual IP address and port of the server in the big data sharing service cloud platform, solves the problem of port conflict and improves debugging efficiency and stability.
Smart Images

Figure CN113127326B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote debugging based on JDWP, and in particular to a remote debugging method based on JDWP, a computer device and a readable storage medium thereof. Background Art
[0002] Some big data shared service cloud platforms provide the ability to expand services, which can support third parties to develop services on their own and expand the functions of shared service cloud platforms. Service development involves debugging services. The traditional debugging method requires service developers to debug the services locally before putting the services online. Due to the differences between the local environment and the online environment, services that can often run locally will have problems when put online, requiring repeated debugging, increasing development costs, and the stability of the services cannot be guaranteed. Therefore, an online debugging solution is proposed in the existing scheme.
[0003] JDWP is the abbreviation of Java Debug Wire Protocol, which defines the communication protocol between the debugger and the Java virtual machine (target vm) being debugged, and is used for remote debugging of Java code. When debugging is started, a listening port will be configured on the server side, and the server side will listen to the port and wait for the debugger to connect. Obviously, the debugger needs to know the precise IP address and port of the server side to complete the connection. However, the services started in some big data sharing service cloud platforms will be assigned to different machines in the cluster. The server side does not have a fixed IP address, and for security reasons, the service is accessed through the gateway and the port is not exposed to the outside. This has caused the traditional JDWP debugging solution to be unable to run normally in some big data sharing service cloud platforms. Similarly, the above problems will exist in any cluster environment. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0005] To this end, an object of the present invention is to propose a remote debugging method based on JDWP.
[0006] Another object of the present invention is to propose a remote debugging system based on JDWP.
[0007] To achieve the above object, an embodiment of the first aspect of the present invention provides a remote debugging method based on JDWP. Specifically, the method includes:
[0008] Set a debugger proxy for the corresponding debugger, and set a server proxy for at least one server;
[0009] The debugger sends a debugging instruction to the debugger agent;
[0010] The debugger agent receives the debugging instruction, packages the name of the service to be debugged and the debugging instruction and sends them to the server agent;
[0011] The server agent receives the message sent by the debugger agent, parses the received information to parse out the name of the service to be debugged and the debugging instruction, finds out the server and the server IP address corresponding to the name of the service to be debugged according to the parsed name of the service to be debugged, and sends the parsed debugging instruction to the found server;
[0012] The server receives and executes the debugging instruction, and returns the executed debugging result to the server agent;
[0013] The server agent returns the debugging result to the debugger agent, and the debugger agent returns the debugging result to the debugger.
[0014] Based on the above solution, preferably, the remote debugging method further includes, before the step of the debugger sending the debugging instruction to the debugger agent:
[0015] Set the debugger parameter hostname to the IP address, and set the debugger parameter port to the port that the debugger agent listens on; the IP address here can be the debugger agent's IP address or 127.0.0.1.
[0016] The debugger agent is configured with the IP address of the server agent and the name of the service to be debugged.
[0017] Based on the above solution, preferably, the debugger and the debugger agent are two functional units of the same machine.
[0018] According to another solution, the debugger and the debugger agent are located on different machines.
[0019] Based on the above solution, preferably, when the debugger and the debugger agent are two functional units of the same machine, the debugger parameter hostname is set to 127.0.0.1. When the debugger and the debugger agent are located on different machines, the debugger parameter hostname is set to the IP address of the debugger agent.
[0020] On the basis of the above solution, preferably, the debugging method further includes:
[0021] Storing a relationship table of service names, servers and server IP addresses in the server proxy;
[0022] The step of the server agent finding out the server and the server IP address corresponding to the name of the service to be debugged according to the name of the service to be debugged specifically includes:
[0023] According to the name of the service to be debugged and the association table, the server and the server IP address corresponding to the name of the service to be debugged are found.
[0024] The embodiment of the second aspect of the present invention provides a remote debugging system based on JDWP. Specifically, the debugging system includes:
[0025] A debugger, a debugger agent, a server agent and at least one server, wherein:
[0026] The debugger is used for service debugging, generating and sending debugging instructions, and receiving debugging results returned by the debugger agent;
[0027] The debugger agent is used to receive the debugging instruction sent by the debugger, and package the debugging instruction and the name of the service to be debugged and send them to the server agent, and to receive the debugging result sent by the server agent and send the debugging result to the debugger;
[0028] The server agent is used to receive the information sent by the debugger agent, and parse the received information to parse out the name of the service to be debugged and the debugging instruction, then find out the corresponding server and server IP address according to the parsed name of the service to be debugged, and send the parsed debugging instruction to the found server;
[0029] At least one of the servers is used to receive the debugging instruction sent by the server agent and execute the debugging instruction, and return the executed debugging result to the server agent.
[0030] Based on the above solution, preferably, the parameter port of the debugger is the port monitored by the debugger agent; the debugger agent is configured with the IP address of the server agent and the name of the service to be debugged.
[0031] Based on the above solution, preferably, the debugger and the debugger agent are two functional units of the same machine.
[0032] In another aspect, the debugger and the debugger agent are located on different machines.
[0033] When the debugger and the debugger agent are two functional units of the same machine, the debugger parameter hostname is set to 127.0.0.1. When the debugger and the debugger agent are located on different machines, the debugger parameter hostname is set to the IP address of the debugger agent.
[0034] Based on the above scheme, preferably, the server-side agent stores an association table of service names, servers and server IP addresses; wherein the server-side agent can find the server and server IP address corresponding to the name of the service to be debugged according to the name of the service to be debugged and the association table.
[0035] According to the remote debugging method and system based on JDWP provided by the present invention, the scheme described in the method and system includes four parts, namely, a debugger, a debugger agent (i.e., client-proxy) and a server agent (i.e., server-proxy) and a cluster environment composed of one or more servers. Among them, the cluster environment composed of the debugger and one or more servers is an existing structure, and the debugger agent and the server agent are newly added structures. That is, in this scheme, a debugger agent (i.e., client-proxy) and a server agent (i.e., server-proxy) are added between the debugger (i.e., debugger end) and the cluster environment composed of one or more servers, wherein the debugger is used for service debugging, generating and sending debugging instructions, and receiving the debugging results returned by the debugger agent; and the debugger agent corresponds to the debugger setting, mainly used to realize the communication between the debugger and the server agent, specifically, the debugger agent is located between the debugger and the server agent, mainly used to receive the debugger's message, and encode the information such as the name of the service to be debugged and the debugging instructions and other information to the server agent. At the same time, it is used to receive the debugging results received by the server agent and return the debugging results to the debugger. The server proxy corresponds to a cluster environment setting composed of one or more servers, and is mainly used to realize communication with the debugger proxy and one or more servers. Specifically, the server proxy is located between the debugger proxy and one or more servers, and is mainly used to receive messages from the debugger proxy and parse the received information to parse out the name of the service to be debugged and the debugging instruction, and then find out the corresponding server and server IP address according to the parsed name of the service to be debugged, and send the parsed debugging instruction to the found server. At least one server is used to receive the debugging instruction sent by the server proxy and execute the debugging instruction, and return the executed debugging result to the server proxy. In this solution, a debugger agent and a server agent are added between the debugger (i.e., the debugger end) and the cluster environment composed of one or more servers, so that the debugging information can be encoded and forwarded through the debugger agent and the server agent. In this way, the client only needs to set the address of the server agent and the name of the service to be debugged, without knowing the address where the server actually runs. This can solve the problem that the IP address and port of the server in the service cluster may be different each time it is started, that is, the IP address and port are not fixed, which makes it inconvenient for the client to set the IP address and port. At the same time, this setting hides the IP address and port number of the server when the server is started, so there is no need to expose additional ports to the outside, avoiding the port conflict problem when multiple services need to be debugged.
[0036] Additional aspects and advantages of the present invention will be given in part in the following description, and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0038] Figure 1 A schematic diagram of a remote debugging method based on JDWP according to an embodiment of the present invention is shown;
[0039] Figure 2 A schematic diagram showing a flow chart of a remote debugging method based on JDWP according to another embodiment of the present invention is shown;
[0040] Figure 3 A schematic diagram showing a flow chart of a remote debugging method based on JDWP according to another embodiment of the present invention is shown;
[0041] Figure 4 A block diagram of a remote debugging system based on JDWP according to an embodiment of the present invention is shown;
[0042] Figure 5 A block diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0043] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0045] Figure 1 A remote debugging method based on jdwp is shown according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0046] S102, setting a debugger proxy for the debugger and setting a server proxy for at least one server;
[0047] S104, the debugger sends a debugging instruction to the debugger agent;
[0048] S106, the debugger agent receives the debugging instruction, packages the name of the service to be debugged and the debugging instruction and sends them to the server agent;
[0049] S108, the server agent receives the message sent by the debugger agent, parses the received information to parse out the name of the service to be debugged and the debugging instruction, finds out the server and the server IP address corresponding to the name of the service to be debugged according to the parsed name of the service to be debugged, and sends the parsed debugging instruction to the found server;
[0050] S110, the server receives and executes the debugging instruction, and returns the executed debugging result to the server agent;
[0051] S112, the server agent returns the debugging result to the debugger agent, and the debugger agent returns the debugging result to the debugger.
[0052] According to the remote debugging method based on JDWP provided by the present invention, the scheme described in the method includes four parts, namely, a debugger, a debugger agent (i.e., client-proxy) and a server agent (i.e., server-proxy) and a cluster environment composed of one or more servers. Among them, the cluster environment composed of the debugger and one or more servers is an existing structure, and the debugger agent and the server agent are newly added structures. That is, in this scheme, a debugger agent (i.e., client-proxy) and a server agent (i.e., server-proxy) are added between the debugger (i.e., debugger end) and the cluster environment composed of one or more servers, wherein the debugger is used for service debugging, generating and sending debugging instructions, and receiving the debugging results returned by the debugger agent; and the debugger agent corresponds to the debugger setting, mainly used to realize the communication between the debugger and the server agent, specifically, the debugger agent is located between the debugger and the server agent, mainly used to receive the debugger's message, and encode the information such as the name of the service to be debugged and the debugging instructions and other information to the server agent. At the same time, it is used to receive the debugging results received by the server agent and return the debugging results to the debugger. The server proxy corresponds to a cluster environment setting composed of one or more servers, and is mainly used to realize communication with the debugger proxy and one or more servers. Specifically, the server proxy is located between the debugger proxy and one or more servers, and is mainly used to receive messages from the debugger proxy and parse the received information to parse out the name of the service to be debugged and the debugging instruction, and then find out the corresponding server and server IP address according to the parsed name of the service to be debugged, and send the parsed debugging instruction to the found server. At least one server is used to receive the debugging instruction sent by the server proxy and execute the debugging instruction, and return the executed debugging result to the server proxy. In this solution, a debugger agent and a server agent are added between the debugger (i.e., the debugger end) and the cluster environment composed of one or more servers, so that the debugging information can be encoded and forwarded through the debugger agent and the server agent. In this way, the client only needs to set the address of the server agent and the name of the service to be debugged, without knowing the address where the server actually runs. This can solve the problem that the IP address and port of the server in the service cluster may be different each time it is started, that is, the IP address and port are not fixed, which makes it inconvenient for the client to set the IP address and port. At the same time, this setting hides the IP address and port number of the server when the server is started, so there is no need to expose additional ports to the outside, avoiding the port conflict problem when multiple services need to be debugged.
[0053] In the above embodiment, the debugger and the debugger agent may be located on the same machine or may be two functional units located on different machines.
[0054] In another embodiment, if Figure 2 As shown, the debugging method includes, in addition to the above steps S102 to S112, further comprising:
[0055] S103, setting the debugger parameter hostname to the IP address of the debugger agent, setting the debugger parameter port to the port that the debugger agent listens on, and configuring the debugger agent with the IP address of the server agent and the name of the service to be debugged.
[0056] In this embodiment, the debugger's parameter hostname and parameter port can be reasonably set in advance. Specifically, the debugger's parameter hostname can be set to the debugger agent's IP address, and the debugger's parameter port can be set to the port that the debugger agent listens on, so that the debugger and the debugger agent can communicate normally. The server agent's IP address is configured in the debugger agent, so that the debugger agent can connect and communicate with the server agent. The name of the service to be debugged is configured in the debugger agent so that the name of the service to be debugged and the debugging instructions can be sent to the server agent together with the debugger agent, so that the server agent can find the server to be debugged according to the name, and send the debugging instructions to the corresponding server, so that it can be ensured that the service to be debugged and the corresponding debugging instructions can correspond.
[0057] Specifically, when the debugger and the debugger agent are located on the same machine, that is, when the debugger and the debugger agent are two functional units of the same machine, the debugger parameter hostname can be set to 127.0.0.1. At the same time, the debugger parameter port is set to the port that the debugger agent listens on. When the debugger and the debugger agent are located on different machines, the debugger parameter hostname is set to the IP address of the debugger agent.
[0058] Figure 3 A remote debugging method based on jdwp is shown according to another embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:
[0059] S302, setting a debugger proxy for the debugger and setting a server proxy for at least one server;
[0060] S304, setting the debugger parameter hostname to the IP address of the debugger agent or setting the debugger parameter hostname to 127.0.0.1, and setting the debugger parameter port to the port that the debugger agent listens on.
[0061] S306, configuring the debugger agent with the IP address of the server agent and the name of the service to be debugged;
[0062] S308, the debugger performs debugging and sends debugging instructions to the debugger agent;
[0063] S310, the debugger agent receives the debugging instruction, packages the name of the service to be debugged and the debugging instruction and sends them to the server agent;
[0064] S312, storing a relationship table of service name, server and server IP address in the server proxy;
[0065] S314, the server agent receives the message sent by the debugger agent, parses the received information to parse out the name of the service to be debugged and the debugging instruction, finds out the server and the server IP address corresponding to the name of the service to be debugged according to the name of the service to be debugged and the association table, and sends the parsed debugging instruction to the found server;
[0066] S316, the server receives and executes the debugging instruction, and returns the executed debugging result to the server agent;
[0067] S318, the server agent returns the debugging result to the debugger agent, and the debugger agent returns the debugging result to the debugger.
[0068] In this embodiment, most of the steps and effects can refer to the above embodiment, and the key point of this embodiment is to store the association table of the service name, the server and the server IP address in the server agent in advance, so that the server agent can find out the server and the IP address of the service to be debugged according to the parsed service name and the association table after parsing the name of the service to be debugged. In this way, the debugging instruction can be sent to the corresponding server so that the server can perform normal debugging. Of course, in other schemes, the server and the IP address of the server of the service to be debugged can also be found out by other means. For example, the server agent can query online or send information to a third party, and then determine the corresponding server and its IP address based on the result sent back by the third party.
[0069] like Figure 4 As shown, the embodiment of the second aspect of the present invention provides a remote debugging system 400 based on JDWP. Specifically, the debugging system 400 includes a debugger 410, a debugger agent 420, a server agent 430 and at least one server 440, wherein:
[0070] The debugger 410 is used for service debugging, generating and sending debugging instructions, and receiving debugging results returned by the debugger agent 420;
[0071] The debugger agent 420 is used to receive the debugging instructions sent by the debugger 410, and package the debugging instructions and the name of the service to be debugged and send them to the server agent 430, and to receive the debugging results sent by the server agent 430, and send the debugging results to the debugger 410;
[0072] The server agent 430 is used to receive the information sent by the debugger agent 420, and parse the received information to parse out the name of the service to be debugged and the debugging instruction, and then find out the corresponding server 440 and the IP address of the server 440 according to the parsed name of the service to be debugged, and send the parsed debugging instruction to the found server 440;
[0073] At least one server 440 is used to receive the debugging instructions sent by the server agent 430 and execute the debugging instructions, and return the executed debugging results to the server agent 430.
[0074] According to the jdwp-based remote debugging system 400 provided by the present invention, the scheme described in the system includes four parts, namely, a debugger 410, a debugger agent 420, a server agent 430, and a cluster environment composed of one or more servers 440. Among them, the cluster environment composed of the debugger 410 and one or more servers 440 is an existing structure, while the debugger agent 420 and the server agent 430 are newly added structures. That is, in this solution, a debugger agent 420 and a server agent 430 are added between the debugger 410 and the cluster environment composed of one or more servers 440, wherein the debugger 410 is used for service debugging, generating and sending debugging instructions, and receiving debugging results returned by the debugger agent 420; and the debugger agent 420 is set corresponding to the debugger 410, mainly used to realize the communication between the debugger 410 and the server agent 430. Specifically, the debugger agent 420 is located between the debugger 410 and the server agent 430, mainly used to receive messages from the debugger 410, and encode information such as the name of the service to be debugged and debugging instructions and send them to the server agent 430. At the same time, it is used to receive the debugging results received by the server agent 430 and return the debugging results to the debugger 410. The server agent 430 corresponds to the cluster environment setting composed of one or more servers 440, and is mainly used to realize the communication with the debugger agent 420 and one or more servers 440. Specifically, the server agent 430 is located between the debugger agent 420 and one or more servers 440, and is mainly used to receive the message of the debugger agent 420, and parse the received information to parse out the name of the service to be debugged and the debugging instruction, and then find out the corresponding server 440 and the server 440 IP address according to the parsed name of the service to be debugged, and send the parsed debugging instruction to the found server 440. At least one server 440 is used to receive the debugging instruction sent by the server agent 430 and execute the debugging instruction, and return the executed debugging result to the server agent 430. In this solution, a debugger agent 420 and a server agent 430 are added between the debugger 410 and the cluster environment composed of one or more servers 440, so that the debugging information can be encoded and forwarded through the debugger agent 420 and the server agent 430. In this way, the client only needs to set the address of the server agent 430 and the name of the service to be debugged, without knowing the actual running address of the server 440. This can solve the problem that the IP address and port of the server 440 in the service cluster may be different each time it is started, that is, the IP address and port are not fixed, which makes it inconvenient for the client to set the IP address and port. At the same time, with this setting, when the server 440 is started, the IP address and port number of the server 440 are hidden, so there is no need to expose additional ports to the outside, avoiding the port conflict problem when multiple services need to be debugged.
[0075] Based on the above solution, preferably, the parameter port of the debugger 410 is the port monitored by the server agent 430; the debugger agent 420 is configured with the IP address of the server agent 430 and the name of the service to be debugged.
[0076] In this embodiment, the parameters hostname and port of the debugger 410 can be reasonably set in advance so that the debugger 410 and the debugger agent 420 can communicate normally. The IP address of the server agent 430 and the name of the service to be debugged are configured in the debugger agent 420, so that the debugger agent 420 can connect and communicate with the server agent 430. The name of the service to be debugged is configured in the debugger agent 420 so that the name of the service to be debugged and the debugging instructions can be sent to the server agent 430 together with the debugger agent 420, so that the server agent 430 can find the server 440 to be debugged according to the name, and send the debugging instructions to the corresponding server 440, so that it can be ensured that the service to be debugged and the corresponding debugging instructions can correspond.
[0077] Based on the above solution, preferably, the debugger 410 and the debugger agent 420 are two functional units of the same machine, so that the debugger 410 and the debugger agent 420 can be combined into one, thereby simplifying the structure of the system.
[0078] In another embodiment, debugger 410 and debugger agent 420 are located on different machines, so that debugger 410 and debugger agent 420 can be independent of each other and work independently without interfering with each other.
[0079] When the debugger 410 and the debugger agent 420 are two functional units of the same machine, the parameter hostname of the debugger 410 is set to 127.0.0.1, so that the debugger 410 and the debugger agent 420 in the same machine can access each other for communication.
[0080] When debugger 410 and debugger agent 420 are located on different machines, the parameter hostname of debugger 410 is set to the IP address of debugger agent 420. This enables debugger 410 and debugger agent 420 to access each other for communication.
[0081] Based on the above scheme, preferably, the server agent 430 stores an association table of service name, server 440 and server 440 IP address; wherein the server agent 430 can find the server 440 and server 440 IP address corresponding to the name of the service to be debugged according to the name of the service to be debugged and the association table.
[0082] In this embodiment, by storing the association table of the service name, the server 440 and the IP address of the server 440 in the server proxy 430 in advance, the server proxy 430 can find out the server 440 and the IP address of the server 440 of the service to be debugged according to the parsed service name and the association table after parsing the name of the service to be debugged. In this way, the debugging instruction can be sent to the corresponding server 440 so that the server 440 can be debugged normally. Of course, in other schemes, the server 440 and the IP address of the server 440 of the service to be debugged can also be found out by other means, for example, the server proxy 430 can query through the Internet or send information to a third party, and then determine the corresponding server and its IP address based on the result sent back by the third party.
[0083] Preferably, there are multiple servers 440 , that is, the server 440 is a server 440 in a service cluster.
[0084] Among them, the debugger, debugger agent, server agent and server in the remote debugging system based on jdwp are all electronic devices that can realize the above functions. Figure 5 The specific structure and function of the electronic device 500 such as the debugger, debugger agent, server agent and server are introduced.
[0085] in, Figure 5 FIG. 5 is a schematic block diagram of an electronic device 500 that can be used in an embodiment of the present disclosure. Figure 5 As shown, the electronic device 500 includes a central processing unit 501, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory 502 or computer program instructions loaded from a storage unit 508 into a random access memory 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output interface 505 is also connected to the bus 504.
[0086] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0087] The processing unit 501 performs the various methods and processes described above. For example, in some embodiments, the methods in the above implementation examples may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the CPU 501, one or more steps of the remote control terminal and the vehicle-mounted reading device described above can be executed. Alternatively, in other embodiments, the CPU 501 can be configured to execute the methods in the above implementation examples in any other appropriate manner.
[0088] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that may be used include, without limitation, field programmable gate arrays, application specific integrated circuits, application specific standard products, systems on chip systems, load programmable logic devices, and the like.
[0089] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or electronic device.
[0090] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories, optical fibers, portable compact disk read-only memories, optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0091] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.
[0092] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A remote debugging method based on jdwp, characterized in that: include: Set a debugger proxy for the corresponding debugger, and set a server proxy for at least one server; The debugger sends a debugging instruction to the debugger agent; The debugger agent receives the debugging instruction, packages the name of the service to be debugged and the debugging instruction and sends them to the server agent; The server agent receives the message sent by the debugger agent, parses the received information to parse out the name of the service to be debugged and the debugging instruction, finds out the server and the server IP address corresponding to the name of the service to be debugged according to the parsed name of the service to be debugged, and sends the parsed debugging instruction to the found server; The server receives and executes the debugging instruction, and returns the executed debugging result to the server agent; The server agent returns the debugging result to the debugger agent, and the debugger agent returns the debugging result to the debugger.
2. The remote debugging method based on jdwp according to claim 1, characterized in that: The remote debugging method further includes, before the step of the debugger sending the debugging instruction to the debugger agent: Set the debugger parameter hostname to the IP address, and set the debugger parameter port to the port that the debugger agent listens on; The debugger agent is configured with the IP address of the server agent and the name of the service to be debugged.
3. The remote debugging method based on jdwp according to claim 2, characterized in that: The debugger and the debugger agent are two functional units of the same machine; or The debugger and the debugger agent are located on different machines.
4. The remote debugging method based on jdwp according to claim 3, characterized in that: When the debugger and the debugger agent are two functional units of the same machine, setting the debugger parameter hostname to 127.0.0.1; When the debugger and the debugger agent are located on different machines, the debugger parameter hostname is set to the IP address of the debugger agent.
5. The remote debugging method based on JDWP according to any one of claims 1 to 4, characterized in that: Also includes: Storing a relationship table of service names, servers and server IP addresses in the server proxy; The step of the server agent finding out the server and the server IP address corresponding to the name of the service to be debugged according to the name of the service to be debugged specifically includes: According to the name of the service to be debugged and the association table, the server and the server IP address corresponding to the name of the service to be debugged are found.
6. A remote debugging system based on jdwp, characterized in that: include: A debugger, a debugger agent, a server agent and at least one server, wherein: The debugger is used for service debugging, generating and sending debugging instructions, and receiving debugging results returned by the debugger agent; The debugger agent is used to receive the debugging instruction sent by the debugger, and package the debugging instruction and the name of the service to be debugged and send them to the server agent, and to receive the debugging result sent by the server agent and send the debugging result to the debugger; The server agent is used to receive the information sent by the debugger agent, and parse the received information to parse out the name of the service to be debugged and the debugging instruction, then find out the corresponding server and server IP address according to the parsed name of the service to be debugged, and send the parsed debugging instruction to the found server; At least one of the servers is used to receive the debugging instruction sent by the server agent and execute the debugging instruction, and return the executed debugging result to the server agent.
7. The jdwp-based remote debugging system according to claim 6, characterized in that: The parameter port of the debugger is the port that the debugger agent listens on; The debugger agent is configured with the IP address of the server agent and the name of the service to be debugged.
8. The jdwp-based remote debugging system according to claim 7, characterized in that: The debugger and the debugger agent are two functional units of the same machine; or The debugger and the debugger agent are located on different machines.
9. The jdwp-based remote debugging system according to claim 8, characterized in that: When the debugger and the debugger agent are two functional units of the same machine, the parameter hostname of the debugger is set to 127.0.0.1; When the debugger and the debugger agent are located on different machines, the debugger parameter hostname is set to the IP address of the debugger agent.
10. The jdwp-based remote debugging system according to any one of claims 6 to 9, characterized in that: The server proxy stores a relationship table of service name, server and server IP address; The server agent can find out the server and the server IP address corresponding to the name of the service to be debugged according to the name of the service to be debugged and the association table.
Citation Information
Patent Citations
Method and system for realizing remote debugging
CN103856361A
Distributed service debugging method and apparatus, storage medium and computer device
CN107948317A