CN102609353A - Method, device and system for managing program debugging - Google Patents

Method, device and system for managing program debugging Download PDF

Info

Publication number
CN102609353A
CN102609353A CN2012100152005A CN201210015200A CN102609353A CN 102609353 A CN102609353 A CN 102609353A CN 2012100152005 A CN2012100152005 A CN 2012100152005A CN 201210015200 A CN201210015200 A CN 201210015200A CN 102609353 A CN102609353 A CN 102609353A
Authority
CN
China
Prior art keywords
program
packet
debugging
debug
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2012100152005A
Other languages
Chinese (zh)
Inventor
周龙飞
刘正伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN2012100152005A priority Critical patent/CN102609353A/en
Publication of CN102609353A publication Critical patent/CN102609353A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a method and a system for managing program debugging. In the method, a debugging end used for debugging a target program and a target end cross platform used for loading the target program are used, wherein the debugging end executes the following steps of packing codes used for debugging the target program into a first data packet after acquiring the codes used for debugging the target program; acquiring network address information of the target end loading the target program; setting the target address of the first data packet as the network address of a host where the target program is installed, and transmitting the first data packet.

Description

Method, Apparatus and system that program debug is managed
Technical field
The present invention relates to computer application field, the method, the Apparatus and system that relate in particular to a kind of transmission, program debug is managed.
Background technology
Running environment according to debugger and debugged program; Software debugging can be divided into dual mode: a kind of is local debugging (Native Debug); Debugger and debugged program operate in same machine often in this case; Be two processes in the identical operations system, debugged process is controlled, visited to the debugger process through the calling interface that operating system provides specially; Another kind is to intersect to debug (Corss Debug), and debugger operates on the exploitation main frame in this case, and debugged program then operates on the target machine.
The debugging that intersects usually is called remote debugging (Remote Debug) again, generally is applied in the software development of embedded system, and the debugger of debugging that wherein is used to intersect is called the intersection debugger.
Intersect when debugging, the intersection debugger on the exploitation main frame is with the method for operation of debugged program on certain mode controlled target machine, and have check with the modifying target machine on various debug functioies such as variate-value in internal storage location, register and the debugged process.And what this control function was provided is exactly the module that is called debugging proxy in the target machine, and it is responsible for and intersects that debugger is common to be cooperated with the debugging of completion to running process on the target machine.Usually, will intersect debugger and debugging proxy is called the embedded systems debugging device together.
General with GNU gdb debugging utility in the embedded Linux system development, its original length of run debugging can only be used for LAN, and can not realize cross-platform debugging embedded aims of systems program.The debugger that the gdb expansion is used for the Web environment does not also have now, and the Web debugger implementation method that this patent provides is also had no talent at present and realized, a kind of method of distributed debugging embedded Linux application program is provided.
Summary of the invention
Method method, the Apparatus and system that program debug is managed provided by the invention, the technical matters that solve is how to realize cross-platform program debug.
For solving the problems of the technologies described above, the invention provides following technical scheme:
A kind of method that program debug is managed, the debugging end that is used for debug object program is cross-platform with the destination end that loads this target program, and wherein said debugging end is carried out following steps:
After obtaining being used for the code of debug object program, the code that will be used for debug object program is packaged into first packet;
Obtain the network address information of the destination end that loads this target program;
With the destination address of this first packet the network address, send said first packet as this target program place main frame.
A kind of method that program debug is managed, the debugging end that is used for debug object program is cross-platform with the destination end that loads this target program, and wherein said destination end is carried out following steps:
After receiving this first packet, this first packet is resolved, obtain debugged program;
Carry out said debugged program, obtain execution result;
Said execution result is packaged into second packet;
With the source address of said first packet destination address, said second packet is sent as this second packet.
Preferably, said method also has following characteristics: said this first packet is resolved, obtain debugged program, comprising:
Judge in the code of resolving whether " g " parameter is arranged, if having, the code that then will comprise this parameter is as debugging code.
A kind of method that program debug is managed, the debugging end that is used for debug object program is cross-platform with the destination end that loads this target program, wherein:
Said debugging end adopts said method to send debugged program and gives destination end;
Said destination end adopts said method to handle this debugged program.
A kind of device that program debug is managed is used for debug object program, and the target sub system and this device that wherein load this target program are cross-platform, and wherein said device comprises:
First packaging system is used for after obtaining being used for the code of debug object program, and the code that will be used for debug object program is packaged into first packet;
Deriving means links to each other with said first packaging system, is used to obtain the network address information of target sub system;
First dispensing device links to each other with said deriving means, is used for said first packet is sent in the destination address of this first packet network address as this target program place main frame.
A kind of device that program debug is managed, this device is loaded with a target program, and cross-platform with the debugging subsystem that is used for debug object program, and wherein said this device comprises:
Parsing module is used for after receiving this first packet, this first packet being resolved, and obtains debugged program;
Execution module links to each other with said parsing module, is used to carry out said debugged program, obtains execution result;
Package module links to each other with said execution module, and said execution result is packaged into second packet;
Sending module links to each other with said package module, with the source address of said first packet destination address as this second packet, sends said second packet.
Preferably, said device also has following characteristics:
Said parsing module is used for judging whether the code of parsing has " g " parameter, if having, the code that then will comprise this parameter is as debugging code.
A kind of system that program debug is managed, the debugging subsystem that is used for debug object program is cross-platform with the target sub system that loads this target program, wherein:
Said debugging subsystem adopts said apparatus to send debugged program and gives destination end;
Said target sub system adopts said apparatus to handle this debugged program.
Compared with prior art, through will debugging the communication information encapsulated data packet between end and the target phase, and through Network Transmission, overcome when debugging end and destination end are cross-platform in the prior art, can't carry out the problem of debugging operations.
Description of drawings
The schematic flow sheet of the method that program debug is managed that Fig. 1 provides for the embodiment of the invention;
The schematic flow sheet of the method that program debug is managed that Fig. 2 provides for the embodiment of the invention;
The mutual synoptic diagram of the method for the debug object program that Fig. 3 provides for application example of the present invention;
The structural representation of the device that program debug is managed that Fig. 4 provides for the embodiment of the invention;
The structural representation of the device that program debug is managed that Fig. 5 provides for the embodiment of the invention.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, will combine accompanying drawing and specific embodiment that the present invention is made further detailed description below.Need to prove that under the situation of not conflicting, embodiment among the application and the characteristic among the embodiment be combination in any each other.
The present invention relates to realize at the debugger of Web environment; The RSP protocol information that adopts encapsulation gdb to communicate by letter with gdbserver is the http data, sets up the remote debugging of realization of Communication Web of gdb and the gdbserver in the embedded system of browser end and Web server end.
The present invention provides a kind of method of distributed debugging embedded target program, realizes the debugging session service at the Web server end, at browser end debugger control program is provided, and the agency who handles the RSP protocol information transmits.Provide through browser login Web server debugging session service remote debugging embedded target program, can realize the target program in the cross-platform debugging embedded linux system, convenient debugging enironment in embedded system development is built.
The schematic flow sheet of the method that program debug is managed that Fig. 1 provides for the embodiment of the invention.Method embodiment shown in Figure 1 is that cross-platform data can't be purpose with the problem that debugged program sends in the prior art to solve; The debugging end that wherein is used for debug object program is cross-platform with the destination end that loads this target program, and wherein said debugging end is carried out following steps:
Steps A 10, after obtaining being used for the code of debug object program, the code that will be used for debug object program is packaged into first packet;
Steps A 20, obtain the network address information of the destination end that loads this target program;
Steps A 30, with the destination address of this first packet the network address as this target program place main frame, send said first packet.
The schematic flow sheet of the method that program debug is managed that Fig. 2 provides for the embodiment of the invention.Corresponding with method shown in Figure 1; The technical matters that wherein will solve is under cross-platform situation, how to realize target program is debugged; Among the method embodiment shown in Figure 2; The debugging end that is used for debug object program is cross-platform with the destination end that loads this target program, and wherein said destination end is carried out following steps:
Step B10, after receiving this first packet, this first packet is resolved, obtain debugged program;
Step B20, carry out said debugged program, obtain execution result;
Step B30, said execution result is packaged into second packet;
Step B40, with the source address of said first packet destination address as this second packet, send said second packet.
Wherein, said this first packet is resolved, obtains debugged program, comprising:
Judge in the code of resolving whether " g " parameter is arranged, if having, the code that then will comprise this parameter is as debugging code.
By on can find out; The method of sending and receiving of the foregoing description; The RSP protocol information that gdb is communicated by letter with gdbserver is packaged into the http data and transmits, thereby sets up the remote debugging of realization of Communication Web of gdb and the gdbserver in the embedded system of browser end and Web server end.
In addition, the present invention also provides the mutual synoptic diagram of a kind of method embodiment that program debug is managed.Wherein, the debugging end that is used for debug object program is cross-platform with the destination end that loads this target program, wherein:
The debugging end adopts method shown in Figure 1 to send debugging code to destination end;
Destination end adopts method shown in Figure 2 to handle this debugging code.
The method that present embodiment provides realizes the remote debugging service routine through browser login Web server, can be on browser remote debugging embedded target program.
Describe with an application example below:
Should use in the instance, debugging end be the gdb of Web server end, destination end be with the embedded system target machine in gdbserver, set up both network communication protocols, like the RSP agreement.Both are packaged into the http message with the employed RSP protocol information of mutual communication, in the Web environment, set up communication, specifically, have comprised that the Web service end is to the forwarding of RSP information, to the forwarding to RSP information of the encapsulation of gdb/MI interface and browser end.
In short, the user logins the debugging session service of Web server end, the program that cross compile will remote debugging, and compile time has-the g parameter, and program can be used for debugging.Target program is downloaded to the embedded target machine from the Web server end, and the program that downloads in the embedded target machine can be the program of handling through stip.Its practical implementation step is following:
Step 101, user open gdbserver in embedded system; Concrete grammar is: gdbserver192.168.4.84:1234program; Wherein 192.168.4.84 is the IP address of browser end main frame, and gdbserver initiates debugging services, waits for that gdb carries out communicating by letter of RSP data with it.
Step 102, user initiate the debugging request at browser debugging interface; Import corresponding tuning parameter; Debugger control and embedded system target machine through at browser end connect; The Web server end is opened debugging session service, the RSP data of debugger control polling request Web server end, the RPS data communication of setting up the gdb and the gdbserver in the embedded system target machine of Web server end simultaneously.
The debugging session of step 103, Web server; Encapsulation gdb/MI command line interface; The debugging interface display output of browser end is provided; What the RSP protocol data was provided acts on behalf of the forwarding capability module, is that 127.0.0.1 sets up the socket service routine in the IP address, is used to obtain and transmits the RSP protocol data.
Step 104, utilize original method of gdb remote debugging; At gdb/MI command line interface input target remote 127.0.0.1:1234; Foundation is communicated by letter with the socket service routine; Wherein 1234 is port numbers, and port numbers is used to distinguish different debugging sessions, and gdb that different debugging sessions has and socket service routine are right.The RSP request of data from browser is handled and is handled in the distribution of port numbers by RSP debugging session service routine.
Step 105, gdb are when carrying out remote debugging; Gdbserver operates in the target machine; Gdb operates on the exploitation main frame; Gdb and gdbserver communicate through serial ports or LAN, because of gdb is to connect through internet with communicating by letter of gdbserver, so with the gdb expanded application in the Web environment; The information that need the RSP information that gdb communicates by letter with gdbserver be packaged into the http form is transmitted to Browser host and Web host, goes out RSP information by corresponding module parses again and is transmitted to gdb and gdbserver.
As shown in Figure 3, when the user wants debugged program, at first will be from the good target program of Web debugger server end compiling, it can be to handle the program of removing Debugging message through strip, and Web host end has Debugging message by the program that gdb debugs.Will debugged program download among the Etarget host, open the program that institute will debug by gdbserver, gdbserver IP:Port/ttyS0 program is provided with the connection parameter again on browser, begins to debug.RSP Transceiver module will connect with Etarget host this moment; After connecting foundation well, go for and ask Web host debugging session service routine, acquisition request RSP data; The RSP information that obtains is transmitted to gdbserver; Go to read the RSP information that gdbserver responds besides, be packaged into http data post and give Web host the debugging session service routine of end, this just set up gdb and be connected in the communication of Web environment with gdbserver.
The structural representation of the device that program debug is managed that Fig. 4 provides for the embodiment of the invention.In conjunction with Fig. 1 and method shown in Figure 3, the target sub system and this device that wherein load this target program are cross-platform, and wherein said device comprises:
First packaging system 401 is used for after obtaining being used for the code of debug object program, and the code that will be used for debug object program is packaged into first packet;
Deriving means 402 links to each other with said first packaging system 401, is used to obtain the network address information of the destination end that loads this target program;
First dispensing device 403 links to each other with said deriving means 402, is used for said first packet is sent in the destination address of this first packet network address as this target program place main frame.
The structural representation of the device that program debug is managed that Fig. 5 provides for the embodiment of the invention.In conjunction with the method shown in Fig. 2 and 3, device shown in Figure 4 is loaded with a target program, and cross-platform with the debugging subsystem that is used for debug object program, and wherein said this device comprises:
Resolver 501 is used for after receiving this first packet, this first packet being resolved, and obtains debugged program;
Actuating unit 502 links to each other with said resolver 501, is used to carry out said debugged program, obtains execution result;
Second packaging system 503 links to each other with said actuating unit 502, is used for said execution result is packaged into second packet;
Second dispensing device 504 links to each other with said second packaging system 503, is used for the source address of said first packet destination address as this second packet is sent said second packet.
Concrete, said resolver 501 is used for judging whether the code of parsing has " g " parameter, if having, the code that then will comprise this parameter is as debugging code.
By on can find out; The method of sending and receiving of the foregoing description; The RSP protocol information that gdb is communicated by letter with gdbserver is packaged into the http data and transmits, thereby sets up the remote debugging of realization of Communication Web of gdb and the gdbserver in the embedded system of browser end and Web server end.
In addition, the present invention also provides a kind of system that program debug is managed, and in this system, the debugging subsystem that is used for debug object program is cross-platform with the target sub system that loads this target program, wherein:
Said debugging subsystem adopts device shown in Figure 3 to send debugged program and gives destination end;
Said target sub system adopts this debugged program of apparatus processes shown in Figure 4.
The method that present embodiment provides realizes the remote debugging service routine through browser login Web server, can be on browser remote debugging embedded target program.
The above; Be merely embodiment of the present invention, but protection scope of the present invention is not limited thereto, any technician who is familiar with the present technique field is in the technical scope that the present invention discloses; Can expect easily changing or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the described protection domain of claim.

