diff --git a/components/fpdebug/fpdbgdwarf.pas b/components/fpdebug/fpdbgdwarf.pas index 3c4125371c..e0d67f16dd 100644 --- a/components/fpdebug/fpdbgdwarf.pas +++ b/components/fpdebug/fpdbgdwarf.pas @@ -5552,11 +5552,22 @@ var begin assert((AValueObj = nil) or (AValueObj is TFpValueDwarf), 'TFpSymbolDwarfTypeSubRange.GetValueLowBound: AValueObj is TFpValueDwarf('); if FLowBoundState = rfNotRead then begin - if InformationEntry.GetAttribData(DW_AT_lower_bound, AttrData) then - ConstRefOrExprFromAttrData(AttrData, TFpValueDwarf(AValueObj), t, @FLowBoundState, @FLowBoundSymbol) - else - FLowBoundState := rfNotFound; - FLowBoundConst := t; + if InformationEntry.GetAttribData(DW_AT_lower_bound, AttrData) then begin + ConstRefOrExprFromAttrData(AttrData, TFpValueDwarf(AValueObj), t, @FLowBoundState, @FLowBoundSymbol); + FLowBoundConst := t; + end + else begin + FLowBoundState := rfConst; + case CompilationUnit.LanguageId of + DW_LANG_Ada83, DW_LANG_Cobol74, DW_LANG_Cobol85, + DW_LANG_Fortran77, DW_LANG_Fortran90, DW_LANG_Pascal83, + DW_LANG_Modula2, DW_LANG_Ada95, DW_LANG_Fortran95, + DW_LANG_PLI: + FLowBoundConst := 1; + else + FLowBoundConst := 0; + end; + end; end; Result := FLowBoundState in [rfConst, rfValue, rfExpression]; diff --git a/components/fpdebug/fpdbgdwarfdataclasses.pas b/components/fpdebug/fpdbgdwarfdataclasses.pas index 0dc5df906e..8eaab4f788 100644 --- a/components/fpdebug/fpdbgdwarfdataclasses.pas +++ b/components/fpdebug/fpdbgdwarfdataclasses.pas @@ -666,6 +666,7 @@ type FCompDir: String; FUnitName: String; FIdentifierCase: Integer; + FLanguageId: Integer; FProducer: String; FAbbrevList: TDwarfAbbrevList; @@ -763,6 +764,7 @@ type property FileName: String read FFileName; property UnitName: String read GetUnitName; property IdentifierCase: Integer read FIdentifierCase; + property LanguageId: Integer read FLanguageId; property Producer: String read FProducer; property BaseAddress: TDBGPtr read FMinPC; @@ -5190,6 +5192,9 @@ begin if LocateAttribute(Scope.Entry, DW_AT_producer, AttribList, Attrib, Form) then ReadValue(Attrib, Form, FProducer); + if LocateAttribute(Scope.Entry, DW_AT_language, AttribList, Attrib, Form) + then ReadValue(Attrib, Form, FLanguageId); + FDwarfSymbolClassMap := DwarfSymbolClassMapList.FindMapForCompUnit(Self); assert(FDwarfSymbolClassMap <> nil, 'TDwarfCompilationUnit.Create: FDwarfSymbolClassMap <> nil');