forked from Lephenixnoir/fxos
_isc: resolve vspace when parsing and misc fixes
This commit is contained in:
parent
08c000539c
commit
771b12eab8
23
shell/i.cpp
23
shell/i.cpp
|
@ -151,8 +151,21 @@ static struct _isc_args parse_isc(Session &session, Parser &parser)
|
|||
|
||||
parser.accept_options();
|
||||
|
||||
VirtualSpace *space = session.current_space;
|
||||
if(!args.vspace_name.empty()) {
|
||||
space = session.get_space(args.vspace_name);
|
||||
if(!space) {
|
||||
std::string msg
|
||||
= format("virtual space '%s' does not exist", args.vspace_name);
|
||||
if(parser.completing())
|
||||
throw Parser::CompletionRequest("_error", msg);
|
||||
else
|
||||
FxOS_log(ERR, "%s", msg);
|
||||
}
|
||||
}
|
||||
|
||||
while(!parser.at_end())
|
||||
args.addresses.push_back(parser.expr(session.current_space));
|
||||
args.addresses.push_back(parser.expr(space));
|
||||
|
||||
parser.end();
|
||||
return args;
|
||||
|
@ -173,6 +186,11 @@ void _isc(Session &session, std::string vspace_name, bool sort,
|
|||
std::vector<uint32_t> addresses)
|
||||
{
|
||||
VirtualSpace *space = session.current_space;
|
||||
if(!space) {
|
||||
FxOS_log(ERR, "no virtual space selected");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!vspace_name.empty())
|
||||
space = session.get_space(vspace_name);
|
||||
|
||||
|
@ -185,7 +203,8 @@ void _isc(Session &session, std::string vspace_name, bool sort,
|
|||
if(!os) {
|
||||
if(!vspace_name.empty())
|
||||
FxOS_log(ERR, "OS analysis on '%s' failed", vspace_name);
|
||||
FxOS_log(ERR, "OS analysis failed");
|
||||
else
|
||||
FxOS_log(ERR, "OS analysis failed");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue