From e234ce54cdef1a963ff3a19e4aac661245d4d765 Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Sat, 20 Jun 2020 14:24:53 +0200 Subject: [PATCH] Save the PDB file name in CodeView info We don't actually use this yet. --- bfd/peXXigen.c | 8 ++++---- include/coff/internal.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index 71d47ae..913bf1c 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -1176,7 +1176,7 @@ _bfd_XXi_slurp_codeview_record (bfd * abfd, file_ptr where, unsigned long length memcpy (&(cvinfo->Signature[8]), &(cvinfo70->Signature[8]), 8); cvinfo->SignatureLength = CV_INFO_SIGNATURE_LENGTH; - // cvinfo->PdbFileName = cvinfo70->PdbFileName; + strncpy(cvinfo->PdbFileName, cvinfo70->PdbFileName, sizeof(cvinfo->PdbFileName) - 1); return cvinfo; } @@ -1187,7 +1187,7 @@ _bfd_XXi_slurp_codeview_record (bfd * abfd, file_ptr where, unsigned long length cvinfo->Age = H_GET_32(abfd, cvinfo20->Age); memcpy (cvinfo->Signature, cvinfo20->Signature, 4); cvinfo->SignatureLength = 4; - // cvinfo->PdbFileName = cvinfo20->PdbFileName; + strncpy(cvinfo->PdbFileName, cvinfo20->PdbFileName, sizeof(cvinfo->PdbFileName) - 1); return cvinfo; } @@ -2726,9 +2726,9 @@ pe_print_debugdata (bfd * abfd, void * vfile) sprintf (&signature[i*2], "%02x", cvinfo->Signature[i] & 0xff); /* xgettext:c-format */ - fprintf (file, _("(format %c%c%c%c signature %s age %ld)\n"), + fprintf (file, _("(format %c%c%c%c signature %s age %ld pdb_file %s)\n"), buffer[0], buffer[1], buffer[2], buffer[3], - signature, cvinfo->Age); + signature, cvinfo->Age, cvinfo->PdbFileName); } } diff --git a/include/coff/internal.h b/include/coff/internal.h index 31a9e41..dfc39a3 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -167,7 +167,7 @@ typedef struct _CODEVIEW_INFO char Signature[CV_INFO_SIGNATURE_LENGTH]; unsigned int SignatureLength; unsigned long Age; - // char PdbFileName[]; + char PdbFileName[220]; //HACK } CODEVIEW_INFO; /* Default image base for NT. */