From 7c50a93137df660f7b2d9d68c0db748a9cb7868f Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 4 Dec 2014 11:32:24 -0800 Subject: New python attribute gdb.Objfile.build_id. gdb/ChangeLog: * NEWS: Mention gdb.Objfile.build_id. * build-id.c (build_id_bfd_get): Make non-static. * build-id.h (build_id_bfd_get): Add declaration. * python/py-objfile.c: #include "build-id.h", "elf-bfd.h". (OBJFPY_REQUIRE_VALID): New macro. (objfpy_get_build_id): New function. (objfile_getset): Add "build_id". * utils.c (make_hex_string): New function. * utils.h (make_hex_string): Add declaration. gdb/doc/ChangeLog: * python.texi (Objfiles In Python): Document Objfile.build_id. gdb/testsuite/ChangeLog: * lib/gdb.exp (get_build_id): New function. (build_id_debug_filename_get): Rewrite to use it. * gdb.python/py-objfile.exp: Add test for objfile.build_id. --- gdb/doc/python.texi | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gdb/doc/python.texi') diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 63db2b2..a951410 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -3495,6 +3495,17 @@ class. The file name of the objfile as a string. @end defvar +@defvar Objfile.build_id +The build ID of the objfile as a string. +If the objfile does not have a build ID then the value is @code{None}. + +This is supported only on some operating systems, notably those which use +the ELF format for binary files and the @sc{gnu} Binutils. For more details +about this feature, see the description of the @option{--build-id} +command-line option in @ref{Options, , Command Line Options, ld.info, +The GNU Linker}. +@end defvar + @defvar Objfile.progspace The containing program space of the objfile as a @code{gdb.Progspace} object. @xref{Progspaces In Python}. -- cgit v1.1