CN103294457B - Method and device for dynamically substituting C/C + + function in main program - Google Patents

Method and device for dynamically substituting C/C + + function in main program Download PDF

Info

Publication number
CN103294457B
CN103294457B CN201210047538.9A CN201210047538A CN103294457B CN 103294457 B CN103294457 B CN 103294457B CN 201210047538 A CN201210047538 A CN 201210047538A CN 103294457 B CN103294457 B CN 103294457B
Authority
CN
China
Prior art keywords
function
replaced
replacement
bytecode
program module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210047538.9A
Other languages
Chinese (zh)
Other versions
CN103294457A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201210047538.9A priority Critical patent/CN103294457B/en
Publication of CN103294457A publication Critical patent/CN103294457A/en
Application granted granted Critical
Publication of CN103294457B publication Critical patent/CN103294457B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a method and a device for dynamically substituting a C/C + + function in a main program. The method includes steps as follows: the main program is started, and a substitution program module used for inquiring and modifying a memory is loaded; the loaded substitution program module is initialized, so that the substitution program module is executed in advance of a main function in the main program; symbol table information of a function in the main program is stored in the memory; after the substitution program module receives a substitution instruction, the substitution program module determines a mapping address of a substituted function in the memory according to symbol table information corresponding to the substituted function; and the substituted function is substituted according to the mapping address. The method and the device can dynamically substitute and restore the function during operation of the program, the program is not required to be recompiled, time is saved, high efficiency is realized, and the infinite loop phenomenon when the substituted function is indirectly called inside a substitution function is avoided.

Description