Claims (8)

1. the method that program debug is managed is characterized in that, the debugging end that is used for debug object program is cross-platform with the destination end that loads this target program, and wherein said debugging end is carried out following steps:
After obtaining being used for the code of debug object program, the code that will be used for debug object program is packaged into first packet;
Obtain the network address information of the destination end that loads this target program;
With the destination address of this first packet the network address, send said first packet as this target program place main frame.
2. the method that program debug is managed is characterized in that, the debugging end that is used for debug object program is cross-platform with the destination end that loads this target program, and wherein said destination end is carried out following steps:
After receiving this first packet, this first packet is resolved, obtain debugged program;
Carry out said debugged program, obtain execution result;
Said execution result is packaged into second packet;
With the source address of said first packet destination address, said second packet is sent as this second packet.
3. method according to claim 2 is characterized in that, said this first packet is resolved, and obtains debugged program, comprising:
Judge in the code of resolving whether " g " parameter is arranged, if having, the code that then will comprise this parameter is as debugging code.
4. the method that program debug is managed is characterized in that, the debugging end that is used for debug object program is cross-platform with the destination end that loads this target program, wherein:
Said debugging end adopts the method for claim 1 to send debugged program and gives destination end;
Said destination end adopts like claim 2 or 3 described methods and handles this debugged program.
5. the device that program debug is managed is characterized in that, is used for debug object program, and the target sub system and this device that wherein load this target program are cross-platform, and wherein said device comprises:
First packaging system is used for after obtaining being used for the code of debug object program, and the code that will be used for debug object program is packaged into first packet;
Deriving means links to each other with said first packaging system, is used to obtain the network address information of target sub system;
First dispensing device links to each other with said deriving means, is used for said first packet is sent in the destination address of this first packet network address as this target program place main frame.
6. the device that program debug is managed is characterized in that, this device is loaded with a target program, and cross-platform with the debugging subsystem that is used for debug object program, and wherein said this device comprises:
Parsing module is used for after receiving this first packet, this first packet being resolved, and obtains debugged program;
Execution module links to each other with said parsing module, is used to carry out said debugged program, obtains execution result;
Package module links to each other with said execution module, and said execution result is packaged into second packet;
Sending module links to each other with said package module, with the source address of said first packet destination address as this second packet, sends said second packet.
7. device according to claim 6 is characterized in that:
Said parsing module is used for judging whether the code of parsing has " g " parameter, if having, the code that then will comprise this parameter is as debugging code.
8. the system that program debug is managed is characterized in that, the debugging subsystem that is used for debug object program is cross-platform with the target sub system that loads this target program, wherein:
Said debugging subsystem adopts device as claimed in claim 5 to send debugged program and gives destination end;
Said target sub system adopts like claim 6 or 7 these debugged programs of described apparatus processes.
CN2012100152005A 2012-01-17 2012-01-17 Method, device and system for managing program debugging Pending CN102609353A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012100152005A CN102609353A (en) 2012-01-17 2012-01-17 Method, device and system for managing program debugging

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012100152005A CN102609353A (en) 2012-01-17 2012-01-17 Method, device and system for managing program debugging

