> On Sept. 18, 2015, 2:58 p.m., Tony Gutierrez wrote: > > src/mem/ruby/common/Address.hh, line 50 > > <http://reviews.gem5.org/r/3124/diff/1/?file=49680#file49680line50> > > > > std::string& ?
From http://en.cppreference.com/w/cpp/io/basic_stringstream/str: Notes The copy of the underlying string returned by str is a temporary object that will be destructed at the end of the expression, so directly calling c_str() on the result of str() (for example in auto *ptr = out.str().c_str();) results in a dangling pointer. Given this, I don't think returning reference would be right. - Nilay ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/3124/#review7211 ----------------------------------------------------------- On Sept. 18, 2015, 1:40 p.m., Nilay Vaish wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/3124/ > ----------------------------------------------------------- > > (Updated Sept. 18, 2015, 1:40 p.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 11118:7bc7e7fee719 > --------------------------- > ruby: print addresses in hex > Changeset 4872dbdea907 replaced Address by Addr, but did not make changes > to print statements. So the addresses which were being printed in hex earlier > along with their line address, were now being printed in decimals. This patch > adds a function printAddress(Addr) that can be used to print the address in > hex > along with the lines address. This function has been put to use in some of > the > places. At other places, change has been made to print just the address in > hex. > > > Diffs > ----- > > src/mem/protocol/MESI_Three_Level-L0cache.sm d6fb95dbf3e2 > src/mem/protocol/MESI_Three_Level-L1cache.sm d6fb95dbf3e2 > src/mem/protocol/MESI_Two_Level-L1cache.sm d6fb95dbf3e2 > src/mem/protocol/MESI_Two_Level-L2cache.sm d6fb95dbf3e2 > src/mem/protocol/MI_example-cache.sm d6fb95dbf3e2 > src/mem/protocol/MOESI_CMP_directory-L1cache.sm d6fb95dbf3e2 > src/mem/protocol/MOESI_CMP_directory-L2cache.sm d6fb95dbf3e2 > src/mem/protocol/MOESI_CMP_token-L1cache.sm d6fb95dbf3e2 > src/mem/protocol/MOESI_hammer-cache.sm d6fb95dbf3e2 > src/mem/ruby/common/Address.hh d6fb95dbf3e2 > src/mem/ruby/common/Address.cc d6fb95dbf3e2 > src/mem/ruby/network/MessageBuffer.cc d6fb95dbf3e2 > src/mem/ruby/slicc_interface/AbstractCacheEntry.cc d6fb95dbf3e2 > src/mem/ruby/slicc_interface/AbstractController.cc d6fb95dbf3e2 > src/mem/ruby/slicc_interface/RubyRequest.cc d6fb95dbf3e2 > src/mem/ruby/structures/CacheMemory.cc d6fb95dbf3e2 > src/mem/ruby/structures/DirectoryMemory.cc d6fb95dbf3e2 > src/mem/ruby/structures/Prefetcher.cc d6fb95dbf3e2 > src/mem/ruby/system/RubySystem.cc d6fb95dbf3e2 > src/mem/ruby/system/Sequencer.cc d6fb95dbf3e2 > src/mem/slicc/symbols/StateMachine.py d6fb95dbf3e2 > src/mem/slicc/symbols/Type.py d6fb95dbf3e2 > > Diff: http://reviews.gem5.org/r/3124/diff/ > > > Testing > ------- > > > Thanks, > > Nilay Vaish > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
