File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 99#include " vm/elf.h"
1010#include " vm/image_snapshot.h"
1111#include " vm/object_store.h"
12+ #include " vm/version.h"
1213
1314namespace dart {
1415
@@ -277,8 +278,9 @@ void Dwarf::WriteDebugInfo(DwarfWriteStream* stream) {
277278 zone_, IsolateGroup::Current ()->object_store ()->root_library ());
278279 const String& root_uri = String::Handle (zone_, root_library.url ());
279280 stream->string (root_uri.ToCString ()); // DW_AT_name
280- stream->string (" Dart VM" ); // DW_AT_producer
281- stream->string (" " ); // DW_AT_comp_dir
281+ const char * producer = zone_->PrintToString (" Dart %s\n " , Version::String ());
282+ stream->string (producer); // DW_AT_producer
283+ stream->string (" " ); // DW_AT_comp_dir
282284
283285 // DW_AT_low_pc
284286 // The lowest instruction address in this object file that is part of our
Original file line number Diff line number Diff line change @@ -1029,8 +1029,22 @@ class DwarfAssemblyStream : public DwarfWriteStream {
10291029 void u8 (uint64_t value) {
10301030 stream_->Printf (" %s %" Pu64 " \n " , kSizeDirectives [kInt64SizeLog2 ], value);
10311031 }
1032- void string (const char * cstr) { // NOLINT
1033- stream_->Printf (" .string \" %s\"\n " , cstr); // NOLINT
1032+ void string (const char * cstr) { // NOLINT
1033+ stream_->WriteString (" .string \" " ); // NOLINT
1034+ while (char c = *cstr++) {
1035+ if (c == ' "' ) {
1036+ stream_->WriteString (" \\\" " );
1037+ } else if (c == ' \\ ' ) {
1038+ stream_->WriteString (" \\\\ " );
1039+ } else if (c == ' \n ' ) {
1040+ stream_->WriteString (" \\ n" );
1041+ } else if (c == ' \r ' ) {
1042+ stream_->WriteString (" \\ r" );
1043+ } else {
1044+ stream_->WriteByte (c);
1045+ }
1046+ }
1047+ stream_->WriteString (" \"\n " );
10341048 }
10351049 void WritePrefixedLength (const char * prefix, std::function<void ()> body) {
10361050 ASSERT (prefix != nullptr );
You can’t perform that action at this time.
0 commit comments