Publications (1)

Publication Number Publication Date
CN102609353A true CN102609353A (en) 2012-07-25

Family

ID=46526743

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012100152005A Pending CN102609353A (en) 2012-01-17 2012-01-17 Method, device and system for managing program debugging

Country Status (1)

Country Link
CN (1) CN102609353A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103684899A (en) * 2012-09-17 2014-03-26 腾讯科技(深圳)有限公司 Remote debugging method and device
CN103902358A (en) * 2014-03-18 2014-07-02 北京领通科技有限公司 Mobile terminal remote debugging method and system and mobile terminal
CN104536765A (en) * 2015-01-09 2015-04-22 苏州科达科技股份有限公司 Embedded device logging-in and debugging method and system
CN109344065A (en) * 2018-09-27 2019-02-15 迈普通信技术股份有限公司 Remote debugging method, debugging server and target machine
CN109634852A (en) * 2018-11-30 2019-04-16 北京小米移动软件有限公司 Program debugging method and device
CN111258887A (en) * 2020-01-09 2020-06-09 支付宝(杭州)信息技术有限公司 Debugging method and device for scripting language application and terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61160154A (en) * 1985-01-07 1986-07-19 Nec Corp Supporting device of program development
US20020046364A1 (en) * 2000-06-30 2002-04-18 Miyoko Yoshimura Debugging kernel system
CN1471268A (en) * 2002-07-26 2004-01-28 上海贝尔有限公司 Universal hardware combined debugging platform based on Internet
CN101741648A (en) * 2009-12-29 2010-06-16 中兴通讯股份有限公司 Distributed remote test system, method and server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61160154A (en) * 1985-01-07 1986-07-19 Nec Corp Supporting device of program development
US20020046364A1 (en) * 2000-06-30 2002-04-18 Miyoko Yoshimura Debugging kernel system
CN1471268A (en) * 2002-07-26 2004-01-28 上海贝尔有限公司 Universal hardware combined debugging platform based on Internet
CN101741648A (en) * 2009-12-29 2010-06-16 中兴通讯股份有限公司 Distributed remote test system, method and server

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103684899A (en) * 2012-09-17 2014-03-26 腾讯科技(深圳)有限公司 Remote debugging method and device
CN103902358A (en) * 2014-03-18 2014-07-02 北京领通科技有限公司 Mobile terminal remote debugging method and system and mobile terminal
CN104536765A (en) * 2015-01-09 2015-04-22 苏州科达科技股份有限公司 Embedded device logging-in and debugging method and system
CN104536765B (en) * 2015-01-09 2017-09-12 苏州科达科技股份有限公司 Login, the method and system of debugging embedded equipment
CN109344065A (en) * 2018-09-27 2019-02-15 迈普通信技术股份有限公司 Remote debugging method, debugging server and target machine
CN109634852A (en) * 2018-11-30 2019-04-16 北京小米移动软件有限公司 Program debugging method and device
CN109634852B (en) * 2018-11-30 2022-03-18 北京小米移动软件有限公司 Program debugging method and device
CN111258887A (en) * 2020-01-09 2020-06-09 支付宝(杭州)信息技术有限公司 Debugging method and device for scripting language application and terminal

