Summary of the invention
The embodiment of the present invention provides a kind of hot patch method and apparatus, for by between patch function and patch function
Apart from it is too long when, reduce the probability that system break and the system failure caused by hot patch process occur.
The embodiment of the present invention provides a kind of hot patch method, comprising:
In the code for determining program to be repaired by patch function between patch function at a distance from be greater than short jump
When maximum jump range, acquisition jumps function information table;Wherein, jumping function information table includes in advance in the generation of program to be repaired
Multiple address and the service conditions for jumping each of function and jumping function being inserted into code;
It each of include address and the service condition for jumping function in function information table according to jumping, from jumping function letter
Determine that at least one for being in unused state jumps function in breath table;Wherein, at least one jumps function and includes at least the
One jumps function;First, which jumps function, is not more than the short maximum jump range jumped with by the distance between patch function;
Function is jumped according at least one determined, generation jumps channel;Wherein, it jumps channel and jumps function with first
Function is jumped for starting, channel is jumped and finally jumps to patch function;
Addition first is short before by patch function jumps function, wherein the first short function that jumps is for from by patch function
It jumps to first jumped in channel and jumps function, and then by jumping channel hop to patch function.
Optionally, function is jumped according at least one determined, generation jumps channel, specifically includes:
If it is determined that at least one, which jumps function, meets first condition, then:
Determine first jump function not and be it is short jump function when, jumping function setup for first is short to jump function;
Function is jumped not determining that at least one jumps in function also included N number of second and jumps any of function second
It is short when jumping function, will is not that short to jump the second of function to jump function setup be short to jump function;
According to determine be it is short jump the first of function and jump function and N number of third jumps function, generate by first
It jumps function and what N number of third jumped function composition jumps channel;Wherein, the last one jumped in channel second jumps function
Jump to patch function;
Wherein, first condition are as follows: first jumps function and N number of second to jump function be short when jumping function, is short jump
Turn the first of function and jump function and N number of second to jump the total of function and execute the execution that the time is no longer than a long jump function
Time.
Optionally, jumping in function information table further includes each function name for jumping function;
According to determine be it is short jump the first of function and jump function and N number of second jump function, generate by first
Jump function and N number of second jump function composition jump channel after, further includes:
From jumping in function information table, by first jump function and N number of second jump function function name be changed to short jump
Turn the function name of function;
From jumping in function information table, by first jump function and N number of second jump function service condition be identified as
Use state.
Optionally, function is jumped according at least one determined, generation jumps channel, specifically includes:
If it is determined that at least one, which jumps function, is unsatisfactory for first condition, then:
When determining first to jump function not being long jump function, jumping function setup for first is long jump function;
Jump function according to be set as long jump function first, generate by first jump that function forms jump channel;
It jumps and is set as the first of long jump function jumping function and jumping to patch function in channel.
Optionally, jumping in function information table further includes each function name for jumping function;
Jump function according to be set as long jump function first, generate by first jump that function forms jump channel it
Afterwards, further includes:
From jumping in function information table, the function name that first jumps function is changed to the function name of long jump function;
From jumping in function information table, the service condition that first jumps function is identified as use state.
Optionally, it obtains before jumping function information table, further includes:
Multiple location points are determined in the code of program to be repaired;
Link script by treating repair procedure is modified, and each location point insertion in multiple location points is multiple
Jump function;
Be inserted into the unified code for extracting program to be repaired it is all jump each of function jump function function name,
Address and service condition, generation jump function information table.
Optionally, in multiple location points any one location point insertion it is multiple jump function be it is short jump function and/or
Long jump function;
If a location point in multiple location points be inserted into it is multiple jump function be it is short jump function, the location point insert
Enter it is multiple jump at least one of function jump the occupied position range of function be a long jump function it is occupied
Position range.
Optionally, the distance between adjacent two location point in multiple location points is not more than the short maximum jump jumped
Range;Or
Each location point in multiple location points is located at the adjacent two sections of codes in all codes of program to be repaired included
Intermediate position.
The embodiment of the present invention provides a kind of hot patch equipment, comprising:
Acquiring unit, in the code for determining program to be repaired by patch function between patch function at a distance from
When greater than the short maximum jump range jumped, acquisition jumps function information table;Wherein, jump function information table include in advance to
Multiple address and the service conditions for jumping each of function and jumping function being inserted into the code of repair procedure;
Determination unit, for according to jump include in function information table each jump function address and use feelings
Condition determines that at least one for being in unused state jumps function from jumping in function information table;Wherein, at least one is jumped
Function includes at least first and jumps function;First, which jumps function, is not more than the short maximum jumped with by the distance between patch function
Jump range;
Generation unit, for jumping function according at least one determined, generation jumps channel;Wherein, channel is jumped
Function is jumped with first and jumps function for starting, is jumped channel and is finally jumped to patch function;
Processing unit, for before by patch function addition first short jump function, wherein the first short function that jumps is used for
It jumps first in channel from being jumped to by patch function and jumps function, and then by jumping channel hop to patch function.
Optionally, generation unit is specifically used for:
If it is determined that at least one, which jumps function, meets first condition, then:
Determine first jump function not and be it is short jump function when, jumping function setup for first is short to jump function;
Function is jumped not determining that at least one jumps in function also included N number of second and jumps any of function second
It is short when jumping function, will is not that short to jump the second of function to jump function setup be short to jump function;
According to determine be it is short jump the first of function and jump function and N number of third jumps function, generate by first
It jumps function and what N number of third jumped function composition jumps channel;Wherein, the last one jumped in channel second jumps function
Jump to patch function;
Wherein, first condition are as follows: first jumps function and N number of second to jump function be short when jumping function, is short jump
Turn the first of function and jump function and N number of second to jump the total of function and execute the execution that the time is no longer than a long jump function
Time.
Optionally, jumping in function information table further includes each function name for jumping function;
Processing unit is also used to:
According to determine be it is short jump the first of function and jump function and N number of second jump function, generate by the
One jump function and N number of second jump function composition jump channel after, from jumping in function information table, jump letter for first
Several and the N number of second function name for jumping function is changed to the short function name for jumping function;
From jumping in function information table, by first jump function and N number of second jump function service condition be identified as
Use state.
Optionally, generation unit is specifically used for:
If it is determined that at least one, which jumps function, is unsatisfactory for first condition, then:
When determining first to jump function not being long jump function, jumping function setup for first is long jump function;
Jump function according to be set as long jump function first, generate by first jump that function forms jump channel;
It jumps and is set as the first of long jump function jumping function and jumping to patch function in channel.
Optionally, jumping in function information table further includes each function name for jumping function;
Processing unit is also used to:
Jumping function according to being set as the first of long jump function, generate by first jump that function forms jump channel
Later, from jumping in function information table, the function name that first jumps function is changed to the function name of long jump function;
From jumping in function information table, the service condition that first jumps function is identified as use state.
Optionally, further include extracting unit, be used for:
Multiple location points are determined in the code of program to be repaired;
Link script by treating repair procedure is modified, and each location point insertion in multiple location points is multiple
Jump function;
Be inserted into the unified code for extracting program to be repaired it is all jump each of function jump function function name,
Address and service condition, generation jump function information table.
Optionally, in multiple location points any one location point insertion it is multiple jump function be it is short jump function and/or
Long jump function;
If a location point in multiple location points be inserted into it is multiple jump function be it is short jump function, the location point insert
Enter it is multiple jump at least one of function jump the occupied position range of function be a long jump function it is occupied
Position range.
Optionally, the distance between adjacent two location point in multiple location points is not more than the short maximum jump jumped
Range;Or
Each location point in multiple location points is located at the adjacent two sections of codes in all codes of program to be repaired included
Intermediate position.
In the embodiment of the present invention, in the code for determining program to be repaired by between patch function and patch function away from
When from being greater than the short maximum jump range jumped, acquisition jumps function information table;Wherein, jumping function information table includes existing in advance
Multiple address and the service conditions for jumping each of function and jumping function being inserted into the code of program to be repaired;According to jump
Turn each of to include address and the service condition for jumping function in function information table, determines source in function information table from jumping
At least one in unused state jumps function;Wherein, at least one jumps function and jumps function including at least first;First
It jumps function and is not more than the short maximum jump range jumped with by the distance between patch function;According at least one determined
Function is jumped, generation jumps channel;Wherein, jumping channel and jumping function with first is that starting jumps function, and it is last to jump channel
Jump to patch function;Addition first short jumps function before by patch function, wherein the first short function that jumps is for from being mended
Fourth function jumps to first jumped in channel and jumps function, and then by jumping channel hop to patch function.Due to true
Fixed to be greater than the short maximum jump range jumped by the distance between patch function and patch function, having pre-established can jump to
Patch function jumps channel, later by the first short function that jumps from being jumped directly to jump channel by patch function, in this way,
Then avoid in the prior art by long jump from program interrupt generated when being reoriented to patch function by patch function and
The problem of system failure.
Specific embodiment
In order to which the purpose of the present invention, technical solution and beneficial effect is more clearly understood, below in conjunction with attached drawing and implementation
Example, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only used to explain this hair
It is bright, it is not intended to limit the present invention.
First in the embodiment of the present invention jump function, second jump function, be to jump function, function can be jumped to be short
Can also be long jump function, first it is short jump function be it is short jump function, therein first, second is used only for the mesh distinguished
's.
Fig. 1 illustrates a kind of flow diagram of hot patch method provided in an embodiment of the present invention.
As shown in Figure 1, a kind of hot patch method provided in an embodiment of the present invention, comprising:
Step 101, in the code for determining program to be repaired by patch function between patch function at a distance from be greater than
When the short maximum jump range jumped, acquisition jumps function information table;Wherein, jumping function information table includes in advance to be repaired
Multiple address and the service conditions for jumping each of function and jumping function being inserted into the code of program;
It step 102, each of include address and the service condition for jumping function in function information table according to jumping, from jump
Turn to determine that at least one for being in unused state jumps function in function information table;Wherein, at least one jumps function extremely
Function is jumped including first less;First, which jumps function, is not more than the short maximum jump model jumped with by the distance between patch function
It encloses;
Step 103, function is jumped according at least one determined, generation jumps channel;Wherein, channel is jumped with first
It jumps function and jumps function for starting, jump channel and finally jump to patch function;
Step 104, addition first is short before by patch function jumps function, wherein the first short function that jumps is used for from quilt
Patch function jumps to first jumped in channel and jumps function, and then by jumping channel hop to patch function.
Due to determine by patch function between patch function at a distance from be greater than the short maximum jump range jumped, in advance
The channel that jumps that can jump to patch function is established, is directly jumped by the first short function that jumps from by patch function later
To channel is jumped, patch function when institute is reoriented to from by patch function by long jump in the prior art in this way, then avoiding
The problem of program interrupt and the system failure of generation.
Optionally, in the embodiment of the present invention, before acquisition jumps function information table, further includes:
Multiple location points are determined in the code of program to be repaired;Link script by treating repair procedure is repaired
Change, each location point insertion in multiple location points is multiple to jump function;It is inserted into the unified code for extracting program to be repaired
All function name, address and service conditions for jumping each of function and jumping function, generation jump function information table.It can
See, without extending compiler in the embodiment of the present invention, just with the link script of compiler itself, realizes simpler
Just, reduce the cost of exploitation and maintenance.
Optionally, in multiple location points any one location point insertion it is multiple jump function be it is short jump function and/or
Long jump function;If a location point in multiple location points be inserted into it is multiple jump function be it is short jump function, the position
Multiple at least one of functions that jump of point insertion jump the occupied position range of function as shared by a long jump function
Position range.
Three location points are determined, in first location point
Insertion it is multiple jump function be it is short jump function, the multiple functions that jump being inserted into second location point are long jump
Function, the multiple functions that jump being inserted into third location point include that the short of part jumps function and partial long jump letter
Number.Preferably, the multiple functions that jump being inserted into first location point are short when jumping function, in order to which the later period facilitates
The short function that jumps being inserted into one location point is changed to long jump function, multiple the jumping in function extremely of location point insertion
It is an occupied position range of long jump function that few one, which jumps the occupied position range of function, that is to say, that, it should
Reserved at least one short position for jumping function can by the short position for jumping function and being revised as long jump function, with
The phase needs to determine in first position Dian Chu one that can modify long jump function short to jump function after an action of the bowels.
Specifically, one jumps function and is used, and the service condition for jumping function is that this is jumped at function at this time
In use state;When this jumps function and is not used by, the service condition for jumping function is that this jumps function and be in and does not make at this time
Use state.The address for jumping function is that this jumps specific address information of the function in the link script of the program to be repaired, i.e.,
This, which can be found, by the address jumps function.If the function name that one jumps function is modified in use,
Then the function name for jumping function should also be modified in jumping function information table.
Optionally, the distance between adjacent two location point in multiple location points is not more than the short maximum jump jumped
Range;Or each location point in multiple location points is located at the adjacent two sections of codes in all codes of program to be repaired included
Intermediate position.
Specifically, file of the corresponding code of program to be repaired before not formed image file is known as linking script,
Linking includes multistage code segment in script, can be inserted into multiple jump between the two sections of code segments that are connected in advance in the embodiment of the present invention
Function.
Preferably, since the initial position of the code of program to be repaired, multiple jump is inserted into every first distance length
Function, first distance length be not more than the short maximum jump range jumped, in this way, no matter which of the code of program to be repaired
Part needs to carry out hot patch, can carry out determining that first jumps function near hot patch in the needs, first jumps letter
Number with need to carry out hot patch by the distance between patch function no more than the short maximum jump range jumped.
Another optionally embodiment is to determine several location points in the link script of program to be repaired, this is several
A location point is the position that possible need to carry out hot patch in the future, is inserted into multiple jump near the several location points determined
Function, in this way, can be carried out in the needs when then the location point in the several location points determined needs to carry out hot patch
Determine that first jumps function near hot patch, first jump function and need to carry out hot patch by between patch function
Distance is not more than the short maximum jump range jumped.
Optionally, it in above-mentioned steps 101, is jumped at a distance between patch function no more than short determining by patch function
Maximum jump range when, add second before by patch function and short jump function, wherein the second short function that jumps is for from quilt
Patch function jumps to patch function.Specifically, second is added by modification or increased mode before by patch function
It is short to jump function, in this way, that is, execution second is short jumps function, and due to the second short jump when program is run to by patch function
Turn function and jumps to patch function, therefore, programming jump to patch function, and patch function is run, it runs and ties in patch function
After beam, jumps back to and needed to run the code by after patch function by the ending of patch function.
Include a variety of implementations in above-mentioned steps 103, provides following two specific embodiment in the embodiment of the present invention.
It needs to determine that at least one jumps whether function meets first condition in following manner one and mode two, optionally, the
One condition are as follows: first jumps function and N number of second to jump function be short when jumping function, jumps the first of function to be short and jumps
Function and N number of second jumps the total of function and executes the execution time that the time is no longer than a long jump function.At this point, not will
First jump function and it is N number of jump function setup be it is short jump function, only determine when first jump function and it is N number of second jump
Turning function is short when jumping function, for it is short jump the first of function and jump function and N number of second jump total execution of function
Whether the time is no longer than the execution time of a long jump function, exports judging result after judgement, in judgement at least one
It is a to jump in the step of whether function meets first condition, function can't be jumped to first and N each second jumps the letter of function
It is several to carry out practical change.
In another optional embodiment, it is possible to determine that whether N is greater than threshold value, because N is not more than threshold value, then first jumps
Turn function and N number of second to jump function be short when jumping function, for it is short jump the first of function and jump function and N number of second jump
The total execution time for turning function is centainly no longer than the execution time of a long jump function.Therefore, first condition can also be N
No more than threshold value.
Mode one, however, it is determined that at least one jumps function and meets first condition, then to jump function not be short determining first
When jumping function, function setup is jumped by first and jumps function to be short;Determining that it is also included N number of in function that at least one is jumped
Second, which jumps any of function second, jumps function not and is short when jumping function, will short jump the second of function and jump letter
Number is set as short and jumps function;If it is determined that first jump function and N number of second jump function and be it is short jump function, then without into
Row operation.
Later according to determine be it is short jump the first of function and jump function and N number of third jumps function, generate by
First jumps function and what N number of third jumped function composition jumps channel;Wherein, the last one jumped in channel second jumps
Function jumps to patch function.
Optionally, according to determine be it is short jump the first of function and jump function and N number of second jump function, generate
By first jump function and N number of second jump that function forms jump channel after, from jumping in function information table, first is jumped
Turn function and N number of second jump function function name be changed to the short function name for jumping function;It, will from jumping in function information table
First jump function and N number of second jump function service condition be identified as use state.
Specifically, in a kind of embodiment, N zero, at this point, first each in function information table jumping function according to jumping
Address and service condition, determine that first jumps function, at this point, first jumps function and be in unused state, and first
It jumps function and, no more than the short maximum jump range jumped, first jumps function and patch letter by the distance between patch function
The distance between number is not more than the short maximum jump range jumped.It jumps in channel and only jumps function including one first.
Patch function is loaded in the code of program to be repaired at this time, and jumps function to first and modifies, so that modified
One, which jumps function, jumps to patch function.After jumping channel and establishing connection with patch function, added before by patch function
First short jumps function, wherein the first short function that jumps is for jumping first in channel and jumping from being jumped to by patch function
Function, and then by jumping channel hop to patch function.
In another embodiment, N is not zero, at this point, first basis jumps each ground for jumping function in function information table
Location and service condition determine that first jumps function and N number of second and jump function, at this point, first jumps function and N number of
Two, which jump function, is in unused state.First, which jumps function and N number of second, jumps function according to location information composition one
Sequence, first jump function and N number of second jump function composition (N+1) it is a jump in function, adjacent two on position
The distance between function is jumped no more than the short maximum jump range jumped, the so adjacent two short function that jumps can be realized
It jumps.Function is jumped by first jumping function composition with N number of second and jump channel, first to jump function be to jump channel at this time
First short to jump function, the last one jumped in channel second jumps function and needs to jump to patch function.And due to
One, which jumps function, no more than the short maximum jump range jumped, is jumping channel and patch letter with by the distance between patch function
Number is established after connection, and first is added before by patch function and short jumps function, wherein the first short function that jumps is for from being mended
Fourth function jumps to first jumped in channel and jumps function, and then by jumping channel hop to patch function.
Mode two, however, it is determined that at least one jumps function and is unsatisfactory for first condition, then is determining that first jumps function not and be
When long jump function, jumping function setup for first is long jump function;Determine first jump function be long jump function when,
Then without operation.
Jump function according to being set as the first of long jump function later, generate by first jump that function forms jump it is logical
Road;It jumps and is set as the first of long jump function jumping function and jumping to patch function in channel.
Optionally, function is jumped according to be set as long jump function first, generates and jumps the jump that function forms by first
After turning channel, from jumping in function information table, the function name that first jumps function is changed to the function name of long jump function;
From jumping in function information table, the service condition that first jumps function is identified as use state.
In this way, state first jump function and N number of second jump function total execution time be longer than a long jump letter
Several execution time then jumps function for first and is revised as long jump function, and jumps function and patch function foundation for first
Connection jumps channel only and includes first and jumps function, jump channel and patch function establishes connection, in this way, can then save
Program runtime.
Fig. 2 illustrates the flow diagram of another hot patch method provided in an embodiment of the present invention.
In order to more clearly introduce above method process, another hot patch method and step of offer in the embodiment of the present invention,
As shown in Figure 2, comprising:
Step 201, each location point insertion in advance in multiple location points in the link script of program to be repaired is more
It is a to jump function, wherein the distance between each adjacent two location point is not more than the short maximum jump range jumped;
Step 202, all each of the functions that jump being inserted into the unified code for extracting program to be repaired jump function
Function name, address and service condition, generation jump function information table;
Step 203, patch function is loaded in the code of program to be repaired;
Step 204, judge whether big by the distance between patch function and patch function in the code of program to be repaired
In the short maximum jump range jumped, if it is not, thening follow the steps 205;If so, thening follow the steps 206;
Step 205, addition second is short before by patch function jumps function, wherein the second short function that jumps is used for from quilt
Patch function jumps to patch function;
It step 206, each of include address and the service condition for jumping function in function information table according to jumping, from jump
Turn to determine that at least one for being in unused state jumps function in function information table, wherein at least one jumps function at least
Function is jumped including first;
Step 207, judge that at least one jumps whether function meets first condition, if so, thening follow the steps 208;If no
It is to then follow the steps 209;
Step 208, then at least one is jumped to the first function for including in function and N number of second function is disposed as short jump
Turn function, and generate and jump channel, jumping channel is to jump function starting from first, jumps function by N number of second and jumps to
Patch function;Addition first is short before by patch function jumps function, wherein the first short function that jumps is for from by patch function
It jumps to first jumped in channel and jumps function, and then by jumping channel hop to patch function;
Step 209, jumping function setup for first is long jump function, and makes first to jump function and jump to patch letter
Number;Addition first is short before by patch function jumps function, wherein the first short function that jumps from by patch function for jumping to
It jumps first in channel and jumps function, and then by jumping channel hop to patch function;
Step 210, patch function is run.
It can be seen from the above: in the code for determining program to be repaired by between patch function and patch function
Distance be greater than the short maximum jump range jumped when, acquisition jump function information table;Wherein, it includes pre- for jumping function information table
Multiple address and the service conditions for jumping each of function and jumping function being first inserted into the code of program to be repaired;Root
Each of include address and the service condition for jumping function in function information table according to jumping, is determined from jumping in function information table
Source jumps function at least one of unused state;Wherein, at least one jumps function and jumps function including at least first;
First, which jumps function, is not more than the short maximum jump range jumped with by the distance between patch function;According to determining at least
One jumps function, and generation jumps channel;Wherein, jumping channel and jumping function with first is that starting jumps function, jumps channel
Finally jump to patch function;Addition first short jumps function before by patch function, wherein first it is short jump function for from
First jumped in channel is jumped to by patch function and jumps function, and then by jumping channel hop to patch function.Due to
Determine by patch function between patch function at a distance from be greater than the short maximum jump range jumped, having pre-established can jump
The channel that jumps of patch function is gone to, later by the first short function that jumps from being jumped directly to jump channel by patch function,
In this way, then avoiding in the prior art by long jump from program generated when being reoriented to patch function by patch function
The problem of disconnected and system failure.
Fig. 3 illustrates a kind of structural schematic diagram of hot patch equipment provided in an embodiment of the present invention.
Based on same idea, the embodiment of the present invention provides a kind of hot patch equipment 300, as shown in figure 3, including acquiring unit
301, determination unit 302, generation unit 303, processing unit 304 further include optionally extracting unit 305:
Acquiring unit, in the code for determining program to be repaired by patch function between patch function at a distance from
When greater than the short maximum jump range jumped, acquisition jumps function information table;Wherein, jump function information table include in advance to
Multiple address and the service conditions for jumping each of function and jumping function being inserted into the code of repair procedure;
Determination unit, for according to jump include in function information table each jump function address and use feelings
Condition determines that at least one for being in unused state jumps function from jumping in function information table;Wherein, at least one is jumped
Function includes at least first and jumps function;First, which jumps function, is not more than the short maximum jumped with by the distance between patch function
Jump range;
Generation unit, for jumping function according at least one determined, generation jumps channel;Wherein, channel is jumped
Function is jumped with first and jumps function for starting, is jumped channel and is finally jumped to patch function;
Processing unit, for before by patch function addition first short jump function, wherein the first short function that jumps is used for
It jumps first in channel from being jumped to by patch function and jumps function, and then by jumping channel hop to patch function.
Optionally, generation unit is specifically used for:
If it is determined that at least one, which jumps function, meets first condition, then:
Determine first jump function not and be it is short jump function when, jumping function setup for first is short to jump function;
Function is jumped not determining that at least one jumps in function also included N number of second and jumps any of function second
It is short when jumping function, will is not that short to jump the second of function to jump function setup be short to jump function;
According to determine be it is short jump the first of function and jump function and N number of third jumps function, generate by first
It jumps function and what N number of third jumped function composition jumps channel;Wherein, the last one jumped in channel second jumps function
Jump to patch function;
Wherein, first condition are as follows: first jumps function and N number of second to jump function be short when jumping function, is short jump
Turn the first of function and jump function and N number of second to jump the total of function and execute the execution that the time is no longer than a long jump function
Time.
Optionally, jumping in function information table further includes each function name for jumping function;
Processing unit is also used to:
According to determine be it is short jump the first of function and jump function and N number of second jump function, generate by the
One jump function and N number of second jump function composition jump channel after, from jumping in function information table, jump letter for first
Several and the N number of second function name for jumping function is changed to the short function name for jumping function;
From jumping in function information table, by first jump function and N number of second jump function service condition be identified as
Use state.
Optionally, generation unit is specifically used for:
If it is determined that at least one, which jumps function, is unsatisfactory for first condition, then:
When determining first to jump function not being long jump function, jumping function setup for first is long jump function;
Jump function according to be set as long jump function first, generate by first jump that function forms jump channel;
It jumps and is set as the first of long jump function jumping function and jumping to patch function in channel.
Optionally, jumping in function information table further includes each function name for jumping function;
Processing unit is also used to:
Jumping function according to being set as the first of long jump function, generate by first jump that function forms jump channel
Later, from jumping in function information table, the function name that first jumps function is changed to the function name of long jump function;
From jumping in function information table, the service condition that first jumps function is identified as use state.
Optionally, further include extracting unit, be used for:
Multiple location points are determined in the code of program to be repaired;
Link script by treating repair procedure is modified, and each location point insertion in multiple location points is multiple
Jump function;
Be inserted into the unified code for extracting program to be repaired it is all jump each of function jump function function name,
Address and service condition, generation jump function information table.
Optionally, in multiple location points any one location point insertion it is multiple jump function be it is short jump function and/or
Long jump function;
If a location point in multiple location points be inserted into it is multiple jump function be it is short jump function, the location point insert
Enter it is multiple jump at least one of function jump the occupied position range of function be a long jump function it is occupied
Position range.
Optionally, the distance between adjacent two location point in multiple location points is not more than the short maximum jump jumped
Range;Or
Each location point in multiple location points is located at the adjacent two sections of codes in all codes of program to be repaired included
Intermediate position.
It can be seen from the above: in the code for determining program to be repaired by between patch function and patch function
Distance be greater than the short maximum jump range jumped when, acquisition jump function information table;Wherein, it includes pre- for jumping function information table
Multiple address and the service conditions for jumping each of function and jumping function being first inserted into the code of program to be repaired;Root
Each of include address and the service condition for jumping function in function information table according to jumping, is determined from jumping in function information table
Source jumps function at least one of unused state;Wherein, at least one jumps function and jumps function including at least first;
First, which jumps function, is not more than the short maximum jump range jumped with by the distance between patch function;According to determining at least
One jumps function, and generation jumps channel;Wherein, jumping channel and jumping function with first is that starting jumps function, jumps channel
Finally jump to patch function;Addition first short jumps function before by patch function, wherein first it is short jump function for from
First jumped in channel is jumped to by patch function and jumps function, and then by jumping channel hop to patch function.Due to
Determine by patch function between patch function at a distance from be greater than the short maximum jump range jumped, having pre-established can jump
The channel that jumps of patch function is gone to, later by the first short function that jumps from being jumped directly to jump channel by patch function,
In this way, then avoiding in the prior art by long jump from program generated when being reoriented to patch function by patch function
The problem of disconnected and system failure.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the present invention
Form.It is deposited moreover, the present invention can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.