forked from Lephenixnoir/fxos
Merge pull request 'Print all syscalls to 4 hex figures' (#8) from Dr-Carlos/fxos:syscall-lengths into master
Reviewed-on: https://gitea.planet-casio.com/Lephenixnoir/fxos/pulls/8
This commit is contained in:
commit
27b2b044fd
|
@ -37,7 +37,7 @@ bool PrintPass::analyzeInstruction(uint32_t pc, Instruction &i)
|
|||
|
||||
int syscall_id;
|
||||
if(m_os && (syscall_id = m_os->find_syscall(pc)) >= 0) {
|
||||
printf("\n<%%%03x", syscall_id);
|
||||
printf("\n<%%%04x", syscall_id);
|
||||
auto maybe_str = symquery(Symbol::Syscall, syscall_id);
|
||||
if(maybe_str)
|
||||
printf(" %s", (*maybe_str).c_str());
|
||||
|
@ -163,7 +163,7 @@ void PrintPass::syscall(Argument const &a)
|
|||
return;
|
||||
}
|
||||
|
||||
queue(format("%%%03x", a.syscall_id), promote_syscall == Promote);
|
||||
queue(format("%%%04x", a.syscall_id), promote_syscall == Promote);
|
||||
syscallname(a);
|
||||
}
|
||||
|
||||
|
|
10
shell/i.cpp
10
shell/i.cpp
|
@ -70,7 +70,7 @@ static char const *syscall_str
|
|||
" First seemingly invalid entry : 0x%08x\n"
|
||||
" Syscall entries outside ROM:\n";
|
||||
|
||||
static char const *syscall_nonrom_str = " %%%03x -> %08x (%s memory)\n";
|
||||
static char const *syscall_nonrom_str = " %%%04x -> %08x (%s memory)\n";
|
||||
|
||||
static std::string parse_io(Session &, Parser &parser)
|
||||
{
|
||||
|
@ -236,8 +236,7 @@ void _isc(Session &session, std::string vspace_name, bool sort,
|
|||
|
||||
for(int i = 0; i < total; i++) {
|
||||
fmt::print(theme(3), " 0x{:08x}", info[i].address);
|
||||
fmt::print(theme(10), (total >= 0x1000 ? " %{:04x}" : " %{:03x}"),
|
||||
info[i].id);
|
||||
fmt::print(theme(10), " %{:04x}", info[i].id);
|
||||
fmt::print("\n");
|
||||
}
|
||||
}
|
||||
|
@ -353,10 +352,7 @@ void _is(Session &session, std::string vspace_name,
|
|||
}
|
||||
|
||||
for(auto const &s: symbols) {
|
||||
if(s.type == FxOS::Symbol::Syscall && s.value < 0x1000) {
|
||||
fmt::print(theme(10), " %{:03x}", s.value);
|
||||
}
|
||||
else if(s.type == FxOS::Symbol::Syscall) {
|
||||
if(s.type == FxOS::Symbol::Syscall) {
|
||||
fmt::print(theme(10), " %{:04x}", s.value);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -52,7 +52,7 @@ std::string Token::str() const
|
|||
case T::SYMBOL:
|
||||
return fmt::format("symbol '{}'", this->value.STRING);
|
||||
case T::SYSCALL:
|
||||
return fmt::format("syscall number %{:03x}", this->value.NUM);
|
||||
return fmt::format("syscall number %{:04x}", this->value.NUM);
|
||||
case T::OPTION:
|
||||
return fmt::format("command option '{}'", this->value.STRING);
|
||||
case T::STRING:
|
||||
|
@ -146,7 +146,7 @@ void Parser::dump_command()
|
|||
if(t.type == T::NUM)
|
||||
fmt::print("NUM {:#x}\n", t.value.NUM);
|
||||
else if(t.type == T::SYSCALL)
|
||||
fmt::print("SYSCALL %{:03x}\n", t.value.NUM);
|
||||
fmt::print("SYSCALL %{:04x}\n", t.value.NUM);
|
||||
else if(t.type == T::SYMBOL)
|
||||
fmt::print("SYMBOL '{}'\n", t.value.STRING);
|
||||
else if(t.type == T::OPTION)
|
||||
|
|
Loading…
Reference in New Issue