Hoa Nguyen has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/30794 )

Change subject: base: Improve error message occurs when base couldn't open a file
......................................................................

base: Improve error message occurs when base couldn't open a file

Change-Id: Icaa571216f0eed4527a6aaddcf0c6814ad282c56
Signed-off-by: Hoa Nguyen <hoangu...@ucdavis.edu>
---
M src/base/output.cc
1 file changed, 4 insertions(+), 2 deletions(-)



diff --git a/src/base/output.cc b/src/base/output.cc
index 47b8aa7..5703a37 100644
--- a/src/base/output.cc
+++ b/src/base/output.cc
@@ -84,9 +84,11 @@
     _mode(mode), _recreateable(recreateable),
     _fstream(static_cast<stream_type_t *>(_stream))
 {
-    _fstream->open(dir.resolve(_name).c_str(), _mode);
+    std::string resolved_path = dir.resolve(_name);

-    assert(_fstream->is_open());
+    _fstream->open(resolved_path.c_str(), _mode);
+
+ panic_if(!_fstream->is_open(), "Failed to open \"%s\"\n", resolved_path);
 }

 template<class StreamType>

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/30794
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Icaa571216f0eed4527a6aaddcf0c6814ad282c56
Gerrit-Change-Number: 30794
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen <hoangu...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to