The method and device of c/c++ function in dynamic replacement mastery routine
Technical field
The present invention relates to computer science and technology field, particularly to c/c++ function in a kind of dynamic replacement mastery routine Method and device.
Background technology
Carry out during the work such as debugging, mock and the test of c/c++ program replacing it is often necessary to use function under linux. Function is replaced to refer to be covered using replacement function and is replaced function.The technology replacing c/c++ function under existing linux is mainly logical Cross setting ld_preload environmental variable, the disposable shared library that loads to complete function replacement when program starts.Loading During, if there being function of the same name in shared library, such as malloc etc., then can automatically corresponding system function malloc be replaced with Replacement function malloc in shared library.
Although existing method can realize function replacing, have the disadvantage in that
(1) method arranging ld_preload environmental variable under linux is disposably to be loaded when program starts, because This can not dynamically replace when program is run and reduce shared built-in function.Enter line function every time to replace, be required for reloading Shared library, startup program, therefore operating time are long, replace efficiency low.
(2) system function due to being replaced will be substituted completely, if therefore indirectly adjusted in the inside of replacement function With the system function being replaced, then replacement function will be led to repeat to call itself, thus causing endless loop.
(3) method of setting ld_preload environmental variable can only load shared built-in function, and therefore existing method can not be replaced Change the function in unshared storehouse, such as user-defined function etc., therefore bring inconvenience for the use of user.
Content of the invention
The purpose of the present invention is intended at least solve one of above-mentioned technological deficiency.
For this reason, it is an object of the invention to propose a kind of dynamic replacement mastery routine in c/c++ function method, in c/c++ When function is replaced, it is capable of dynamically replacing and going back original function when program is run, need not program be compiled, save time height again Effect, and avoid indirectly calling the infinite loop phenomenon being replaced function appearance inside replacement function.The method can apply to The debugging of c/c++ program, mock and test etc..In a preferred embodiment of the invention, the present invention is applied under linux.
For reaching above-mentioned purpose, embodiment of the invention discloses that in a kind of dynamic replacement mastery routine c/c++ function side Method.The method comprises the following steps: starts mastery routine, and loads the replacement program module for inquiring about and changing internal memory;To plus The described replacement program module carrying is initialized so that described replacement program module is held prior to the principal function in described mastery routine OK, and by the symbol table information of function in described mastery routine it is saved in internal memory;Receive replacement in described replacement program module After instruction, described replacement program module is replaced function in institute according to be replaced the corresponding symbol table information of function and determine State the image address in internal memory;And according to described image address, the described function that is replaced is replaced.
The embodiment of the present invention loads the replacement program module for inquiring about and changing internal memory while starting mastery routine.When When entering line function replacement, function is completed by the memory mapping that replacement program module dynamically changes program when program is run and replaces Change process, therefore need not change the binary file of program, and source code need not be compiled again, permissible when program is run Dynamically replace and reduce, improve the efficiency of program.
And, due to saving, when changing and being replaced function corresponding memory mapping address, the address being replaced function, Therefore avoid when replacement function is disposably loaded when program starts by environmental variable method, in the replacement function of appearance The infinite loop phenomenon being replaced function is called in portion indirectly.
Additionally, the embodiment of the present invention completes function replacement by replacing program module modification memory mapping, therefore replace Function be not restricted to shared built-in function, replace scope and can expand to unshared built-in function, user can self-defined replacement letter Number.
In one embodiment of the invention, described be replaced function be kinematic function, described according to described image address To described be replaced function and be replaced further include: the described image address being replaced function is backed up;And will The described image address being replaced function replaces with the image address of new function.
The embodiment of the present invention is passed through to be backed up before the image address of renewal function so that function replacement process can return Trace back, thus realizing the dynamic reduction of replacement function.
In one embodiment of the invention, described be replaced function be static function, described according to described image address To described be replaced function and be replaced further include: be replaced according to the described image address being replaced function determines The entry address of function;According to the described entry address being replaced function, the described corresponding bytecode of function that is replaced is divided into One section of bytecode and second segment bytecode, wherein, are divided with instruction for elementary cell, described first paragraph bytecode is from letter Number entrance to length is longer than the minimum length bytecode of remote immediate skip;Described first paragraph bytecode is backed up to new storage allocation, And the relative address in first paragraph bytecode described in described new storage allocation redirected be revised as absolute address and redirect;Described Add the first remote immediate skip, described first remote immediate skip jumps to described the after first paragraph bytecode described in new storage allocation Two-stage nitration bytecode;And the described function corresponding first paragraph bytecode that is replaced is revised as the second remote immediate skip, described second Remote immediate skip jumps to the image address of new function.
The embodiment of the present invention is passed through new storage allocation and is changed and be replaced function so that function replacement process can be recalled, Thus realizing being replaced the dynamic reduction of function.
In one embodiment of the invention, described replacement program module as shared library, by the ld_preload of linux Environmental variable is loaded.
Wherein, specifically, carry out loading by the described ld_preload environmental variable of described linux to further include: set Putting described ld_preload environmental variable is to be compiled into the independence that the described replacement program module of described shared library and user write Stubs, wherein, the initialization function of the independent stubs that described user writes can be configured to the dynamic replacement of function; Start described mastery routine.
In one embodiment of the invention, described replacement program module, as static library, is carried out by link during compiling Load, further include: by application programming interface (api), the dynamic replacement of function is set in described mastery routine Put;Add the link pointing to described replacement program module and described mastery routine is compiled in described mastery routine, wherein, institute State replacement program module by compiling and being used as static library;Start described mastery routine.
For reaching above-mentioned purpose, embodiments of the invention also disclose c/c++ function in a kind of dynamic replacement mastery routine Device, comprising: replace program module, for inquiring about and changing internal memory, and after receiving replacement instruction, according to being replaced letter The corresponding symbol table information of number is replaced image address in described internal memory for the function described in determining, and according to described image ground Location is replaced to the described function that is replaced;And load and initialization module, for loading and initializing described replacement program Module is so that described replacement program module executes prior to the principal function in described mastery routine, and the symbol by function in described mastery routine Number table information is saved in internal memory.
The aspect that the present invention adds and advantage will be set forth in part in the description, and partly will become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description
The above-mentioned and/or additional aspect of the present invention and advantage will become from the following description of the accompanying drawings of embodiments Substantially and easy to understand, wherein:
Fig. 1 is the FB(flow block) flow process according to the method for c/c++ function in the dynamic replacement mastery routine of the embodiment of the present invention Figure;
Fig. 2 is the method schematic diagram of c/c++ function in the dynamic replacement mastery routine of the specific embodiment of the invention;And
Fig. 3 is the structure drawing of device according to c/c++ function in the dynamic replacement mastery routine of the embodiment of the present invention.
Specific embodiment
Embodiments of the invention are described below in detail, the example of described embodiment is shown in the drawings, wherein from start to finish The element that same or similar label represents same or similar element or has same or like function.Below with reference to attached The embodiment of figure description is exemplary, is only used for explaining the present invention, and is not construed as limiting the claims.
The method flow of c/c++ function in dynamic replacement mastery routine according to embodiments of the present invention is described below with reference to Fig. 1 Figure.As shown in Fig. 2 the method schematic diagram for c/c++ function in the dynamic replacement mastery routine of the specific embodiment of the invention.Preferably Ground, the present invention is used under Linux system, will taking Linux system as a example be described below in an example.
Step s110: start mastery routine, and load replacement program module.In an embodiment of the present invention, this replacement program Module is used for replacing program module inquiry and modification internal memory.
Specifically, the embodiment of the present invention can load the replacement for inquiring about and changing internal memory by one of following two modes Program module:
Mode one, program module can be replaced as shared library, carried out by the ld_preload environmental variable of linux plus Carry.
More specifically, the embodiment of the present invention enters one by the step that the ld_preload environmental variable of linux is loaded Step includes:
Step s1111: setting ld_preload environmental variable is replacement program module and the user's volume being compiled into shared library The independent stubs write, wherein, the initialization function of the independent stubs that user writes can be carried out to the dynamic replacement of function Setting.
Step s1112: start mastery routine.
Due to being arranged to ld_preload environmental variable, when mastery routine starts, program can first load replacement journey Sequence module simultaneously calls the independent stubs that user writes.The initialization function of the independent stubs that user writes can be to function Dynamic replacement is configured, and therefore, completes the setting of dynamic replacement while calling the independent stubs that user writes.
Mode two, also can replace program module as static library, be loaded by link during compiling.
Wherein, the embodiment of the present invention will replace program module as static library, the step being loaded by link during compiling Suddenly further include:
Step s1121: by application programming interface (api), the dynamic replacement of function is set in mastery routine Put.
Step s1122: add in mastery routine and point to the link replacing program module and mastery routine is compiled, its In, replace program module by compiling and being used as static library.
Step s1123: start mastery routine.
Step s120: the replacement program module loading is initialized so that being replaced program module prior in mastery routine Principal function executes, and the symbol table information of function in mastery routine is saved in internal memory.
In one embodiment of the invention, c/c++ keyword _ _ attribute__ ((constructor)) can be passed through Defined attribute function, wherein this attribute function initialize to replacing program module.The execution of this function is prior in mastery routine Principal function, and the constructed fuction attribute of this attribute function can with auto-initiation replace program module, therefore replace program The execution of module is prior to mastery routine.The initialization function replacing control module can analyze the binary file of mastery routine, thus Obtain the symbol table information of function and be saved in internal memory.
Step s130: replacing after program module receives replacement instruction, replace program module according to being replaced function Corresponding symbol table information determination is replaced image address in internal memory for the function.In one embodiment of the invention, replace Program module can be by searching the information that the symbol table of function obtains being replaced function, so that it is determined that being replaced function in internal memory Image address.
Step s140: be replaced to being replaced function according to image address.
Specifically, according to being replaced, function is kinematic function to replacement process or static function can be divided into two ways:
(1) if being replaced function is kinematic function, according to image address to being replaced the step that function is replaced Further include:
Step s1411: the image address being replaced function is backed up.
By being backed up the image address being replaced function so that function replacement process can be recalled, thus realizing It is replaced the dynamic reduction of function.
Step s1412: the image address being replaced function is replaced with the image address of new function.
Hereafter when mastery routine is run will call function, when lookup is replaced function, will be to replacing from symbol table information The image address of exchange the letters number, thus complete function replacement process.
(2) if being replaced function is static function, according to image address to being replaced the step that function is replaced Further include:
Step s1421: the image address according to being replaced function determines the entry address being replaced function.
Step s1422: the entry address according to being replaced function will be replaced the corresponding bytecode of function and be divided into first paragraph Bytecode and second segment bytecode, wherein, first paragraph bytecode is that length is longer than from function entrance to instruct as elementary cell The minimum length bytecode of remote immediate skip.Because first paragraph bytecode will be changed to remote immediate skip, therefore must be longer than far in length The minimum length bytecode of immediate skip, and in order to keep the integrity instructing, need in intercepted length to instruct as substantially single Unit.
Step s1423: first paragraph bytecode is backed up to new storage allocation, and by first paragraph bytecode in new storage allocation In relative address redirect and be revised as absolute address and redirect.
Step s1424: add the first remote immediate skip, the first remote immediate skip after first paragraph bytecode in new storage allocation Jump to second segment bytecode.In new storage allocation, first paragraph bytecode interpolation the first remote immediate skip challenges second segment byte Code, and the relative address in first paragraph bytecode redirects and is revised as absolute address and redirects, and step s1423 is complete with step s1424 Become the backup to the image address being replaced function so that function replacement process can be recalled, thus realizing being replaced function Dynamic reduction.
Step s1425: function corresponding first paragraph bytecode will be replaced and be revised as the second remote immediate skip, the second remote jump refers to Order jumps to the image address of new function.When calling this static function, program finds the entry address of function, the function of execution For replacement function.Reach the purpose that kinematic function is replaced by replacing the bytecode residing in internal memory of static function.
Either adopt static or dynamic method, the embodiment of the present invention is passed through dynamically to change program when program is run Memory mapping, it is to avoid modification program binary file enter line function replace, source code need not compile again, improves program Efficiency.It is replaced function corresponding memory mapping address due to changing, but preserves the address being replaced function simultaneously, it is to avoid logical Cross environmental variable method disposably during loading replacement function, indirectly to call inside the replacement function of appearance and replaced when program starts The infinite loop phenomenon of exchange the letters number.And the function that the method for the embodiment of the present invention can be replaced is not restricted to shared built-in function, replaces Change range expansion to unshared built-in function, user can be with self-defined replacement function.
As shown in figure 3, being the structure drawing of device according to c/c++ function in the dynamic replacement mastery routine of the embodiment of the present invention. The device being somebody's turn to do c/c++ function in dynamic replacement mastery routine under linux includes replacing program module 110 and loads and initialization mould Block 120.Replace program module 110 to be used for inquiring about and change internal memory, and after receiving replacement instruction, according to being replaced function Corresponding symbol table information is replaced image address in described internal memory for the function described in determining, and according to described image address The described function that is replaced is replaced.Load and initialization module 120 be used for loading and initialize replacement program module 110 with So that replacement program module 110 is executed prior to the principal function in mastery routine, and the symbol table information of function in mastery routine is saved in In internal memory.
In one embodiment of the invention, being replaced function can be kinematic function, then replace program module 110 and will be replaced The image address of exchange the letters number is backed up, and the image address being replaced function is replaced with the image address of new function.
In one embodiment of the invention, being replaced function can be static function, replace program module 110 according to being replaced The image address determination of exchange the letters number is replaced the entry address of function and will be replaced letter according to the entry address being replaced function The corresponding bytecode of number is divided into first paragraph bytecode and second segment bytecode, wherein, is divided with instruction for elementary cell, the One section of bytecode is the minimum length bytecode being longer than remote immediate skip from function entrance to length.Then replace program module 110 First paragraph bytecode is backed up to new storage allocation, and after first paragraph bytecode in new storage allocation, adds the first remote jump and refer to Make, and function corresponding first paragraph bytecode will be replaced and be revised as the second remote immediate skip, wherein, the first remote immediate skip is used for Jump to second segment bytecode, the second remote immediate skip is used for jumping to the image address of new function.
In one embodiment of the invention, replace program module 110 as shared library, by the ld_preload of linux Environmental variable is loaded.
In another embodiment of the present invention, replace program module 110 as static library, tapped into by chain during compiling Row loads.
In one embodiment of the invention, load and initialization module 120 pass through c/c++ keyword _ _ Attribute__ ((constructor)) defined attribute function, wherein, attribute function initializes to replacing program module.
The embodiment of the present invention loads the replacement program module 110 for inquiring about and changing internal memory while starting mastery routine And load and initialization module 120.When entering line function replacement, dynamic when program is run by replacing program module 110 The memory mapping of modification program, to complete function replacement process, therefore need not change the binary file of program, and need not be to source Code is compiled again, can dynamically replace when program is run and reduce, improve the efficiency of program.
And, due to saving, when changing and being replaced function corresponding memory mapping address, the address being replaced function, Therefore avoid when replacement function is disposably loaded when program starts by environmental variable method, in the replacement function of appearance The infinite loop phenomenon being replaced function is called in portion indirectly.
Additionally, the embodiment of the present invention completes function replacement by replacing program module modification memory mapping, therefore replace Function be not restricted to shared built-in function, replace scope and can expand to unshared built-in function, user can self-defined replacement letter Number.
In the description of this specification, reference term " embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or the spy describing with reference to this embodiment or example Point is contained at least one embodiment or the example of the present invention.In this manual, to the schematic representation of above-mentioned term not Necessarily refer to identical embodiment or example.And, the specific features of description, structure, material or feature can be any One or more embodiments or example in combine in an appropriate manner.
Although an embodiment of the present invention has been shown and described, for the ordinary skill in the art, permissible Understand and can carry out multiple changes, modification, replacement to these embodiments without departing from the principles and spirit of the present invention And modification, the scope of the present invention by claims and its equivalent limits.

