CN1912848A - Method of automatic positioning for error in compiler - Google Patents

Method of automatic positioning for error in compiler Download PDF

Info

Publication number
CN1912848A
CN1912848A CN 200510090093 CN200510090093A CN1912848A CN 1912848 A CN1912848 A CN 1912848A CN 200510090093 CN200510090093 CN 200510090093 CN 200510090093 A CN200510090093 A CN 200510090093A CN 1912848 A CN1912848 A CN 1912848A
Authority
CN
China
Prior art keywords
file
value
option
compiler
function
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.)
Granted
Application number
CN 200510090093
Other languages
Chinese (zh)
Other versions
CN100442243C (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.)
Dongguan Lianzhou Electronic Technology Co Ltd
Original Assignee
Institute of Computing Technology of CAS
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 Institute of Computing Technology of CAS filed Critical Institute of Computing Technology of CAS
Priority to CNB2005100900932A priority Critical patent/CN100442243C/en
Publication of CN1912848A publication Critical patent/CN1912848A/en
Application granted granted Critical
Publication of CN100442243C publication Critical patent/CN100442243C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

This invention discloses a method for automatically locating errors in a compiler including: a compiler compiles the source files of an applied program to get its target file set and locates the mistaken target files in the applied program, then locates the error function from them, locates the optimized stage causing errors from the mistaken function to reduce the searched sphere of regions where the errors place to get the optimum stage causing errors initially and the error optimized options of the compiler, which realizes the quick location of the initial error stage and quick search of the error optimized options in target files.

Description

