Gabriel B. has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67667?usp=email )

Change subject: base: Enable stl_helpers::operator<< in _formatString
......................................................................

base: Enable stl_helpers::operator<< in _formatString

The string format (%s) eventually relies on bare operator<< to
display any type T. This gives the opportunity to use the helpers in
stl_helpers. This patch enables printing enums, pairs, tuples,
vectors, maps and others in a PRINTF debug macro without any extra
manual operation.

Change-Id: I8ac85133ebadcb95354598c1cfe687d8fffb89e2
---
M src/base/cprintf_formats.hh
1 file changed, 18 insertions(+), 0 deletions(-)



diff --git a/src/base/cprintf_formats.hh b/src/base/cprintf_formats.hh
index 02ba496..b2cb841 100644
--- a/src/base/cprintf_formats.hh
+++ b/src/base/cprintf_formats.hh
@@ -33,6 +33,8 @@
 #include <ostream>
 #include <sstream>

+#include "base/stl_helpers.hh"
+
 namespace gem5
 {

@@ -220,6 +222,7 @@
 static inline void
 _formatString(std::ostream &out, const T &data, Format &fmt)
 {
+    using stl_helpers::operator<<;
     if (fmt.width > 0) {
         std::stringstream foo;
         foo << data;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/67667?usp=email 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: I8ac85133ebadcb95354598c1cfe687d8fffb89e2
Gerrit-Change-Number: 67667
Gerrit-PatchSet: 1
Gerrit-Owner: Gabriel B. <gabriel.bus...@arteris.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to