Claims (14)

1. in a kind of dynamic replacement mastery routine the method for c/c++ function it is characterised in that comprising the following steps:
Start mastery routine, and load the replacement program module for inquiring about and changing internal memory;
The described replacement program module loading is initialized so that described replacement program module is prior in described mastery routine Principal function executes, and the symbol table information of function in described mastery routine is saved in internal memory;
After described replacement program module receives replacement instruction, described replacement program module is corresponding according to being replaced function Symbol table information is replaced image address in described internal memory for the function described in determining;And
It is replaced the type of function described in determination, according to described image address, the described function that is replaced is replaced.
2. in dynamic replacement mastery routine as claimed in claim 1 the method for c/c++ function it is characterised in that described determination institute State the type being replaced function, according to described image address, the described function that is replaced be replaced, comprising:
When the described type being replaced function is kinematic function type, the described image address being replaced function is carried out standby Part;And
The described image address being replaced function is replaced with the image address of new function.
3. in dynamic replacement mastery routine as claimed in claim 1 the method for c/c++ function it is characterised in that described determination institute State the type being replaced function, according to described image address, the described function that is replaced be replaced, comprising:
When the described type being replaced function is static function type, according to the described image address being replaced function determines It is replaced the entry address of function;
The described corresponding bytecode of function that is replaced is divided into by first paragraph bytecode according to the described entry address being replaced function With second segment bytecode, wherein, divided with instruction for elementary cell, described first paragraph bytecode is from function entrance to length Degree is longer than the minimum length bytecode of remote immediate skip;
Described first paragraph bytecode is backed up to new storage allocation, and by first paragraph bytecode described in described new storage allocation Relative address redirect and be revised as absolute address and redirect;
Add the first remote immediate skip, described first remote immediate skip is used after first paragraph bytecode described in described new storage allocation In jumping to described second segment bytecode;And
The described function corresponding first paragraph bytecode that is replaced is revised as the second remote immediate skip, described second remote immediate skip is used for Jump to the image address of new function.
4. in dynamic replacement mastery routine as claimed in claim 1 the method for c/c++ function it is characterised in that described replacement journey Sequence module, as shared library, is loaded by the ld_preload environmental variable of linux.
5. in dynamic replacement mastery routine as claimed in claim 4 c/c++ function method it is characterised in that described by linux Described ld_preload environmental variable carry out loading and further include:
Arranging described ld_preload environmental variable is to be compiled into the described replacement program module of described shared library and user writes Independent stubs, wherein, the initialization function of the independent stubs that described user writes can be carried out to the dynamic replacement of function Setting;And
Start described mastery routine.
6. in dynamic replacement mastery routine as claimed in claim 1 the method for c/c++ function it is characterised in that described replacement journey Sequence module, as static library, is loaded by link during compiling.
7. in dynamic replacement mastery routine as claimed in claim 6 the method for c/c++ function it is characterised in that described replacement journey Sequence module, as described static library, carries out loading by link during compiling and further includes:
Described mastery routine is configured to the dynamic replacement of function by application programming interface api;
Add the link pointing to described replacement program module and described mastery routine is compiled in described mastery routine, wherein, Described replacement program module is by compiling and being used as static library;And
Start described mastery routine.
8. in dynamic replacement mastery routine as claimed in claim 1 the method for c/c++ function it is characterised in that being closed by c/c++ Key word _ _ attribute__ ((constructor)) defined attribute function, wherein, described attribute function is to described replacement program Module is initialized.
9. in a kind of dynamic replacement mastery routine c/c++ function device it is characterised in that include:
Replace program module, for inquiring about and changing internal memory, and after receiving replacement instruction, should according to being replaced function pair Symbol table information determine described in be replaced image address in described internal memory for the function, and determine described in be replaced function Type, and according to described image address, the described function that is replaced is replaced;And
Load and initialization module, for load and initialize described replacement program module so that described replacement program module prior to Principal function execution in described mastery routine, and the symbol table information of function in described mastery routine is saved in internal memory.
10. in dynamic replacement mastery routine as claimed in claim 9 the device of c/c++ function it is characterised in that described replacement journey Sequence module specifically for:
When the described type being replaced function is kinematic function type, the described image address being replaced function is carried out standby Part, and the described image address being replaced function is replaced with the image address of new function.
In 11. dynamic replacement mastery routines as claimed in claim 9, the device of c/c++ function is it is characterised in that described replacement journey Sequence module specifically for:
When the described type being replaced function is static function type, institute is determined according to the described image address being replaced function State the entry address being replaced function and the corresponding word of function is replaced by described according to the described entry address being replaced function Section code division is first paragraph bytecode and second segment bytecode, wherein, is divided with instruction for elementary cell, described first paragraph word Section code is the minimum length bytecode being longer than remote immediate skip from function entrance to length, and described first paragraph bytecode is backed up to New storage allocation, and add the first remote immediate skip after first paragraph bytecode described in described new storage allocation, and by institute State and be replaced function corresponding first paragraph bytecode and be revised as the second remote immediate skip, wherein, described first remote immediate skip is used for jumping Go to described second segment bytecode, described second remote immediate skip is used for jumping to the image address of new function.
In 12. dynamic replacement mastery routines as claimed in claim 9, the device of c/c++ function is it is characterised in that described replacement journey Sequence module, as shared library, is loaded by the ld_preload environmental variable of linux.
In 13. dynamic replacement mastery routines as claimed in claim 9, the device of c/c++ function is it is characterised in that described replacement journey Sequence module, as static library, is loaded by link during compiling.
In 14. dynamic replacement mastery routines as claimed in claim 9 c/c++ function device it is characterised in that described loading and Initialization module passes through c/c++ keyword _ _ attribute__ ((constructor)) defined attribute function, wherein, described genus Property function pair described in replace program module initialized.
CN201210047538.9A 2012-02-27 2012-02-27 Method and device for dynamically substituting C/C + + function in main program Active CN103294457B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210047538.9A CN103294457B (en) 2012-02-27 2012-02-27 Method and device for dynamically substituting C/C + + function in main program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210047538.9A CN103294457B (en) 2012-02-27 2012-02-27 Method and device for dynamically substituting C/C + + function in main program

