@@ -814,7 +814,10 @@ void Dwarf::WriteLineNumberProgramFromCodeSourceMaps(
814
814
815
815
static constexpr char kResolvedFileRoot [] = " file:///" ;
816
816
static constexpr intptr_t kResolvedFileRootLen = sizeof (kResolvedFileRoot ) - 1 ;
817
- static constexpr char kResolvedSdkRoot [] = " org-dartlang-sdk:///sdk/" ;
817
+ static constexpr char kResolvedFlutterRoot [] = " org-dartlang-sdk:///flutter/" ;
818
+ static constexpr intptr_t kResolvedFlutterRootLen =
819
+ sizeof (kResolvedFlutterRoot ) - 1 ;
820
+ static constexpr char kResolvedSdkRoot [] = " org-dartlang-sdk:///" ;
818
821
static constexpr intptr_t kResolvedSdkRootLen = sizeof (kResolvedSdkRoot ) - 1 ;
819
822
static constexpr char kResolvedGoogle3Root [] = " google3:///" ;
820
823
static constexpr intptr_t kResolvedGoogle3RootLen =
@@ -830,10 +833,15 @@ static const char* ConvertResolvedURI(const char* str) {
830
833
return str + kResolvedFileRootLen - 1 ; // Leave a '/' on the front.
831
834
#endif
832
835
}
836
+ // Must do kResolvedFlutterRoot before kResolvedSdkRoot, since the latter is
837
+ // a prefix of the former.
838
+ if (len > kResolvedFlutterRootLen &&
839
+ strncmp (str, kResolvedFlutterRoot , kResolvedFlutterRootLen ) == 0 ) {
840
+ return str + kResolvedFlutterRootLen ; // Strip off the entire prefix.
841
+ }
833
842
if (len > kResolvedSdkRootLen &&
834
843
strncmp (str, kResolvedSdkRoot , kResolvedSdkRootLen ) == 0 ) {
835
- // Leave "sdk/" as a prefix in the returned path.
836
- return str + (kResolvedSdkRootLen - 4 );
844
+ return str + kResolvedSdkRootLen ; // Strip off the entire prefix.
837
845
}
838
846
if (len > kResolvedGoogle3RootLen &&
839
847
strncmp (str, kResolvedGoogle3Root , kResolvedGoogle3RootLen ) == 0 ) {
0 commit comments