Similar Documents

Publication Publication Date Title
CN102609353A (en) Method, device and system for managing program debugging
CN104965700B (en) The method and system of driving SPI equipment is realized under vxworks operating system
CN104461897A (en) Application program test method and device
CN109598040B (en) NS3 and MATLAB integrated joint simulation interface method based on TCP protocol
CN112187922A (en) Intelligent Internet of things shutdown machine based on MQTT communication protocol
KR102274178B1 (en) Emulating test distributed application on server
CN106444610A (en) A PLC remote code updating system and method
CN104486146A (en) Communication method for testing console and testing equipment
US11709722B2 (en) Extensible communication framework and communication method supporting multiple communication protocols
CN102811230B (en) Resource call method based on application integration and system thereof
CN106294119B (en) Test scheduling system and method and terminal equipment
JP5676823B2 (en) Method for updating a data card, personal computer, and data card
CN102739806A (en) VXI-11 network automatic discovery method for LXI instrument on basis of DSP (Digital Signal Processor)/BIOS (Basic Input Output System) operation system
CN109683780A (en) Control method, system and the controlled terminal of mobile terminal
CN107277107B (en) Application debugging method, device and system
CN110430110B (en) On-site bus gateway and protocol conversion method thereof
CN106550026B (en) Network communication device and method
CN109634856B (en) IOS intelligent terminal remote real machine debugging system and method based on cloud service
CN110753363A (en) Intelligent device wireless debugging system and method
CN104570967A (en) Android system based remote control method and system
CN110958153A (en) Network transmission rate detection system, method and storage medium
CN111182031B (en) PLC (programmable logic controller) equipment remote downloading method and system
CN112416509B (en) Virtual machine control system and related equipment
CN109933353B (en) Embedded Web-based controller firmware upgrading method
CN102594587A (en) Embedded WEB debugging and testing maintenance method and debugging and testing maintenance system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20120725