CN106649087B - Code debugging method and apparatus - Google Patents

Code debugging method and apparatus Download PDF

Info

Publication number
CN106649087B
CN106649087B CN201610878681.0A CN201610878681A CN106649087B CN 106649087 B CN106649087 B CN 106649087B CN 201610878681 A CN201610878681 A CN 201610878681A CN 106649087 B CN106649087 B CN 106649087B
Authority
CN
China
Prior art keywords
debugging
program
database
code
described program
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
CN201610878681.0A
Other languages
Chinese (zh)
Other versions
CN106649087A (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.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group 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 Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201610878681.0A priority Critical patent/CN106649087B/en
Publication of CN106649087A publication Critical patent/CN106649087A/en
Application granted granted Critical
Publication of CN106649087B publication Critical patent/CN106649087B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3664Environments for testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention provides a kind of code debugging method and apparatus, wherein method includes: to obtain the suction parameter of code modulating device;Obtain the corresponding search library chain of login user;Described search library chain is modified, so that the search priority of the search priority of volatile data base database corresponding higher than development arrangement each in the Integrated Development Environment;Described program is copied in the volatile data base from the Integrated Development Environment according to the level of the title of described program and described program;It calls compiler directive corresponding with the type of described program to be compiled the program in the volatile data base according to the type of described program, generates debugging code;The debugging code is debugged, debugging result is obtained.Code debugging method provided by the invention, avoids and debugging code is retained in Integrated Development Environment, has evaded the risk that debugging code is distributed to production environment, improves the accuracy of product.

Description

Code debugging method and apparatus
Technical field
The present invention relates to technical field of software development more particularly to a kind of code debugging method and apparatus.
Background technique
SMART/400 is the software set development environment based on IBM AS/400 platform.SMART/400 passes through demixing technology The management of software source code is realized, specifically, exploitation environment is divided into product publication layer (also referred to as release layer), integrated survey Layer and development layer are tried, development layer is used for writing, modify and compiling to source code, and the source code for developing completion passes through SMART/ 400 tool begins to pass through integration testing layer from development layer and is finally published to release layers, and release layers are usually used as user Debugging and product are packaged.
Currently, the Integrated Development Environment debugging tool (also referred to as STRISDB) that SMART/400 is provided debugs program When, process is as follows: firstly, program is pulled down to development layer from release layers, secondly, by the program for pulling down to development layer to adjust Die trial formula is compiled in development layer, then, by the execution program with debugging code generated in development layer compiling from development layer Release layers are copied to, finally, starting STRISDB carries out program debugging.
But in above-mentioned debugging process, due to needing program pulling down to development layer from release layers, exploitation Layer can leave the unnecessary program version with debugging code, if subsequent should be distributed to the program version of debugging code Release layers, it will lead to product error.
Summary of the invention
The present invention provides a kind of code debugging method and apparatus, can be retained in Integrated Development Environment to avoid by debugging code In, evade the risk that debugging code is distributed to production environment, improves the accuracy of product.
Code debugging method provided by the invention, comprising:
Obtain the suction parameter of code modulating device;The suction parameter includes: the title of program, the type of program and journey The level of sequence;The development arrangement that the level of described program indicates described program where in Integrated Development Environment;
Obtain the corresponding search library chain of login user;Described search library chain includes the corresponding each data of the login user The initial search priority in library;The database includes: the corresponding database of each development arrangement in the Integrated Development Environment Volatile data base corresponding with the login user;
Described search library chain is modified, so that the search priority of the volatile data base is higher than in the Integrated Development Environment The search priority of the corresponding database of each development arrangement;
Described program is copied to from the Integrated Development Environment according to the level of the title of described program and described program In the volatile data base;
Call compiler directive corresponding with the type of described program to the volatile data base according to the type of described program In program be compiled, generate debugging code;
The debugging code is debugged, debugging result is obtained.
Code debugging device provided by the invention, comprising:
Parameter acquisition module, for obtaining the suction parameter of the code debugging device;The suction parameter includes: program Title, the type of program and program level;The level of described program indicates described program institute in Integrated Development Environment Development arrangement;
Library chain obtains module, for obtaining the corresponding search library chain of login user;Described search library chain includes the login The initial search priority of the corresponding each database of user;The database includes: each in the Integrated Development Environment opens Send out the corresponding database of level and the corresponding volatile data base of the login user;
Library chain modified module, for modifying described search library chain, so that the search priority of the volatile data base is higher than The search priority of the corresponding database of each development arrangement in the Integrated Development Environment;
Module is copied, for opening described program from described integrate according to the title of described program and the level of described program Hair ring border copies in the volatile data base;
Collector, for calling compiler directive corresponding with the type of described program to institute according to the type of described program The program stated in volatile data base is compiled, and generates debugging code;
Debugging module obtains debugging result for debugging to the debugging code.
The present invention provides a kind of code debugging method and apparatus, code debugging method provided by the invention is made full use of The corresponding volatile data base of user, program is compiled from the volatile data base for copying user in Integrated Development Environment to And debugging, due to the search priority of the volatile data base of user number corresponding higher than development arrangement each in Integrated Development Environment According to the search priority in library, therefore, meeting first search volatile data base is to adjust the debugging code in volatile data base Examination, avoids and debugging code is retained in Integrated Development Environment, evaded the risk that debugging code is distributed to production environment, Improve the accuracy of product.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair Bright some embodiments for those of ordinary skill in the art without any creative labor, can be with It obtains other drawings based on these drawings.
Fig. 1 is the flow chart for the code debugging method that the embodiment of the present invention one provides;
Fig. 2 is the structural schematic diagram for the code debugging device that the embodiment of the present invention one provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Code debugging method and apparatus provided in an embodiment of the present invention are mainly used in based on IBM AS/400 platform SMART/400 software set development environment solves the problems, such as existing to leave debugging code in SMART/400 development layer.Certainly, Code debugging method and apparatus provided in an embodiment of the present invention also can be applied to any software set based on other hardware platforms Development environment leaves the scene of debugging code, and the present invention is not particularly limited this.
Fig. 1 is the flow chart for the code debugging method that the embodiment of the present invention one provides, code debugging provided in this embodiment Method, executing subject can be code debugging device, and code debugging device can be software program.As shown in Figure 1, the present embodiment The code debugging method of offer may include:
Step 101, the suction parameter for obtaining code modulating device.
Wherein, suction parameter includes: the level of the title of program, the type of program and program.The level of program indicates Development arrangement of the program where in Integrated Development Environment.
Specifically, the suction parameter of code modulating device indicates the association attributes of program to be debugged, in this step, obtain Take the association attributes of program to be debugged.
It should be noted that specific implementation of the present embodiment for the level of the title of program, the type of program and program Mode is not specially limited, and the level of program is different according to different Integrated Development Environment, is carried out according to actual needs Setting.
Such as: the title of program can be Chinese or any combination of English, etc..
Such as: the type of program can be command set program (Comman list program, abbreviation CLP), or Cobol program (referred to as CBL program), etc..
Such as: if Integrated Development Environment is SMART/400, the development arrangement of Integrated Development Environment can be release Layer, integration testing layer and development layer, correspondingly, the level of program can be release layers, integration testing layer or development layer.
Step 102 obtains the corresponding search library chain of login user.
Search library chain includes the initial search priority of the corresponding each database of login user.Database includes: integrated Develop the corresponding database of each development arrangement and the corresponding volatile data base of login user in environment.
Specifically, the corresponding search library chain of user, indicates the initial search priority of the corresponding each database of user, When needing to search for database when program executes, it will the corresponding search of each database indicated according to search library chain is preferential Grade, the database high to search priority carry out first search.
Wherein, each login user is corresponding with a volatile data base.
It should be noted that the implementation of the present embodiment volatile data base corresponding for user does not do special standby limitation. Such as: if hardware platform is IBM AS/400, the corresponding volatile data base of user can be the library QTEMP of IBM AS/400.
Step 103, modification search library chain, so that the search priority of volatile data base is each higher than in Integrated Development Environment The search priority of the corresponding database of development arrangement.
Specifically, the search priority of the corresponding volatile data base of user is higher than each development arrangement in Integrated Development Environment The search priority of corresponding database, then when program execution needs to search for database, by the nonce of first search user According to library, and then the data in volatile data base can be obtained preferentially to be further processed.
Step 104 copies program to ephemeral data from Integrated Development Environment according to the title of program and the level of program In library.
Specifically, the title of program can be different with unique identification program, the level of program indicates program and opens integrated Development arrangement where in hair ring border therefore can be by program from Integrated Development ring by the level of the title of program and program In the volatile data base for copying user in border in corresponding development arrangement to.
Step 105 calls compiler directive corresponding with the type of program in volatile data base according to the type of program Program is compiled, and generates debugging code.
Specifically, compiler directive corresponding with the type of program is called to be compiled under debugging mode to program, it is raw It may include the increased Debugging message of user at debugging code, in debugging code.
Step 106 debugs debugging code, obtains debugging result.
As it can be seen that code debugging method provided in this embodiment, takes full advantage of the corresponding volatile data base of user, compared to Program is pulled down to development layer from release layers in the prior art to be compiled and debug, code debugging provided in this embodiment Method will be compiled and debug in volatile data base that program copies user to from release layers, due to having modified user couple The search library chain answered, it is corresponding that the search priority of the volatile data base of user is higher than each development arrangement in Integrated Development Environment The search priority of database, therefore, when program execution needs to search for database, the volatile data base of meeting first search user Rather than Integrated Development Environment, to obtain the debugging code in volatile data base, and then debugging acquisition is carried out to debugging code Debugging result.In the entire debugging process of code, debugging code will not be left in Integrated Development Environment, therefore having evaded will Debugging code is distributed to the risk of production environment, due to that will not cause to produce because of debugging code is left in Integrated Development Environment Product error, therefore improve the accuracy of product.
Optionally, suction parameter can also include: more new database instruction information.Code debugging side provided in this embodiment Method can also include:
If more new database instruction information instruction need more new database, by the corresponding Debugging message of program be updated to In the corresponding database of the level of program.
Specifically, more new database instruction information can be to update database or not more new database, data here Library refers to database corresponding with the level of program, if desired more new database, then is updated to the corresponding Debugging message of program In database.
It should be noted that the present embodiment is not particularly limited the specific implementation of Debugging message, as needed It is configured.Such as: the relevant Debugging message of program may include the Debugging message added during being compiled to program And the related data, etc. generated during debugging routine.
Optionally, code debugging method provided in this embodiment can also include:
The search priority of database each in search library chain is reverted to the initial search priority of each database.
Specifically, after the completion of program debugging, by the search priority of each database in the corresponding search library chain of user The initial search priority of each database is reverted to, to ensure the correctness of subsequent user search library chain application.
Optionally, code debugging method provided in this embodiment can also include:
Delete program, debugging code and the debugging result in volatile data base.
Optionally, code debugging method provided in this embodiment can also include:
All data when user exits and publishes, in the corresponding volatile data base of empty user.
Present embodiments provide a kind of code debugging method, comprising: obtain the suction parameter of code modulating device, acquisition is stepped on The corresponding search library chain in family is employed, search library chain is modified, so that the search priority of volatile data base is higher than Integrated Development Environment In the corresponding database of each development arrangement search priority, according to the level of the title of program and program by program from integrated Exploitation environment copies in volatile data base, calls compiler directive corresponding with the type of program to interim according to the type of program Program in database is compiled, and is generated debugging code, is debugged to debugging code, and debugging result is obtained.The present embodiment The code debugging method of offer, takes full advantage of the corresponding volatile data base of user, and program is copied from Integrated Development Environment It is compiled and debugs into the volatile data base of user, since the search priority of the volatile data base of user is higher than integrated open The search priority of the corresponding database of each development arrangement in hair ring border, therefore, can first search volatile data base to right Debugging code in volatile data base is debugged, and avoids and debugging code is retained in Integrated Development Environment, and having evaded will Debugging code is distributed to the risk of production environment, improves the accuracy of product.
Fig. 2 is the structural schematic diagram for the code debugging device that the embodiment of the present invention one provides, code provided in this embodiment Debugging apparatus, for executing the code debugging method of the offer of embodiment of the method shown in Fig. 1.As shown in Fig. 2, provided in this embodiment Code debugging device may include:
Parameter acquisition module 11, for obtaining the suction parameter of code debugging device.Suction parameter includes: the name of program Claim, the level of the type of program and program.The development arrangement that the level of program indicates program where in Integrated Development Environment.
Library chain obtains module 12, for obtaining the corresponding search library chain of login user.Search library chain includes login user pair The initial search priority for each database answered.Database includes: the corresponding number of each development arrangement in Integrated Development Environment According to library and the corresponding volatile data base of login user.
Library chain modified module 13, for modifying search library chain, so that the search priority of volatile data base is higher than integrated open The search priority of the corresponding database of each development arrangement in hair ring border.
Module 14 is copied, for copying to and facing from Integrated Development Environment by program according to the title of program and the level of program When database in.
Collector 15, for calling compiler directive corresponding with the type of program to ephemeral data according to the type of program Program in library is compiled, and generates debugging code.
Debugging module 16 obtains debugging result for debugging to debugging code.
Optionally, suction parameter further include: more new database indicates information.Device further include: update module.
Update module is used for:
If more new database instruction information instruction need more new database, by the corresponding Debugging message of program be updated to In the corresponding database of the level of program.
Optionally, library chain modified module 13 is also used to:
The search priority of database each in search library chain is reverted to the initial search priority of each database.
Optionally, device further include: data removing module.Data removing module is used for:
Delete program, debugging code and the debugging result in volatile data base.
Optionally, data removing module is also used to:
All data when user exits and publishes, in the corresponding volatile data base of empty user.
Code debugging device provided in this embodiment, for executing the code debugging side of the offer of embodiment of the method shown in Fig. 1 Method, technical principle is similar with technical effect, and details are not described herein again.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or The various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (11)

1. a kind of code debugging method characterized by comprising
Obtain the suction parameter of code modulating device;The suction parameter includes: the title of program, the type of program and program Level;The development arrangement that the level of described program indicates described program where in Integrated Development Environment;
Obtain the corresponding search library chain of login user;Described search library chain includes the corresponding each database of the login user Initial search priority;The database includes: the corresponding database of each development arrangement and institute in the Integrated Development Environment State the corresponding volatile data base of login user;
Described search library chain is modified, so that the search priority of the volatile data base is each higher than in the Integrated Development Environment The search priority of the corresponding database of development arrangement;
Described program copied to from the Integrated Development Environment according to the level of the title of described program and described program described In volatile data base;
Call compiler directive corresponding with the type of described program in the volatile data base according to the type of described program Program is compiled, and generates debugging code;
The debugging code is debugged, debugging result is obtained.
2. the method according to claim 1, wherein the suction parameter further include: more new database instruction letter Breath;The method also includes:
If the more new database instruction information instruction needs more new database, the corresponding Debugging message of described program is updated To in database corresponding with the level of described program.
3. the method according to claim 1, wherein the method also includes:
The search priority of each database in the chain of described search library is reverted to the initial search priority of each database.
4. method according to any one of claims 1 to 3, which is characterized in that the method also includes:
Delete described program, the debugging code and the debugging result in the volatile data base.
5. method according to any one of claims 1 to 3, which is characterized in that the method also includes:
When user exits and publishes, all data in the corresponding volatile data base of the user are emptied.
6. a kind of code debugging device characterized by comprising
Parameter acquisition module, for obtaining the suction parameter of the code debugging device;The suction parameter includes: the name of program Claim, the level of the type of program and program;The level of described program indicates described program where in Integrated Development Environment Development arrangement;
Library chain obtains module, for obtaining the corresponding search library chain of login user;Described search library chain includes the login user The initial search priority of corresponding each database;The database includes: each development layer in the Integrated Development Environment Secondary corresponding database and the corresponding volatile data base of the login user;
Library chain modified module, for modifying described search library chain, so that the search priority of the volatile data base is higher than described The search priority of the corresponding database of each development arrangement in Integrated Development Environment;
Copy module, for according to the level of the title of described program and described program by described program from the Integrated Development ring Border copies in the volatile data base;
Collector, for calling compiler directive corresponding with the type of described program to face described according to the type of described program When database in program be compiled, generate debugging code;
Debugging module obtains debugging result for debugging to the debugging code.
7. device according to claim 6, which is characterized in that the suction parameter further include: more new database instruction letter Breath;Described device further include: update module;
The update module is used for:
If the more new database instruction information instruction needs more new database, the corresponding Debugging message of described program is updated To in database corresponding with the level of described program.
8. device according to claim 6, which is characterized in that the library chain modified module is also used to:
The search priority of each database in the chain of described search library is reverted to the initial search priority of each database.
9. according to the described in any item devices of claim 6 to 8, which is characterized in that described device further include: data delete mould Block;The data removing module is used for:
Delete described program, the debugging code and the debugging result in the volatile data base.
10. device according to claim 9, which is characterized in that the data removing module is also used to:
When user exits and publishes, all data in the corresponding volatile data base of the user are emptied.
11. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium It executes instruction, when processor executes the computer executed instructions, realizes such as code described in any one of claim 1 to 5 Adjustment method.
CN201610878681.0A 2016-10-08 2016-10-08 Code debugging method and apparatus Active CN106649087B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610878681.0A CN106649087B (en) 2016-10-08 2016-10-08 Code debugging method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610878681.0A CN106649087B (en) 2016-10-08 2016-10-08 Code debugging method and apparatus

Publications (2)

Publication Number Publication Date
CN106649087A CN106649087A (en) 2017-05-10
CN106649087B true CN106649087B (en) 2019-05-14

Family

ID=58853643

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610878681.0A Active CN106649087B (en) 2016-10-08 2016-10-08 Code debugging method and apparatus

Country Status (1)

Country Link
CN (1) CN106649087B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880474A (en) * 2012-10-09 2013-01-16 无锡江南计算技术研究所 Test method for parallel source code generation, compilation and driven execution

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020083421A1 (en) * 2000-12-22 2002-06-27 Hitachi America, Ltd. Assembly language code compilation for an instruction-set architecture containing new instructions using the prior assembler
US8762971B2 (en) * 2009-04-02 2014-06-24 International Business Machines Corporation Servicing a production program in an integrated development environment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880474A (en) * 2012-10-09 2013-01-16 无锡江南计算技术研究所 Test method for parallel source code generation, compilation and driven execution

Also Published As

Publication number Publication date
CN106649087A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN105335412B (en) For data conversion, the method and apparatus of Data Migration
CN105683924B (en) For debugging the method and system of native code
US20220318945A1 (en) Optimizing compilation of shaders
US11579856B2 (en) Multi-chip compatible compiling method and device
CN106775744B (en) Method and device for generating static library
US8656349B2 (en) Systems and methods for template reverse engineering
CN106201861A (en) The detection method of a kind of code quality and device
US9311077B2 (en) Identification of code changes using language syntax and changeset data
CN102054217B (en) Entity morphing in metamodel-based tools
CN109783195A (en) A kind of real-time adjustment method of intelligent contract based on container
US9336124B2 (en) Automatic remote execution of an application
CN109445845A (en) Interface call method, device, computer equipment and storage medium
US20210182055A1 (en) Automatic source code refactoring
CN107832059A (en) Code static analysis method and device based on Makefile
CN102859489A (en) Resumable methods
Khatchadourian et al. Pointcut rejuvenation: Recovering pointcut expressions in evolving aspect-oriented software
CN104142819B (en) A kind of document handling method and device
CN107179982A (en) A kind of striding course adjustment method and device
JP2017204201A (en) Information processing device, compilation method, and compilation program
CN106649087B (en) Code debugging method and apparatus
CN115617594B (en) Method, apparatus, storage medium, and program product for generating incentive information
US8966455B2 (en) Flow analysis in program execution
CN115456628A (en) Intelligent contract viewing method and device based on block chain, storage medium and equipment
CN111142848A (en) Software program compiling method, software program executing method and software program compiling device
CN110347576A (en) Pseudocode adjustment method and device

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