Diff of /libutil++/bfd_support.cpp [85d9b9] .. [2dcd13]  Maximize  Restore

Switch to unified view

a/libutil++/bfd_support.cpp b/libutil++/bfd_support.cpp
...
...
25
#include <elf.h>
25
#include <elf.h>
26
#include <cstdlib>
26
#include <cstdlib>
27
#include <cstring>
27
#include <cstring>
28
#include <cassert>
28
#include <cassert>
29
#include <iostream>
29
#include <iostream>
30
#include <sstream>
30
#include <fstream>
31
#include <fstream>
31
#include <sstream>
32
#include <sstream>
32
#include <string>
33
#include <string>
33
#include <cstring>
34
#include <cstring>
34
#include <cstdlib>
35
#include <cstdlib>
...
...
79
        file.read(buffer, sizeof(buffer));
80
        file.read(buffer, sizeof(buffer));
80
        file_crc = calc_crc32(file_crc, 
81
        file_crc = calc_crc32(file_crc, 
81
                      reinterpret_cast<unsigned char *>(&buffer[0]),
82
                      reinterpret_cast<unsigned char *>(&buffer[0]),
82
                      file.gcount());
83
                      file.gcount());
83
    }
84
    }
85
  ostringstream message;
84
    cverb << vbfd << " with crc32 = " << hex << file_crc << endl;
86
    message << " with crc32 = " << hex << file_crc << endl;
87
  cverb << vbfd << message.str();
85
    return crc == file_crc;
88
    return crc == file_crc;
86
}
89
}
87
90
88
static bool find_debuginfo_file_by_buildid(unsigned char * buildid, string & debug_filename)
91
static bool find_debuginfo_file_by_buildid(unsigned char * buildid, string & debug_filename)
89
{
92
{
...
...
432
435
433
    string first_try(filedir + ".debug/" + basename);
436
    string first_try(filedir + ".debug/" + basename);
434
    string second_try(DEBUGDIR + filedir + basename);
437
    string second_try(DEBUGDIR + filedir + basename);
435
    string third_try(filedir + basename);
438
    string third_try(filedir + basename);
436
439
440
  ostringstream message;
437
    cverb << vbfd << "looking for debugging file " << basename 
441
    message << "looking for debugging file " << basename
438
          << " with crc32 = " << hex << crc32 << endl;
442
            << " with crc32 = " << hex << crc32 << endl;
443
  cverb << vbfd << message.str();
439
444
440
    if (separate_debug_file_exists(first_try, crc32, extra)) 
445
    if (separate_debug_file_exists(first_try, crc32, extra)) 
441
        debug_filename = first_try; 
446
        debug_filename = first_try; 
442
    else if (separate_debug_file_exists(second_try, crc32, extra))
447
    else if (separate_debug_file_exists(second_try, crc32, extra))
443
        debug_filename = second_try;
448
        debug_filename = second_try;
...
...
728
        return;
733
        return;
729
734
730
    if (bfd_get_file_flags(abfd) & HAS_SYMS)
735
    if (bfd_get_file_flags(abfd) & HAS_SYMS)
731
        nr_syms = bfd_get_symtab_upper_bound(abfd);
736
        nr_syms = bfd_get_symtab_upper_bound(abfd);
732
737
738
  ostringstream message;
733
    cverb << vbfd << "bfd_get_symtab_upper_bound: " << dec
739
    message << "bfd_get_symtab_upper_bound: " << dec
734
          << nr_syms << hex << endl;
740
            << nr_syms << hex << endl;
741
  cverb << vbfd << message.str();
735
742
736
    nr_syms /= sizeof(asymbol *);
743
    nr_syms /= sizeof(asymbol *);
737
744
738
    if (nr_syms < 1) {
745
    if (nr_syms < 1) {
739
        if (!image_bfd_info)
746
        if (!image_bfd_info)
...
...
741
        syms.reset();
748
        syms.reset();
742
        cverb << vbfd << "Debuginfo has debug data only" << endl;
749
        cverb << vbfd << "Debuginfo has debug data only" << endl;
743
    } else {
750
    } else {
744
        syms.reset(new asymbol *[nr_syms]);
751
        syms.reset(new asymbol *[nr_syms]);
745
        nr_syms = bfd_canonicalize_symtab(abfd, syms.get());
752
        nr_syms = bfd_canonicalize_symtab(abfd, syms.get());
753
      ostringstream message;
746
        cverb << vbfd << "bfd_canonicalize_symtab: " << dec
754
        message << "bfd_canonicalize_symtab: " << dec
747
              << nr_syms << hex << endl;
755
                << nr_syms << hex << endl;
756
      cverb << vbfd << message.str();
748
    }
757
    }
749
}
758
}
750
759
751
760
752
linenr_info const
761
linenr_info const

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks