--- nono/host/hostcom.cpp 2026/04/29 17:05:11 1.1.1.1 +++ nono/host/hostcom.cpp 2026/04/29 17:05:18 1.1.1.2 @@ -74,8 +74,10 @@ // objname_ は "HostCOM" とか (スレッド名も同じになる)。 // 設定ファイルキーワードプレフィックスはこれを小文字にしたもの("hostcom")。 HostCOMDevice::HostCOMDevice(const std::string& objname_) - : inherited(objname_) + : inherited(OBJ_NONE) { + SetName(objname_); + // 親が hostcom* か debugger かによっていろいろ動作が違う。 if (GetName() == "Debugger") { // デバッガコンソールならログレベルは親に準じるため、こっちは不要。 @@ -146,13 +148,11 @@ HostCOMDevice::SelectDriver() const ConfigItem& dditem = gConfig->Find("debugger-driver"); const std::string& ddtype = dditem.AsString(); if (ddtype == "stdio") { - const char *opt; - if (gMainApp.opt_D) { - opt = "-D"; - } else { - opt = "'-V debugger-driver=stdio'"; + auto where = dditem.GetWhere(); + if (where == "-V") { + where += " debugger-driver=stdio"; } - item.Err("cannot be used with %s option", opt); + item.Err("stdio driver conflicts with " + where); return false; } }