diff options
author | Chris Johns <chrisj@rtems.org> | 2014-08-04 09:19:55 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-08-04 09:19:55 +1000 |
commit | 28884db485eba2b580d8da526e190f903b2e6174 (patch) | |
tree | 6cd24717823743f18041b6113351ff6a3468d3b4 /rld-config.cpp | |
parent | 482ca38073a878814640089086c0ba262e80e4cd (diff) |
rtems-tld: Add trace configuration support.
Extend the configuration support to provide the needed configuration
required to generate the C stub support.
Diffstat (limited to 'rld-config.cpp')
-rw-r--r-- | rld-config.cpp | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/rld-config.cpp b/rld-config.cpp index b6b84c2..b197e5d 100644 --- a/rld-config.cpp +++ b/rld-config.cpp @@ -25,7 +25,6 @@ #include <errno.h> #include <rld-config.h> -#include <rld.h> #include <SimpleIni.h> @@ -127,6 +126,45 @@ namespace rld } } + + void + config::includes (const section& sec, bool must_exist) + { + bool have_includes = false; + + try + { + const rld::config::record& rec = sec.get_record ("include"); + + have_includes = true; + + /* + * Include records are a path which we can just load. + * + * @todo Add a search path. See 'rld::files' for details. We can default + * the search path to the install $prefix of this tool and we can + * then provide a default set of function signatures for RTEMS + * APIs. + */ + + for (rld::config::items::const_iterator ri = rec.items.begin (); + ri != rec.items.end (); + ++ri) + { + load ((*ri).text); + } + } + catch (rld::error re) + { + /* + * No include records, must be all inlined. If we have includes it must + * be another error so throw it. + */ + if (have_includes || (!have_includes && must_exist)) + throw; + } + } + const section& config::get_section (const std::string& name) const { |