A kind of method that mistake in the compiler is located automatically
Technical field
The present invention relates to the exploitation and the debugging of compiler, be specially adapted to use large-scale application program or benchmark bag compiler software to be carried out the process of robustness, correctness test.
Background technology
In the development process of compiler, utilize large-scale application software (for example benchmark test bag of SPEC) that compiler is done software test usually.When moving under the compiler of application software in maturation, application software can trouble-free operation, and application software is when moving under the compiler of being researched and developed, application software may be made mistakes, by can realizing test and appraisal to the differentiation of using software error situation and Error Location, and find out the associated disadvantages of compiler to compiler stability and performance.But these application software generally are made up of the multiple source file, and each source file comprises a plurality of functions.When so run-time error appears in large-scale test procedure, be difficult to the reason of its Error Location and the compiler aspect that makes the mistake is located fast, so the quick location of run-time error just becomes problem anxious to be solved in the compiler development process.
The compilation process of compiler roughly can be divided into: lexical analysis, grammatical analysis, semantic analysis, optimization and code generate.The lexical analysis of front end, grammatical analysis, semantic analysis generate the middle-end code, generate rear end code, the file destination after obtaining compiling after the code optimization of rear end after the middle-end code optimization.The analytical work of front end is very ripe prior art, does not therefore consider the problem of front end in compiler, if compiler goes wrong, then mainly concentrates on the optimization aspect.In the process of utilizing large-scale application program that compiler is tested, error message mainly comprises three aspects, is respectively: the zone of makeing mistakes, the optimization option that leads to errors, the optimizing phase that leads to errors.The zone of makeing mistakes is meant the Error Location of large-scale application program run time error of test usefulness, and the zone of makeing mistakes can be divided into the zone of source file, function unit, control flow graph, the fundamental block in the zone, the instruction in the fundamental block from big to small.If the scope of the zone errors of location is more little, just helping the researchist more does follow-up analytical work.
At present, mainly be to utilize debugger that the mistake in the operational process is carried out manual location to the method for run-time error analysis, and then analyze the reason of makeing mistakes.But this method is for the very poor efficiency of searching of some run time error (as erroneous results) position.Orientation range to errors present is excessive, makes the developer need expend a large amount of time and efforts and is used for further wrong position, location, is unfavorable for the carrying out of follow-up work.
If a kind of method that mistake in the compiler is located automatically can be provided, can reduce the seek scope of wrong region as much as possible, the optimization that leads to errors option is provided, carry out follow-up work for the developer, finally find the mistake of compiler itself, have great importance.
Summary of the invention
It is excessive to the objective of the invention is to overcome in the prior art orientation range to errors present, is unfavorable for the shortcoming that location of mistake realizes, a kind of method that mistake in the compiler is located automatically is provided, and realizes searching fast and automatically the compiler mistake.
To achieve these goals, the invention provides a kind of method that mistake in the compiler is located automatically, may further comprise the steps:
1), utilize the source file of compiler compiling application program, the file destination of the program that is applied, resulting all file destinations are formed file destinations set;
2), file destination set that step 1) is obtained, utilize dichotomy and method of substitution location to realize location to the false target file in the file destination set;
3), to step 2) the resulting file destination of makeing mistakes, utilize the optimization switch option of the function that compiler provides, in conjunction with dichotomy, the alignment error function;
4), the optimization option switches of from the resulting function of makeing mistakes of step 3), utilizing compiler to provide, in conjunction with dichotomy, the location may cause the wrong optimizing phase, reduces the seek scope of wrong region, the optimization option that optimizing phase that is led to errors at first and compiler lead to errors.
In the technique scheme, in the described step 1), do compiling with the source file of correct compiler and compiler application programs to be detected respectively during the source file of compiler compiling application program, obtain file destination set separately, the set of correct compiler compiling gained file destination is designated as correct file set, compiler compiling gained file destination to be detected set is designated as the wrong file set.
In the technique scheme, described step 2) in, described dichotomy and the method for substitution of utilizing realized location to the false target file specifically comprising:
Set is placed under the different catalogues with wrong file for 2-1, correct file set that step 1) is obtained;
2-2, in each file set, the initial survey scope of file is set, file is sorted according to letter, the value of the minimum point of the scope of investigation is set to 1, corresponding to first file, the value of peak is set to total number of file in this document set, corresponding to last file, the intermediate value of minimum point and peak is set to the value of intermediate point, the file in the middle of corresponding minimum point and the peak;
2-3, judge that whether the value of minimum point is less than the value of peak and 1 difference, if Rule of judgment is false, then alternative document in the file of minimum point representative in the wrong file set and the correct file set is linked and moves, if operation result mistake, then the minimum point file is exactly the wrong file of asking, if operation result is correct, then the peak file is finished the wrong file position fixing process by asking wrong file; If Rule of judgment is set up, to be linked into object code to the file destination between peak behind the intermediate point in file destination between minimum point and the intermediate point in the wrong file set and the correct file set, observe operation result, if operation result is correct, change step 2-4 over to, if the operation result mistake changes step 2-5 over to;
2-4, reset the value of minimum point, the value of former intermediate point is composed to minimum point, and recomputate the value of intermediate point, according to step 2-3 the file between minimum point and peak is judged again then according to the value of the value of peak and new minimum point;
2-5, reset the value of peak, the value of former intermediate point is composed to peak, and recomputate the value of intermediate point, according to step 2-3 the file between minimum point and peak is judged again then according to the value of the value of minimum point and new peak.
In the technique scheme, in the described step 3), the described optimization switch option of utilizing the function that compiler provides, in conjunction with dichotomy, the alignment error function specifically comprises:
3-1, to step 2) resulting error file, set the initial survey scope of function, the order of all functions in the file according to compiling sorted, the value of investigating the minimum point of scope is made as 1, corresponding to the 1st function, the value of peak is identical with function number in this error file, corresponding to last function, the value of intermediate point is set to the intermediate value of highs and lows, corresponding to the function in the middle of peak and the minimum point;
3-2, judge that whether the value of minimum point is less than the value of peak and 1 difference, if Rule of judgment is false, then open the optimization switch of minimum point function, close the optimization switch of its complementary function simultaneously, move the file destination at function place then, if mistake appears in operation, then the function of minimum point is exactly the error functions of asking, if operation is correct, then the function of peak is withdrawed from the position fixing process of error functions by asking error functions; If Rule of judgment is set up, then open the optimization switch of minimum point to function between intermediate point, close behind the error file intermediate point optimization switch of function between peak, again compile, and the file that compiling is come out is linked into object code again, whether the operation result of object observing code is correct, if correctly change step 3-3 over to, otherwise forwards step 3-4 to;
3-3, reset the value of minimum point, the value of former intermediate point is composed to minimum point, and recomputate the value of intermediate point, according to step 2-3 the file between minimum point and peak is judged again then according to the value of the value of peak and new minimum point;
3-4, reset the value of peak, the value of former intermediate point is composed to peak, and recomputate the value of intermediate point, according to step 2-3 the file between minimum point and peak is judged again then according to the value of the value of minimum point and new peak.
In the technique scheme, in the described step 4), the described optimization option switches of utilizing compiler to provide in conjunction with dichotomy, is searched the optimizing phase and the relevant option of optimizing that lead to errors at first and is made up, and specifically comprises:
4-1, the optimizing phase of a certain appointment is checked, closed the optimization option in this optimizing phase one by one,, think that then the optimizing phase of this appointment is the optimizing phase that leads to errors at first when certain Push And Release of optimizing option wherein causes run-time error;
4-2, setting option list file include the Compiler Optimization option that will do switching manipulation in this document;
4-3, will be after the content resolution of the every line command in the option list file deposit in the corresponding array, generate the option Assembly Listing by class;
4-4, utilize the optimization option of the difference control granularity in the option Assembly Listing that function is investigated;
4-5, according to the result who investigates, obtain one and optimize the option combination, described optimization option combination is the set of the optimization option that possible lead to errors.
Among the described step 4-3, described with after the content resolution of the every line command in the option list file by class deposit in corresponding array be meant with the content in the option list file by optimizing phase title, optimization of region gauge tap, fundamental block optimize switch, instruction optimal control switch deposits in the array.
Among the described step 4-4, described control granularity comprises zone, fundamental block and instruction.
Among the described step 4-4, the described optimization option that utilizes the zones of different control granularity in the option Assembly Listing is investigated function and is meant by the order of zone, fundamental block, instruction and respectively the function zone of makeing mistakes is investigated, and each investigation all is based on the basis of last time investigating the gained option, forms new investigation option by increasing new control granularity option.
The invention has the advantages that:
1, by the method that the mistake in the compiler is located automatically of the present invention, can realize the quick location of the initial error phase in the file destination and searching fast of wrong optimization option, help the realization of technician, reduced the shared time of analyzing subsequent analysis work.
2, the present invention has good modularity, can be applied in the automatic test course at large software, in the process of performance test or correctness test, need not manual intervention, directly the software that run-time error occurs is analyzed timely, improve testing efficiency, save test and analysis time.
Description of drawings
Fig. 1 is the process flow diagram of the method that the mistake in the compiler is located automatically of the present invention;
Fig. 2 is the process flow diagram of the method that the mistake in the compiler is located automatically of the present invention used dichotomy and method of substitution when the false target file of location.
Embodiment
With reference to the accompanying drawings and embodiment, method of the present invention is elaborated.
The method that mistake in the compiler is located automatically of the present invention has realized producing when testing employed large-scale application program operation the make mistakes quick location in stage of wrong Error Location and compiler, as shown in Figure 1, comprising:
1) file destination of makeing mistakes in the position-location application.This step is will realize when passing through the application program generation run-time error of compiling the file that makes a mistake being positioned.
Before the location, prepare two catalogues, one is used for depositing correct file destination set, and another is used for depositing wrong file destination set.Here said correct file destination set is that application program uses known correct compiler version and correct optimization option to compile the resulting file destination set in back, and the file destination set of mistake is to utilize current compiler to be detected and optimize option to compile the resulting file destination set that makes mistakes.
Integrated use dichotomy and method of substitution when the location, with the file destination in the wrong file set file destination of the same name in the correct file set is substituted and moves successively, if a certain file destination in the wrong file set to the file of the same name in the correct file set do substitute after, file destination operation in the correct file set makes a mistake, and then this file destination in the wrong file set comprises mistake.
In the present embodiment, the concrete operations of localizing objects file can be undertaken by document alignment function locate_file, and its execution in step comprises as shown in Figure 2:
Step 10, compile with the source file of correct compiler version application programs, obtain correct file destination set, source file with compiler application programs to be detected compiles, and obtains wrong file destination set, and two file sets are placed on respectively under separately the catalogue;
Step 11, because correct file set and wrong file set are to obtain after the compiler compiling of source file through different editions by identical application software, the number of the file destination in therefore correct file set and the wrong file set is identical, and corresponding one by one.In two file sets, establishing the file number respectively is N, sets initial survey scope point [low, high], and the initial value of low is 1, and the initial value of high is N, intermediate point mid is set is (high+low)/2.
Step 12, judge low value whether less than the value of high-1, if Rule of judgment is false, then alternative document in the file of low representative in the wrong file set and the correct file set is linked and moves, if run-time error, then the file of low representative is by being asked wrong file, if operation is correct, then the file of high representative is by being asked wrong file, obtain withdrawing from current function locate_file, end operation behind institute's wrong file of asking; Otherwise according to dichotomy, [mid+1, high] set in [low, mid] part in the wrong file set and the correct file is linked into object code, observes operation result, if correctly change step 13 over to, if mistake changes step 14 over to.
Step 13, reset the value of low, its value is set to mid, and recomputates mid according to formula (high+low)/2, changes over to then in the step 12 file between [low, high] is investigated.
Step 14, reset the value of high, its value is set to mid, and recomputates mid according to formula (high+low)/2, changes over to then in the step 12 file between [low, high] is investigated.
In the wrong file set, more than one of the file destination possibility that makes a mistake utilizes dichotomy and method of substitution once can only find an error file.Dichotomy and method of substitution are used the location one by one that can realize the file destination of makeing mistakes repeatedly.
2) alignment error function.After determining error file, in most of the cases still can't determine where be the position of makeing mistakes, therefore also need to dwindle the regional scope of makeing mistakes, just will search the function of makeing mistakes.
The make mistakes location of function is to utilize the optimization switch option of the function that compiler provides to realize carry out switch by whether some function being done optimize, and the zone that will make mistakes narrows down to a function from a file, and analytical work is contracted in the function body.Also will use dichotomy in the process of alignment error function, the optimization switch option to function of utilizing compiler to provide simultaneously positions, and has increased repeatedly compilation process.The option that function is optimized switch that compiler provides comprises: the function of specified scope is closed middle-end and the rear end is optimized and the function of specified scope is closed the rear end optimize two kinds.In position fixing process, middle-end and rear end are optimized the option of controlling simultaneously as long as use, it comprises: close optimization (Wb from function n,-OPT:skip_a=n), begin to be optimized (Wb from function n,-OPT:skip_b=n), to function n close optimization (Wb ,-OPT:skip_e=n) wait three kinds.
In the present embodiment, can realize by mapping function locate_PU the position fixing process of the function of makeing mistakes.The concrete operations of locate_PU function comprise:
The error file that step 20, setting position obtain has N function, and setting initial survey scope point is [low, high], and the initial value of low is 1, and the initial value of high is N, intermediate point mid is set is (high+low)/2.
Step 21, judge low value whether less than the value of high-1, if Rule of judgment is false, then open the optimization switch of low representative function, close other function optimization switches, operation this document, if run-time error, then the function of low representative is exactly the error functions of asking, if operation is correct, then the function of high representative is exactly the error functions of asking, withdraw from current function locate_PU, otherwise press dichotomy, open the optimization of [low, mid] partial function, close the optimization of [mid+1, high] partial function.The file that compiling is come out is linked into object code again, and whether observe operation result correct, if correctly then change step 22 over to, if mistake then changes step 23 over to.
Step 22, reset the value of low, its value is set to mid, and recomputates mid according to formula (high+low)/2, changes step 21 then over to, and the function between [low, high] is investigated.
Step 23, reset the value of high, its value is set to mid, and recomputates mid according to formula (high+low)/2, changes step 21 then over to, and the function between [low, high] is investigated.
The optimization switch option of function has three kinds, and the locate_PU function is repeatedly called, and selects different optimization switch option at every turn for use when calling, thereby locates errors function.
3) the wrong optimizing phase of location.
At the function of makeing mistakes, the various optimization option switches that can utilize compiler to provide are carried out the trial of various optimal combinations to this function.These combination options comprise the multiple optimizing phase option of middle-end and rear end, as loop nesting optimization, control flow-optimized, instruction scheduling etc.The multiple optimization option that provides in the compiler is closed one by one,, just think that the optimizing phase of option correspondence is the optimizing phase that leads to errors at first when certain Push And Release of optimizing option has caused run-time error.Corresponding one or more optimization options of optimizing phase, optimizing option for one can exert an influence to the specific optimizing phase, therefore, found the optimization option of makeing mistakes also just can find the optimizing phase that leads to errors at first.
Because the result of the normally multiple optimization option of run-time error combined action, the optimizing phase that leads to errors at first might not be exactly the reason that finally leads to errors, therefore also need further to analyze, analyze the control granularity that can deeply then depend on the optimization option of this kind optimizing phase correspondence.In the method, can specify the optimizing phase of a needs inspection, judge whether it is the stage that leads to errors at first, thereby simplifying aspect the compile option location by the user.Perhaps, the object that the option combination conduct of directly using function and option file to provide is further investigated, the switch that the zone of control in the particle size range is optimized by dichotomy, when whether the optimization in certain piece zone has determined that operation is whether correct, just can be with the object of this zone as further investigation.Different options can be selected different control granularities is optimized, and the control granularity is divided into function, control stream zone, fundamental block, instruction.Can the control granularity of option have determined continue the zone of makeing mistakes is dwindled, and then reduce the workload of back manual analysis.If the control granularity of an option is fundamental block or instruction, then finally can will make mistakes region limits within fundamental block, on the contrary,, then be difficult to the zone of makeing mistakes is further dwindled if one is optimized option and is merely able to control function.This part work mainly realizes that by calling the locate_area function concrete steps comprise:
Step 30, the optimizing phase of appointment is checked, close the option of these optimizing phase correspondences one by one, when certain Push And Release of optimizing option has caused run-time error, just think that the optimizing phase of its correspondence is the optimizing phase that leads to errors at first, thereby determine initial error phase.
Step 31, setting option list file, include the Compiler Optimization option that will do switching manipulation in the option list file, each row in the option list file comprises that optimizing phase title, optimizing phase gauge tap, optimization of region gauge tap, fundamental block are optimized switch, the respective options such as switch are optimized in instruction.
Step 32, to the content in the option list file according to optimizing phase title (phase_name), optimizing phase gauge tap (id), optimization of region gauge tap (rg_flag), fundamental block is optimized switch (bb_flag), instruction is optimized switch (op_flag) and is resolved, and with optimizing phase title, optimization of region gauge tap, fundamental block optimize switch, instruction optimal control switch deposits array phase_array, rg_flag_array, bb_flag_array, op_flag_array respectively in, generates the option Assembly Listing.
The initial error phase of the error functions that step 33, the error functions that mapping function is obtained or step 30 obtain utilizes the option Assembly Listing further to handle as investigating object.For example,, find that controlling flow-optimized is the optimizing phase that leads to errors at first in the function, then in this step, will control the flow-optimized residing optimizing phase as investigating object if in step 30.
Step 34, to the determined investigation object of step 33, determine the control granularity of current investigation according to the array in the option Assembly Listing that produces in the step 32, described control granularity is respectively zone, fundamental block, instruction etc.The optimization option that utilizes the difference control granularity in the option Assembly Listing is investigated function and is meant by the order of zone, fundamental block, instruction and respectively the function zone of makeing mistakes is investigated, and each investigation all is based on the basis of last time investigating the gained option, forms new investigation option by increasing new control granularity option.The concrete operations step is as follows.
A: when the control granularity is zone (Region), need call the option combination that area_option (" rg ") produces the zone.Wherein, parameter " rg " represent that the scope of checking at present is unit with the zone.The area_option function can with in the option array in option switches that should the stage and the option the option of the control in zone being added to come in, thereby realize the optimization range in the zone under certain option control is checked.With a specific embodiment is example, the order behavior of using in compiler :], it comprises two parts, is respectively option names part and assignment part before and after the equal sign.Wherein, $rg_flag_array is whole option array, $rg_flag_array[$n] be used for specifying certain to control option names, $skip_flag be used for specifying be used in this option the suboption-name of control area scope and respectively specified function sequence number and specify the regional sequence number be optimized switch.As " Wb ;-SKIP:glos_skip_rgn_a=fullGtU:4 ", the option names of this option is-Wb,-SKIP:glos_skip_rgn_a, the optimization of expression global command scheduling part (glos), skip and a among the glos_skip_rgn_a (expression after) the global command optimizing scheduling that the back, appointed area is closed in expression, the appointed area here is exactly the 4th zone among the function f ullGtU.
B: when the granularity of investigating is fundamental block, call the option combination that area_option (" bb ") produces fundamental block.Wherein, the present scope of checking of parameter " bb " expression is unit with the fundamental block.The effect of function area_option and aforesaid area_option function are similar, also be will with in the array in option switches that should the stage and the option the option of the control of fundamental block being added to come in, the optimization range of fundamental block is controlled.In a specific embodiment, Ming Linghang $bb_flag_array[$n] $skip_flag=$pu_num%$skip_num is added compile option.Wherein, $bb_flag_array[$n] be used for the control option of fundamental block of specified phases correspondence, $skip_flag be used for specifying be used to control the option of fundamental block scope and respectively specified function sequence number and specify the regional sequence number that is optimized switch.As order line " Wb ;-SKIP:locs_skip_bb_e=fullGtU:3 ", the option names of this option is-Wb,-SKIP:locs_skip_bb_e, the optimizing phase of its expression is the local instruction scheduling optimizing phase (locs), wherein bb represents that the base unit of optimizing is a fundamental block, and the local instruction scheduling optimization of the fundamental block of appointment is closed in skip and e (expression equal) expression, and the appointment fundamental block here is the 3rd fundamental block in the fullGtU function.
C: when the granularity of investigating is instruction, call the option combination that area_option (" op ") produces instruction.Wherein, the present scope of checking of parameter " op " expression is unit with the instruction.The effect of function area_option and aforesaid area_option function are similar, but must add optimal control to fundamental block simultaneously to the inspection of range of instructions, and promptly must specify is the inspection of instructing in which scope.If in the option array that the user provides, do not specify certain fundamental block for investigating object (promptly comprising-the bb option) without any option, the fundamental block that then needs to find among the step b is as specifying fundamental block, $bb_flag_array[$n] $AFTER=$find_bb and $op_flag_array[$n] $skip_flag=$pu_num%$skip_num are added compile option, this group option is made up of two parts, a preceding part is used to refer to decides fundamental block, and a back part has then been specified range of instructions to be looked into.If in the option array that the user provides, specified the fundamental block that needs investigation, then can in fundamental block, specify a certain section investigation scope, the relevant optimization Close All that other fundamental blocks are excellent, as " $bb_flag_array[$n] $AFTER=$find_bb and $bb_flag_array[$n] $BEFORE=$find_bb$op_flag_array[$n] $skip_flag=$pu_num%$skip_num; herein, close the optimization of specifying fundamental block front and back scope with $AFTER and $BEFORE respectively.$op_flag_array[$n] be used for specifying range of instructions is carried out the option that switch is controlled.
After step 35, a by above-mentioned, b, c produce the corresponding option result, can determine the optimization option combination that leads to errors.
The error range of application program can be dwindled by the method for the invention, and provide an option combination, it all is the optimization option that possible lead to errors that each in this option combination optimized option.Person skilled is according to the resulting result of the method for the invention, directly the fault domain and the option of application programs are analyzed, seek the final reason that leads to errors of compiler, also just can find the mistake of compiler itself, thereby save the time that a large amount of mechanization analytic processes take.

