Fixed problem in DeviceSettings::strParam, returned wrong string
[avr-sim.git] / src / BfdProgram.h
blobac8d510fd78f578829b4e8be014623941e241e73
1 #ifndef AVR_BFDPROGRAM_H
2 #define AVR_BFDPROGRAM_H
4 #include "config.h"
6 #ifdef HAVE_LIBBFD
8 #include "Program.h"
10 struct bfd;
11 struct bfd_section;
13 namespace avr {
15 /**
16 * @author Tom Haber
17 * @date May 23, 2008
18 * @brief Support for the BFD library
20 * BfdProgram is an implementation of Program that
21 * reads program files using the BFD library.
22 * BFD allows a number of formats to be read such
23 * as elf, coff, ...
25 class BfdProgram : public Program {
26 public:
27 BfdProgram();
28 BfdProgram(const char *filename);
29 ~BfdProgram();
31 public:
32 /**
33 * Opens and loads a file.
35 void load(const char * filename);
37 /**
38 * Reads the next available section from the file
39 * and returns the data in \e sec.
41 * \returns false if no further sections are available.
43 bool readNextSection(Section & sec);
45 private:
46 void loadSymbols();
48 private:
49 bfd *abfd;
50 bfd_section *sec;
53 inline BfdProgram::BfdProgram() : abfd(0), sec(0) {}
54 inline BfdProgram::BfdProgram(const char *filename) : abfd(0), sec(0) {
55 load( filename );
59 #endif
61 #endif /*AVR_BFDPROGRAM_H*/