[gem5-dev] Change in gem5/gem5[develop]: base: Improve error message occurs when base couldn't open a file

2020-06-30 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has submitted this change. (  
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 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30794
Reviewed-by: Giacomo Travaglini 
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
---
M src/base/output.cc
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Giacomo Travaglini: Looks good to me, approved
  kokoro: Regressions pass



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))
 {
-_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

--
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: 2
Gerrit-Owner: Hoa Nguyen 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Hoa Nguyen 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Trivikram Reddy 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
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

[gem5-dev] Change in gem5/gem5[develop]: base: Improve error message occurs when base couldn't open a file

2020-06-29 Thread Hoa Nguyen (Gerrit) via gem5-dev
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 
---
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))
 {
-_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

--
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 
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