Hello, This is related to: http://sourceware.org/ml/gdb-patches/2013-01/msg00748.html. Changes from this patch are needed to finish off the work started in that thread. As per Jan's request, this patch adds 'build-id' to the gdbserver response. The value is hex encoded string representing .note.gnu.build-id section of the corresponding shared library. Majority of the patch is refactoring to reuse code. The real change is in gdbserver/linux-low.c. Thanks, Aleksandar Ristovski QNX Software Systems ChangeLog: * Makefile.in (HFILES_NO_SRCDIR): Add linux-maps.h and linux-maps.c. * linux-tdep.c (linux-maps.h): Include. (read_mapping): Moved to linux-maps.c. (linux_find_memory_region_ftype): Moved to linux-maps.h. (linux_find_memory_regions_full): Moved to linux-maps.c. (linux_find_memory_regions): Check for fake_pid_p to match functionality of original linux_find_memory_regions_full. (linux_make_mappings_corefile_notes): Ditto. * utils.c (HIGH_BYTE_POSN): Moved to common-utils.c. (is_digit_in_base): Ditto. (digit_to_int): Ditto. (strtoulst): Ditto. * utils.h (strtoulst): Moved to common-utils.h. * common/common-utils.c (TARGET_CHAR_BIT): Define if not defined. (HOST_CHAR_BIT): Ditto. (ctype.h): Include. (string.h): Include. (assert.h): Include. (HIGH_BYTE_POSN): Moved from utils.c. (is_digit_in_base): Ditto. (digit_to_int): Ditto. (strtoulst): Ditto. (hchar): Hex charset for hex_encode. (hex_encode): New function. (decode_hex_ch): Ditto. (hex_decode): Ditto. * common/common-utils.h (strtoulst): Moved from utils.h. (hex_encode): New declaration. (hex_decode): Ditto. * common/linux-maps.c: New file. * common/linux-maps.h: New file. * common/xml-utils.h (xml_hex_encode_text): Declare. * config/i386/linux.mh (NATDEPFILES): Add linux-maps.o. * config/i386/linux64.mh (NATDEPFILES): Add linux-maps.o. * gdbserver/Makefile.in (linux-maps.o): New. * gdbserver/configure.srv (srv_tgtobj): Add linux-maps.o. * gdbserver/linux-low.c (linux-maps.h): Include. (find_memory_region_callback_data): New structure definition. (find_memory_region_callback): New forward declaration. (find_memory_region_callback): New function. (get_hex_build_id): New function. (linux_qxfer_libraries_svr4): Add hex encoded build-id to the reply.