service: Add service function name lookup based on header code

This is for displaying the function name for HLE requests. Probably it is possible to do the same for LLE ones but it would require having the HLE handlers available even when not using them, which doesn't seem to make sense and is more of a hack than a proper solution in my opinion.
This commit is contained in:
zhupengfei 2019-07-22 20:24:01 +08:00
parent 1cf75e55c2
commit 71e0c40310
No known key found for this signature in database
GPG key ID: DD129E108BD09378
2 changed files with 11 additions and 0 deletions

View file

@ -179,6 +179,14 @@ void ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& context)
handler_invoker(this, info->handler_callback, context); handler_invoker(this, info->handler_callback, context);
} }
std::string ServiceFrameworkBase::GetFunctionName(u32 header) const {
if (!handlers.count(header)) {
return "";
}
return handlers.at(header).name;
}
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Module interface // Module interface

View file

@ -64,6 +64,9 @@ public:
void HandleSyncRequest(Kernel::HLERequestContext& context) override; void HandleSyncRequest(Kernel::HLERequestContext& context) override;
/// Retrieves name of a function based on the header code. For IPC Recorder.
std::string GetFunctionName(u32 header) const;
protected: protected:
/// Member-function pointer type of SyncRequest handlers. /// Member-function pointer type of SyncRequest handlers.
template <typename Self> template <typename Self>