aboutsummaryrefslogtreecommitdiff
path: root/gold/debug.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@gmail.com>2018-03-23 10:05:38 -0700
committerCary Coutant <ccoutant@gmail.com>2018-03-23 10:05:38 -0700
commit291158a341260e97125db5638cd47c1e9aea5e8f (patch)
tree4479a33446992b8e56cc9f08d77ae0a79b06ca7e /gold/debug.h
parent2cc9b3048bcbb827e69059fb6beacb9bccbc5d7c (diff)
downloadgdb-291158a341260e97125db5638cd47c1e9aea5e8f.zip
gdb-291158a341260e97125db5638cd47c1e9aea5e8f.tar.gz
gdb-291158a341260e97125db5638cd47c1e9aea5e8f.tar.bz2
Add --debug=plugin option to record plugin actions.
With --debug=plugin, gold will log all plugin actions to a log file, and make copies of plugin-supplied replacement files in a temporary directory created under the current working directory. gold/ * debug.h (DEBUG_PLUGIN): New constant. (DEBUG_ALL): Add DEBUG_PLUGIN. (debug_string_to_enum): Likewise. * plugin.cc (make_sized_plugin_object): Add filename parameter. (Plugin_recorder): New class. (Plugin_manager::~Plugin_manager): Delete recorder_. (Plugin_manager::load_plugins): Create and initialize recorder_. (Plugin_manager::claim_file): Record claimed and unclaimed files. (Plugin_manager::make_plugin_object): Use object name as name for plugin object, if available. (Plugin_manager::add_input_file): Record replacement files. (Sized_pluginobj::do_add_symbols): Record plugin symbols. (Plugin_finish::run): Call Plugin_recorder::finish(). (make_sized_plugin_object): Add filename parameter and pass to Sized_pluginobj constructor. * plugin.h (Plugin::filename): New method. (Plugin::recorder): New method. (Plugin::recorder_): New data member.
Diffstat (limited to 'gold/debug.h')
-rw-r--r--gold/debug.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gold/debug.h b/gold/debug.h
index 0da1f9c..e82af3d 100644
--- a/gold/debug.h
+++ b/gold/debug.h
@@ -40,10 +40,11 @@ const int DEBUG_RELAXATION = 0x8;
const int DEBUG_INCREMENTAL = 0x10;
const int DEBUG_LOCATION = 0x20;
const int DEBUG_TARGET = 0x40;
+const int DEBUG_PLUGIN = 0x80;
const int DEBUG_ALL = (DEBUG_TASK | DEBUG_SCRIPT | DEBUG_FILES
| DEBUG_RELAXATION | DEBUG_INCREMENTAL
- | DEBUG_LOCATION | DEBUG_TARGET);
+ | DEBUG_LOCATION | DEBUG_TARGET | DEBUG_PLUGIN);
// Convert a debug string to the appropriate enum.
inline int
@@ -59,6 +60,7 @@ debug_string_to_enum(const char* arg)
{ "incremental", DEBUG_INCREMENTAL },
{ "location", DEBUG_LOCATION },
{ "target", DEBUG_TARGET },
+ { "plugin", DEBUG_PLUGIN },
{ "all", DEBUG_ALL }
};