Claims (8)

1, a kind of method that mistake in the compiler is located automatically may further comprise the steps:
1), utilize the source file of compiler compiling application program, the file destination of the program that is applied, resulting all file destinations are formed file destinations set;
2), file destination set that step 1) is obtained, utilize dichotomy and method of substitution location to realize location to the false target file in the file destination set;
3), to step 2) the resulting file destination of makeing mistakes, utilize the optimization switch option of the function that compiler provides, in conjunction with dichotomy, the alignment error function;
4), the optimization option switches of from the resulting function of makeing mistakes of step 3), utilizing compiler to provide, in conjunction with dichotomy, the location may cause the wrong optimizing phase, reduces the seek scope of wrong region, the optimization option that optimizing phase that is led to errors at first and compiler lead to errors.
2, the method that the mistake in the compiler is located automatically according to claim 1, it is characterized in that, in the described step 1), do compiling with the source file of correct compiler and compiler application programs to be detected respectively during the source file of compiler compiling application program, obtain file destination set separately, the set of correct compiler compiling gained file destination is designated as correct file set, compiler compiling gained file destination to be detected set is designated as the wrong file set.
3, the method that the mistake in the compiler is located automatically according to claim 1 is characterized in that, described step 2) in, described dichotomy and the method for substitution of utilizing realized location to the false target file specifically comprising:
Set is placed under the different catalogues with wrong file for 2-1, correct file set that step 1) is obtained;
2-2, in each file set, the initial survey scope of file is set, file is sorted according to letter, the value of the minimum point of the scope of investigation is set to 1, corresponding to first file, the value of peak is set to total number of file in this document set, corresponding to last file, the intermediate value of minimum point and peak is set to the value of intermediate point, the file in the middle of corresponding minimum point and the peak;
2-3, judge that whether the value of minimum point is less than the value of peak and 1 difference, if Rule of judgment is false, then alternative document in the file of minimum point representative in the wrong file set and the correct file set is linked and moves, if operation result mistake, then the minimum point file is exactly the wrong file of asking, if operation result is correct, then the peak file is finished the wrong file position fixing process by asking wrong file; If Rule of judgment is set up, to be linked into object code to the file destination between peak behind the intermediate point in file destination between minimum point and the intermediate point in the wrong file set and the correct file set, observe operation result, if operation result is correct, change step 2-4 over to, if the operation result mistake changes step 2-5 over to;
2-4, reset the value of minimum point, the value of former intermediate point is composed to minimum point, and recomputate the value of intermediate point, according to step 2-3 the file between minimum point and peak is judged again then according to the value of the value of peak and new minimum point;
2-5, reset the value of peak, the value of former intermediate point is composed to peak, and recomputate the value of intermediate point, according to step 2-3 the file between minimum point and peak is judged again then according to the value of the value of minimum point and new peak.
4, the method that the mistake in the compiler is located automatically according to claim 1 is characterized in that, in the described step 3), the described optimization switch option of utilizing the function that compiler provides, in conjunction with dichotomy, the alignment error function specifically comprises:
3-1, to step 2) resulting error file, set the initial survey scope of function, the order of all functions in the file according to compiling sorted, the value of investigating the minimum point of scope is made as 1, corresponding to the 1st function, the value of peak is identical with function number in this error file, corresponding to last function, the value of intermediate point is set to the intermediate value of highs and lows, corresponding to the function in the middle of peak and the minimum point;
3-2, judge that whether the value of minimum point is less than the value of peak and 1 difference, if Rule of judgment is false, then open the optimization switch of minimum point function, close the optimization switch of its complementary function simultaneously, move the file destination at function place then, if mistake appears in operation, then the function of minimum point is exactly the error functions of asking, if operation is correct, then the function of peak is withdrawed from the position fixing process of error functions by asking error functions; If Rule of judgment is set up, then open the optimization switch of minimum point to function between intermediate point, close behind the error file intermediate point optimization switch of function between peak, again compile, and the file that compiling is come out is linked into object code again, whether the operation result of object observing code is correct, if correctly change step 3-3 over to, otherwise forwards step 3-4 to;
3-3, reset the value of minimum point, the value of former intermediate point is composed to minimum point, and recomputate the value of intermediate point, according to step 2-3 the file between minimum point and peak is judged again then according to the value of the value of peak and new minimum point;
3-4, reset the value of peak, the value of former intermediate point is composed to peak, and recomputate the value of intermediate point, according to step 2-3 the file between minimum point and peak is judged again then according to the value of the value of minimum point and new peak.
5, the method that the mistake in the compiler is located automatically according to claim 1, it is characterized in that, in the described step 4), the described optimization option switches of utilizing compiler to provide, in conjunction with dichotomy, search the optimizing phase and the relevant option of optimizing that lead to errors at first and make up, specifically comprise:
4-1, the optimizing phase of a certain appointment is checked, closed the optimization option in this optimizing phase one by one,, think that then the optimizing phase of this appointment is the optimizing phase that leads to errors at first when certain Push And Release of optimizing option wherein causes run-time error;
4-2, setting option list file include the Compiler Optimization option that will do switching manipulation in this document;
4-3, will be after the content resolution of the every line command in the option list file deposit in the corresponding array, generate the option Assembly Listing by class;
4-4, utilize the optimization option of the difference control granularity in the option Assembly Listing that function is investigated;
4-5, according to the result who investigates, obtain one and optimize the option combination, described optimization option combination is the set of the optimization option that possible lead to errors.
6, the method that the mistake in the compiler is located automatically according to claim 5, it is characterized in that, among the described step 4-3, described with after the content resolution of the every line command in the option list file by class deposit in corresponding array be meant with the content in the option list file by optimizing phase title, optimization of region gauge tap, fundamental block optimize switch, instruction optimal control switch deposits in the array.
7, the method that the mistake in the compiler is located automatically according to claim 5 is characterized in that, among the described step 4-4, described control granularity comprises zone, fundamental block and instruction.
8, the method that the mistake in the compiler is located automatically according to claim 5, it is characterized in that, among the described step 4-4, the described optimization option that utilizes the zones of different control granularity in the option Assembly Listing is investigated function and is meant by the order of zone, fundamental block, instruction and respectively the function zone of makeing mistakes is investigated, and each investigation all is based on the basis of last time investigating the gained option, forms new investigation option by increasing new control granularity option.
CNB2005100900932A 2005-08-12 2005-08-12 Method of automatic positioning for error in compiler Expired - Fee Related CN100442243C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100900932A CN100442243C (en) 2005-08-12 2005-08-12 Method of automatic positioning for error in compiler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100900932A CN100442243C (en) 2005-08-12 2005-08-12 Method of automatic positioning for error in compiler