Publications (2)

Publication Number Publication Date
CN103294457A CN103294457A (en) 2013-09-11
CN103294457B true CN103294457B (en) 2017-02-01

Family

ID=49095401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210047538.9A Active CN103294457B (en) 2012-02-27 2012-02-27 Method and device for dynamically substituting C/C + + function in main program

Country Status (1)

Country Link
CN (1) CN103294457B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105278942B (en) * 2014-07-23 2020-11-06 腾讯科技(深圳)有限公司 Component management method and device
CN104504333B (en) * 2014-11-25 2018-03-06 武汉安天信息技术有限责任公司 Malicious code detecting method and device in ELF files
CN105630491A (en) * 2015-12-18 2016-06-01 Tcl集团股份有限公司 Method and device for changing functions of program
CN108614702B (en) * 2016-12-28 2022-02-11 阿里巴巴集团控股有限公司 Byte code optimization method and device
CN107085514B (en) * 2017-03-06 2021-02-19 北京安博通科技股份有限公司 Shared library upgrading method and device
CN114840204A (en) * 2021-02-02 2022-08-02 华为技术有限公司 Function jump method and device for non-homonymous symbols and computer readable storage medium
CN116149732B (en) * 2023-02-15 2023-10-27 深圳大学 Hardware automatic execution method, system and product of data flow task
CN116414424B (en) * 2023-06-09 2023-09-12 建信金融科技有限责任公司 Thermal updating method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6668340B1 (en) * 1999-12-10 2003-12-23 International Business Machines Corporation Method system and program for determining a test case selection for a software application
CN1475909A (en) * 2002-08-16 2004-02-18 华为技术有限公司 realization of isertion type system soft ware patch and control method
US6708324B1 (en) * 1999-06-24 2004-03-16 Cisco Technology, Inc. Extensible automated testing software
CN1710547A (en) * 2004-06-16 2005-12-21 华为技术有限公司 Software detection method and system
CN101004681A (en) * 2006-12-22 2007-07-25 中兴通讯股份有限公司 Method for implementing long jumping dynamic patch in embedded system
CN102156661A (en) * 2010-02-11 2011-08-17 华为技术有限公司 Method, device and system for online activating patches

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6708324B1 (en) * 1999-06-24 2004-03-16 Cisco Technology, Inc. Extensible automated testing software
US6668340B1 (en) * 1999-12-10 2003-12-23 International Business Machines Corporation Method system and program for determining a test case selection for a software application
CN1475909A (en) * 2002-08-16 2004-02-18 华为技术有限公司 realization of isertion type system soft ware patch and control method
CN1710547A (en) * 2004-06-16 2005-12-21 华为技术有限公司 Software detection method and system
CN101004681A (en) * 2006-12-22 2007-07-25 中兴通讯股份有限公司 Method for implementing long jumping dynamic patch in embedded system
CN102156661A (en) * 2010-02-11 2011-08-17 华为技术有限公司 Method, device and system for online activating patches

