2
0
Fork 0

core: patch to log ROM when diag is set

This commit is contained in:
Ehmry - 2020-11-07 13:54:55 +01:00
parent df5be1d6dc
commit e9407c3e5d
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From e5da4aa414e19b808e544e7bd89888cc7a3b85d3 Mon Sep 17 00:00:00 2001
From: Emery Hemingway <ehmry@posteo.net>
Date: Sat, 7 Nov 2020 08:37:29 +0100
Subject: [PATCH] core: log ROM requests with affirmative "diag" flag
---
repos/base/src/core/include/rom_session_component.h | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/repos/base/src/core/include/rom_session_component.h b/repos/base/src/core/include/rom_session_component.h
index c584701f5f..2c9623afcf 100644
--- a/repos/base/src/core/include/rom_session_component.h
+++ b/repos/base/src/core/include/rom_session_component.h
@@ -35,12 +35,20 @@ namespace Genode {
{
/* extract label */
Session_label const label = label_from_args(args);
+ auto const name = label.last_element();
+
+ /* extract diag flag */
+ bool diag = session_diag_from_args(args).enabled;
/* find ROM module for trailing label element */
- Rom_module const * rom = rom_fs.find(label.last_element().string());
- if (rom)
+ Rom_module const * rom = rom_fs.find(name.string());
+
+ if (rom) {
+ if (diag) log("serve ROM \"", name, "\" to \"", label, "\"");
return *rom;
+ }
+ if (diag) error("ROM \"", name, "\" not found for \"", label, "\"");
throw Service_denied();
}
--
2.28.0

View File

@ -296,7 +296,7 @@ let
'';
};
basePatches = [ ./cxx-align.patch ];
basePatches = [ ./cxx-align.patch ./core-diag.patch ];
in makePackages // depotPackages // {