Publications (2)

Publication Number Publication Date
CN1912848A true CN1912848A (en) 2007-02-14
CN100442243C CN100442243C (en) 2008-12-10

Family

ID=37721789

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100900932A Expired - Fee Related CN100442243C (en) 2005-08-12 2005-08-12 Method of automatic positioning for error in compiler

Country Status (1)

Country Link
CN (1) CN100442243C (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446134A (en) * 2010-10-13 2012-05-09 无锡江南计算技术研究所 Automatic positioning method and device of compiler error
CN101520737B (en) * 2008-02-27 2014-02-26 三星电子株式会社 Compiling method and processor using the same
WO2015000398A1 (en) * 2013-07-02 2015-01-08 Tencent Technology (Shenzhen) Company Limited Systems and methods for testing terminal applications
CN106445627A (en) * 2016-10-14 2017-02-22 郑州云海信息技术有限公司 Problem positioning method and device in code integration compiling
CN106909500A (en) * 2015-12-23 2017-06-30 黄正兰 The detection method and system of mistake are introduced in Airborne Software development process
CN110704065A (en) * 2019-10-09 2020-01-17 大连理工大学 Compiler front-end differential test method based on illegal program input
CN112506515A (en) * 2019-09-16 2021-03-16 努比亚技术有限公司 Compiling control method, terminal and computer readable storage medium
CN112506515B (en) * 2019-09-16 2024-05-10 努比亚技术有限公司 Compiling control method, terminal and computer readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5754860A (en) * 1996-07-23 1998-05-19 Digital Equipment Corporation Method and apparatus for software testing using a differential testing technique to test compilers
US6223337B1 (en) * 1997-12-12 2001-04-24 Hewlett-Packard Company Random test generation for compiler optimization
SE0202019D0 (en) * 2002-06-28 2002-06-28 Abb As Rehabilitation of a compiler for safety control

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101520737B (en) * 2008-02-27 2014-02-26 三星电子株式会社 Compiling method and processor using the same
CN102446134A (en) * 2010-10-13 2012-05-09 无锡江南计算技术研究所 Automatic positioning method and device of compiler error
CN102446134B (en) * 2010-10-13 2015-04-08 无锡江南计算技术研究所 Automatic positioning method and device of compiler error
WO2015000398A1 (en) * 2013-07-02 2015-01-08 Tencent Technology (Shenzhen) Company Limited Systems and methods for testing terminal applications
US9836380B2 (en) 2013-07-02 2017-12-05 Tencent Technology (Shenzhen) Company Limited Systems and methods for testing terminal applications
CN106909500A (en) * 2015-12-23 2017-06-30 黄正兰 The detection method and system of mistake are introduced in Airborne Software development process
CN106909500B (en) * 2015-12-23 2021-02-02 黄正兰 Method and system for detecting errors introduced in airborne software development process
CN106445627A (en) * 2016-10-14 2017-02-22 郑州云海信息技术有限公司 Problem positioning method and device in code integration compiling
CN112506515A (en) * 2019-09-16 2021-03-16 努比亚技术有限公司 Compiling control method, terminal and computer readable storage medium
CN112506515B (en) * 2019-09-16 2024-05-10 努比亚技术有限公司 Compiling control method, terminal and computer readable storage medium
CN110704065A (en) * 2019-10-09 2020-01-17 大连理工大学 Compiler front-end differential test method based on illegal program input

Also Published As

Publication number Publication date
CN100442243C (en) 2008-12-10

Similar Documents

Publication Publication Date Title
CN1912848A (en) Method of automatic positioning for error in compiler
US20080104096A1 (en) Software development system
CN100435111C (en) Parallel adjusting and performance analyzing method of supporting multi-language multi-platform under isomerized environment
CN105760296A (en) Automation testing control method, device and terminal
Sato et al. On-the-fly detection of precise loop nests across procedures on a dynamic binary translation system
CN101034370A (en) Software system multi-user characteristic testing method and system
US8117604B2 (en) Architecture cloning for power PC processors
CN102446134B (en) Automatic positioning method and device of compiler error
US10402309B2 (en) Code coverage tracking for a microcontroller program
Schimmel et al. Automatic generation of parallel unit tests
CN104199770A (en) Automated mobile phone music APK testing method
CN1932766A (en) Semi-automatic parallel method of large serial program code quantity-oriented field
CN102521135B (en) The method of testing of linear system and device
CN104123397A (en) Automatic test device and method for Web page
CN101551748B (en) Optimized compiling method
Hong et al. Evaluation of model checkers by verifying message passing programs
CN101055542A (en) Symbol debug method and system in cross integration development environment
CN104536880A (en) GUI program testing case augmentation method based on symbolic execution
CN101937389A (en) Method for acquiring compilation process of detected software packet by code analysis tool
CN100437476C (en) Processing of a compileable computer program
CN116382700A (en) Automatic debugging method and system for VLIW and SIMD architecture-oriented compiler
CN1848093A (en) Method for debugging high configuration and power supply interface module in basic inputting and outputting system
CN114780374A (en) Compiler defect positioning method based on fine-grained optimization option configuration difference
CN112860316A (en) Kernel of openEular open source system and BSP transplanting method
CN111078193A (en) Software development method and system for data analysis 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
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: DONGGUAN LIANZHOU ELECTRONIC TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: INSTITUTE OF COMPUTING TECHNOLOGY, CHINESE ACADEMY OF SCIENCES

Effective date: 20130116

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 100080 HAIDIAN, BEIJING TO: 523000 DONGGUAN, GUANGDONG PROVINCE

TR01 Transfer of patent right

Effective date of registration: 20130116

Address after: 523000 Yuquan Industrial Zone, Fenggang Town, Guangdong, Dongguan

Patentee after: Dongguan Lianzhou Electronic Technology Co., Ltd.

Address before: 100080 Haidian District, Zhongguancun Academy of Sciences, South Road, No. 6, No.

Patentee before: Institute of Computing Technology, Chinese Academy of Sciences

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20081210

Termination date: 20150812

EXPY Termination of patent right or utility model