diff options
author | Cary Coutant <ccoutant@google.com> | 2008-12-05 21:34:54 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2008-12-05 21:34:54 +0000 |
commit | 4674ecfcf4045b3a3d81a4a979debd59ea1b6b11 (patch) | |
tree | 304093024cd1aed1d02654b688a607510c40efc8 /gold/options.cc | |
parent | fd06b4aa51e5e4b322f4784e3ea248e25aab733a (diff) | |
download | gdb-4674ecfcf4045b3a3d81a4a979debd59ea1b6b11.zip gdb-4674ecfcf4045b3a3d81a4a979debd59ea1b6b11.tar.gz gdb-4674ecfcf4045b3a3d81a4a979debd59ea1b6b11.tar.bz2 |
2008-12-05 Rafael Avila de Espindola <espindola@google.com>
* options.cc (General_options::parse_plugin_opt): New.
(General_options::add_plugin): The argument now is just the filename.
(General_options::add_plugin_option): New.
* options.h (plugin_opt): New.
(add_plugin): Change argument name.
(add_plugin_option): New.
* plugin.cc (Plugin::load): Don't parse the plugin option.
* plugin.h (Plugin::Plugin): Rename argument. Init filename_.
(Plugin::add_option): New.
(Plugin::args_): Change type.
(Plugin::filename_): New.
(Plugin_manager::add_plugin_option): New.
* testsuite/Makefile.am (plugin_test_1): Use new syntax.
* testsuite/Makefile.in: Regenerate.
Diffstat (limited to 'gold/options.cc')
-rw-r--r-- | gold/options.cc | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gold/options.cc b/gold/options.cc index 90fa163..6b2b5cf 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -304,6 +304,15 @@ General_options::parse_plugin(const char*, const char* arg, { this->add_plugin(arg); } + +// Parse --plugin-opt. + +void +General_options::parse_plugin_opt(const char*, const char* arg, + Command_line*) +{ + this->add_plugin_option(arg); +} #endif // ENABLE_PLUGINS void @@ -650,14 +659,24 @@ General_options::add_sysroot() free(canonical_sysroot); } -// Add a plugin and its arguments to the list of plugins. +// Add a plugin to the list of plugins. void -General_options::add_plugin(const char* arg) +General_options::add_plugin(const char* filename) { if (this->plugins_ == NULL) this->plugins_ = new Plugin_manager(*this); - this->plugins_->add_plugin(arg); + this->plugins_->add_plugin(filename); +} + +// Add a plugin option to a plugin. + +void +General_options::add_plugin_option(const char* arg) +{ + if (this->plugins_ == NULL) + gold_fatal("--plugin-opt requires --plugin."); + this->plugins_->add_plugin_option(arg); } // Set up variables and other state that isn't set up automatically by |