Also Published As

Publication number Publication date
CN103294457A (en) 2013-09-11

Similar Documents

Publication Publication Date Title
CN103294457B (en) Method and device for dynamically substituting C/C + + function in main program
US8566372B2 (en) Method and device for dynamically loading relocatable file
US9021436B2 (en) Automatic reconnection of debugger to a reactivated application
CN102799456A (en) Method and device for uploading resource files by game engine, and computer
US8806436B2 (en) Systems and methods for debugging applications using dual code generation
CN102207881A (en) Quick operation system start-up method based on Android
US8381198B2 (en) Systems, methods and computer program products for safety checking executable application programs in a module
CN109634618B (en) TMS320C 674X-based serial boot loader loading self-starting method for processor secondary boot loader
CN102467448A (en) Test method and system of test case
US20060123397A1 (en) Apparatus and method for optimization of virtual machine operation
CN102567049A (en) Upgrade method of embedded operating system
CN102681893A (en) Cross-platform implementation method for executable programs and mobile terminal
CN104407886A (en) Curing and loading method of embedded software guiding separation from target
CN103116522B (en) The kernel program dynamic switching method of dsp chip and control system
CN102364442A (en) Method for transplanting Wine from x86 to advanced risc machine (ARM) platform
CN101334737A (en) Embedded equipment start-up or reset method
US20130024663A1 (en) Table Call Instruction for Frequently Called Functions
CN103309741B (en) Call the method and apparatus of pin function
CN102243587B (en) To the upgrade method of ROM program in embedded system
CN101303651B (en) Service processing method and user equipment using the method
CN105824750A (en) Soft breakpoint simulation method during NorFlash program space debugging
US20090319988A1 (en) Software optimization device and software optimization method
CN105573796A (en) Function switching method and function switching device for FPGA
CN102169446A (en) BIOS (basic input/output system) system and method based on basic input/output system of open source system
CN104866345A (en) Storage method of executable code under ARMv7m architecture

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