aboutsummaryrefslogtreecommitdiff
path: root/gold/archive.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2019-03-13 13:25:43 -0400
committerSimon Marchi <simon.marchi@efficios.com>2019-03-13 13:26:37 -0400
commit8e5e5494f8653dd83ce1413d141e26c09dddab7b (patch)
tree273ab6f0a666474856f34ff1e0d6e617dd4506e7 /gold/archive.h
parent1dbade7441b9f32d6ba9aa1d44da5f28c44282fa (diff)
downloadfsf-binutils-gdb-8e5e5494f8653dd83ce1413d141e26c09dddab7b.zip
fsf-binutils-gdb-8e5e5494f8653dd83ce1413d141e26c09dddab7b.tar.gz
fsf-binutils-gdb-8e5e5494f8653dd83ce1413d141e26c09dddab7b.tar.bz2
Factor out mi_ui_out instantiation logic
When re-reviewing this [1] I noticed that there were two spots encoding the logic of instantiating an mi_ui_out object based on the interpreter name ("mi", "mi1", "mi2" or "mi3"): - mi_interp::init - mi_load_progress Both encode the logic to choose what the default version is when the interpreter name is "mi". I had forgotten the one in mi_load_progress. Therefore, I propose extracting that logic to a single function. I started to add a new overload of mi_out_new, then realized the current mi_out_new wasn't very useful, being just a thing wrapper around "new mi_ui_out". So I ended up with just an mi_out_new function taking the interp name as parameter. I ran the gdb.mi tests, and verified manually the behavior (including the load command). [1] https://sourceware.org/ml/gdb-patches/2019-01/msg00427.html gdb/ChangeLog: * mi/mi-out.h (mi_out_new): Change parameter to const char *. * mi/mi-out.c (mi_out_new): Change parameter to const char *, instantiate mi_ui_out based on interpreter name. * mi/mi-interp.c (mi_interp::init): Use the new mi_out_new. * mi/mi-main.c (mi_load_progress): Likewise.
Diffstat (limited to 'gold/archive.h')
0 files changed, 0 insertions, 0 deletions