发明名称 Generation of language bindings for libraries using data from compiler generated debug information
摘要 Described herein is a method and apparatus for generating automatic language bindings. The method includes receiving a request for a first program module in a first language from a second program module in a second language. A binding module is created in the second language in response to the request, where the binding module is generated from debug data of the first program module. The binding module is returned to the second program module. The second program module can then access the functionality of the first program module through use of the functions of the binding module.
申请公布号 US9639375(B2) 申请公布日期 2017.05.02
申请号 US200812200806 申请日期 2008.08.28
申请人 Red Hat, Inc. 发明人 Jones Peter
分类号 G06F9/45;G06F9/44;G06F9/54 主分类号 G06F9/45
代理机构 Lowenstein Sandler LLP 代理人 Lowenstein Sandler LLP
主权项 1. A method comprising: receiving a request to access a first program component from a second program component at runtime of the second program component in a language runtime environment provided by a processing device wherein the first program component is in a first language, wherein the second program component and the language runtime environment are in a second language, and wherein the first language is different than the second language; in response to receiving the request, automatically issuing an import command in the second program component and automatically importing, from a binder component file stored in persistent storage, a binder component in the second language into the language runtime environment in response to an import command in the second program component,during the importing of the binder component, automatically initiating a process to access and analyze debug data of the first program component, wherein the debug data is stored in the persistent storage, the debug data is generated by a compiler for the first language during compilation of the first program component, and wherein the debug data comprises calling-convention information for one or more functions in the first program component, andautomatically creating, by the binder component in the language runtime environment, a binding component in the second language by iterating through the debug data of the first program component, wherein creating the binding component comprises determining, by the binder component, that a list of functions in the debug data identifies a first function and, in response, adding, by the binder component a second function to the calling-convention information of the first function in the debug data, wherein calling the second function in the binding component results in calling the first function in the first program component; and returning the binding component to the second program component, wherein the second function in the binding component is callable by the second program component at runtime.
地址 Raleigh NC US