@@ -1869,100 +1869,6 @@ std::string SwiftLanguage::GetFunctionDisplayArgs(
1869
1869
return s.GetString ().str ();
1870
1870
}
1871
1871
1872
- bool SwiftLanguage::GetFunctionDisplayArgs (
1873
- VariableList &args, lldb_private::Stream &s, std::string display_name,
1874
- lldb_private::ExecutionContextScope *exe_scope) {
1875
- const char *cstr = display_name.data ();
1876
- const char *open_paren = strchr (cstr, ' (' );
1877
- const char *close_paren = nullptr ;
1878
- const char *generic = strchr (cstr, ' <' );
1879
- // If before the arguments list begins there is a template sign
1880
- // then scan to the end of the generic args before you try to find
1881
- // the arguments list.
1882
- const char *generic_start = generic;
1883
- if (generic && open_paren && generic < open_paren) {
1884
- int generic_depth = 1 ;
1885
- ++generic;
1886
- for (; *generic && generic_depth > 0 ; generic++) {
1887
- if (*generic == ' <' )
1888
- generic_depth++;
1889
- if (*generic == ' >' )
1890
- generic_depth--;
1891
- }
1892
- if (*generic)
1893
- open_paren = strchr (generic, ' (' );
1894
- else
1895
- open_paren = nullptr ;
1896
- }
1897
- if (open_paren) {
1898
- close_paren = strchr (open_paren, ' )' );
1899
- }
1900
-
1901
- if (open_paren && generic_start)
1902
- if (generic_start)
1903
- s.Write (generic_start, open_paren - generic_start + 1 );
1904
- else
1905
- s.Write (cstr, open_paren - cstr + 1 );
1906
- else {
1907
- s.PutChar (' (' );
1908
- }
1909
-
1910
- const size_t num_args = args.GetSize ();
1911
- for (size_t arg_idx = 0 ; arg_idx < num_args; ++arg_idx) {
1912
- std::string buffer;
1913
-
1914
- VariableSP var_sp (args.GetVariableAtIndex (arg_idx));
1915
- ValueObjectSP var_value_sp (ValueObjectVariable::Create (exe_scope, var_sp));
1916
- if (!var_sp || !var_value_sp || var_sp->IsArtificial ())
1917
- continue ;
1918
- StreamString ss;
1919
- const char *var_representation = nullptr ;
1920
- const char *var_name = var_value_sp->GetName ().GetCString ();
1921
- if (var_value_sp->GetCompilerType ().IsValid ()) {
1922
- if (var_value_sp && exe_scope->CalculateTarget ())
1923
- var_value_sp = var_value_sp->GetQualifiedRepresentationIfAvailable (
1924
- exe_scope->CalculateTarget ()
1925
- ->TargetProperties ::GetPreferDynamicValue (),
1926
- exe_scope->CalculateTarget ()
1927
- ->TargetProperties ::GetEnableSyntheticValue ());
1928
- if (var_value_sp->GetCompilerType ().IsAggregateType () &&
1929
- DataVisualization::ShouldPrintAsOneLiner (*var_value_sp.get ())) {
1930
- static StringSummaryFormat format (TypeSummaryImpl::Flags ()
1931
- .SetHideItemNames (false )
1932
- .SetShowMembersOneLiner (true ),
1933
- " " );
1934
- format.FormatObject (var_value_sp.get (), buffer, TypeSummaryOptions ());
1935
- var_representation = buffer.c_str ();
1936
- } else
1937
- var_value_sp->DumpPrintableRepresentation (
1938
- ss,
1939
- ValueObject::ValueObjectRepresentationStyle::
1940
- eValueObjectRepresentationStyleSummary,
1941
- eFormatDefault,
1942
- ValueObject::PrintableRepresentationSpecialCases::eAllow, false );
1943
- }
1944
- if (ss.GetData () && ss.GetSize ())
1945
- var_representation = ss.GetData ();
1946
- if (arg_idx > 0 )
1947
- s.PutCString (" , " );
1948
- if (var_value_sp->GetError ().Success ()) {
1949
- if (var_representation)
1950
- s.Printf (" %s=%s" , var_name, var_representation);
1951
- else
1952
- s.Printf (" %s=%s at %s" , var_name,
1953
- var_value_sp->GetTypeName ().GetCString (),
1954
- var_value_sp->GetLocationAsCString ());
1955
- } else
1956
- s.Printf (" %s=<unavailable>" , var_name);
1957
- }
1958
-
1959
- if (close_paren)
1960
- s.PutCString (close_paren);
1961
- else
1962
- s.PutChar (' )' );
1963
- return true ;
1964
- }
1965
-
1966
1872
void SwiftLanguage::GetExceptionResolverDescription (bool catch_on,
1967
1873
bool throw_on, Stream &s) {
1968
1874
s.Printf (" Swift Error breakpoint" );
0 commit comments