⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opncls.texi

📁 gdb-6.0 linux 下的调试工具
💻 TEXI
字号:
@section Opening and closing BFDs@findex bfd_openr@subsubsection @code{bfd_openr}@strong{Synopsis}@examplebfd *bfd_openr(const char *filename, const char *target);@end example@strong{Description}@*Open the file @var{filename} (using @code{fopen}) with the target@var{target}.  Return a pointer to the created BFD.Calls @code{bfd_find_target}, so @var{target} is interpreted as bythat function.If @code{NULL} is returned then an error has occured.   Possible errorsare @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or@code{system_call} error.@findex bfd_fdopenr@subsubsection @code{bfd_fdopenr}@strong{Synopsis}@examplebfd *bfd_fdopenr(const char *filename, const char *target, int fd);@end example@strong{Description}@*@code{bfd_fdopenr} is to @code{bfd_fopenr} much like @code{fdopen} is to@code{fopen}.  It opens a BFD on a file already described by the@var{fd} supplied.When the file is later @code{bfd_close}d, the file descriptor willbe closed.  If the caller desires that this file descriptor becached by BFD (opened as needed, closed as needed to freedescriptors for other opens), with the supplied @var{fd} used asan initial file descriptor (but subject to closure at any time),call bfd_set_cacheable(bfd, 1) on the returned BFD.  The defaultis to assume no cacheing; the file descriptor will remain openuntil @code{bfd_close}, and will not be affected by BFD operationson other files.Possible errors are @code{bfd_error_no_memory},@code{bfd_error_invalid_target} and @code{bfd_error_system_call}.@findex bfd_openstreamr@subsubsection @code{bfd_openstreamr}@strong{Synopsis}@examplebfd *bfd_openstreamr(const char *, const char *, PTR);@end example@strong{Description}@*Open a BFD for read access on an existing stdio stream.  Whenthe BFD is passed to @code{bfd_close}, the stream will be closed.@findex bfd_openw@subsubsection @code{bfd_openw}@strong{Synopsis}@examplebfd *bfd_openw(const char *filename, const char *target);@end example@strong{Description}@*Create a BFD, associated with file @var{filename}, using thefile format @var{target}, and return a pointer to it.Possible errors are @code{bfd_error_system_call}, @code{bfd_error_no_memory},@code{bfd_error_invalid_target}.@findex bfd_close@subsubsection @code{bfd_close}@strong{Synopsis}@examplebfd_boolean bfd_close (bfd *abfd);@end example@strong{Description}@*Close a BFD. If the BFD was open for writing, then pendingoperations are completed and the file written out and closed.If the created file is executable, then @code{chmod} is calledto mark it as such.All memory attached to the BFD is released.The file descriptor associated with the BFD is closed (evenif it was passed in to BFD by @code{bfd_fdopenr}).@strong{Returns}@*@code{TRUE} is returned if all is ok, otherwise @code{FALSE}.@findex bfd_close_all_done@subsubsection @code{bfd_close_all_done}@strong{Synopsis}@examplebfd_boolean bfd_close_all_done (bfd *);@end example@strong{Description}@*Close a BFD.  Differs from @code{bfd_close} since it does notcomplete any pending operations.  This routine would be usedif the application had just used BFD for swapping and didn'twant to use any of the writing code.If the created file is executable, then @code{chmod} is calledto mark it as such.All memory attached to the BFD is released.@strong{Returns}@*@code{TRUE} is returned if all is ok, otherwise @code{FALSE}.@findex bfd_create@subsubsection @code{bfd_create}@strong{Synopsis}@examplebfd *bfd_create(const char *filename, bfd *templ);@end example@strong{Description}@*Create a new BFD in the manner of @code{bfd_openw}, but withoutopening a file. The new BFD takes the target from the targetused by @var{template}. The format is always set to @code{bfd_object}.@findex bfd_make_writable@subsubsection @code{bfd_make_writable}@strong{Synopsis}@examplebfd_boolean bfd_make_writable (bfd *abfd);@end example@strong{Description}@*Takes a BFD as created by @code{bfd_create} and converts itinto one like as returned by @code{bfd_openw}.  It does thisby converting the BFD to BFD_IN_MEMORY.  It's assumed thatyou will call @code{bfd_make_readable} on this bfd later.@strong{Returns}@*@code{TRUE} is returned if all is ok, otherwise @code{FALSE}.@findex bfd_make_readable@subsubsection @code{bfd_make_readable}@strong{Synopsis}@examplebfd_boolean bfd_make_readable (bfd *abfd);@end example@strong{Description}@*Takes a BFD as created by @code{bfd_create} and@code{bfd_make_writable} and converts it into one like asreturned by @code{bfd_openr}.  It does this by writing thecontents out to the memory buffer, then reversing thedirection.@strong{Returns}@*@code{TRUE} is returned if all is ok, otherwise @code{FALSE}.@findex bfd_alloc@subsubsection @code{bfd_alloc}@strong{Synopsis}@examplePTR bfd_alloc (bfd *abfd, size_t wanted);@end example@strong{Description}@*Allocate a block of @var{wanted} bytes of memory attached to@code{abfd} and return a pointer to it.@findex bfd_calc_gnu_debuglink_crc32@subsubsection @code{bfd_calc_gnu_debuglink_crc32}@strong{Synopsis}@exampleunsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len);@end example@strong{Description}@*Computes a CRC value as used in the .gnu_debuglink section.Advances the previously computed @var{crc} value by computingand adding in the crc32 for @var{len} bytes of @var{buf}.@strong{Returns}@*Return the updated CRC32 value.@findex get_debug_link_info@subsubsection @code{get_debug_link_info}@strong{Synopsis}@examplechar * get_debug_link_info (bfd * abfd, unsigned long * crc32_out)@end example@strong{Description}@*fetch the filename and CRC32 value for any separate debuginfoassociated with @var{abfd}. Return NULL if no such info found,otherwise return filename and update @var{crc32_out}.@findex separate_debug_file_exists@subsubsection @code{separate_debug_file_exists}@strong{Synopsis}@examplebfd_boolean separate_debug_file_exists (char * name, unsigned long crc32)@end example@strong{Description}@*Checks to see if @var{name} is a file and if its contentsmatch @var{crc32}.@findex find_separate_debug_file@subsubsection @code{find_separate_debug_file}@strong{Synopsis}@examplechar * find_separate_debug_file (bfd *abfd)@end example@strong{Description}@*Searches @var{abfd} for a reference to separate debugginginformation, scans various locations in the filesystem, includingthe file tree rooted at @var{debug_file_directory}, and returns afilename of such debugging information if the file is found and hasmatching CRC32.  Returns NULL if no reference to debugging fileexists, or file cannot be found.@findex bfd_follow_gnu_debuglink@subsubsection @code{bfd_follow_gnu_debuglink}@strong{Synopsis}@examplechar * bfd_follow_gnu_debuglink(bfd *abfd, const char *dir);@end example@strong{Description}@*Takes a BFD and searches it for a .gnu_debuglink section.  If thissection is found, examines the section for the name and checksum ofa '.debug' file containing auxiliary debugginginformation. Searches filesystem for .debug file in some standardlocations, including the directory tree rooted at @var{dir}, and iffound returns the full filename. If @var{dir} is NULL, will searchdefault path configured into libbfd at build time.@strong{Returns}@*@code{NULL} on any errors or failure to locate the .debug file,otherwise a pointer to a heap-allocated string containing thefilename. The caller is responsible for freeing this string.@findex bfd_add_gnu_debuglink@subsubsection @code{bfd_add_gnu_debuglink}@strong{Synopsis}@examplebfd_boolean bfd_add_gnu_debuglink (bfd * abfd, const char * filename);@end example@strong{Description}@*Takes a @var{BFD} and adds a .gnu_debuglink section containing a linkto the specified @var{filename}.  The filename should be relative tothe current directory.@strong{Returns}@*@code{TRUE} is returned if all is ok.  Otherwise @code{FALSE} is returnedand bfd_error is set.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -