diff options
author | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2010-01-12 03:15:20 +0000 |
---|---|---|
committer | gingold <gingold@b72b5c32-5f01-0410-b925-b5c7b92870f7> | 2010-01-12 03:15:20 +0000 |
commit | fb5957a16dea47ae4021c5d4c57b980cea02ee59 (patch) | |
tree | abdfbed5924f5be4418f74a0afe50b248e41c330 /ortho | |
parent | 8cca0b24e2c19eedecffdeec89a8a2898da1e362 (diff) | |
download | ghdl-fb5957a16dea47ae4021c5d4c57b980cea02ee59.tar.gz ghdl-fb5957a16dea47ae4021c5d4c57b980cea02ee59.tar.bz2 ghdl-fb5957a16dea47ae4021c5d4c57b980cea02ee59.zip |
ghdl 0.29 release.
Diffstat (limited to 'ortho')
-rw-r--r-- | ortho/debug/ortho_debug-disp.adb | 14 | ||||
-rw-r--r-- | ortho/gcc/Makefile | 3 | ||||
-rw-r--r-- | ortho/gcc/lang.opt | 6 | ||||
-rw-r--r-- | ortho/mcode/binary_file-memory.adb | 4 | ||||
-rw-r--r-- | ortho/mcode/binary_file.ads | 2 | ||||
-rw-r--r-- | ortho/mcode/ortho_code-dwarf.adb | 22 | ||||
-rw-r--r-- | ortho/mcode/ortho_code-dwarf.ads | 3 | ||||
-rw-r--r-- | ortho/mcode/ortho_code-x86-abi.adb | 10 | ||||
-rw-r--r-- | ortho/mcode/ortho_code-x86-insns.adb | 1 |
9 files changed, 51 insertions, 14 deletions
diff --git a/ortho/debug/ortho_debug-disp.adb b/ortho/debug/ortho_debug-disp.adb index b97ff50e5..be75122e3 100644 --- a/ortho/debug/ortho_debug-disp.adb +++ b/ortho/debug/ortho_debug-disp.adb @@ -125,10 +125,18 @@ package body Ortho_Debug.Disp is return Ctx.Tab = 0; end Is_Top; - procedure Put_Tab is + procedure Put_Tab + is + Tab : Natural := Ctx.Next_Tab; + Max_Tab : constant Natural := 40; begin - Ctx.Line (1 .. Ctx.Next_Tab) := (others => ' '); - Ctx.Line_Len := Ctx.Next_Tab; + if Tab > Max_Tab then + -- Limit indentation length, to limit line length. + Tab := Max_Tab; + end if; + + Ctx.Line (1 .. Tab) := (others => ' '); + Ctx.Line_Len := Tab; Ctx.Next_Tab := Ctx.Tab + 2; end Put_Tab; diff --git a/ortho/gcc/Makefile b/ortho/gcc/Makefile index 09ae08c93..c8eba1392 100644 --- a/ortho/gcc/Makefile +++ b/ortho/gcc/Makefile @@ -15,7 +15,8 @@ include $(orthobe_srcdir)/Makefile.inc ORTHO_BASENAME=$(orthobe_srcdir)/ortho_gcc ORTHO_PACKAGE=Ortho_Gcc -LIBFLAGS=$(HOME)/dist/mpfr-2.3.1/.libs/libmpfr.a $(HOME)/dist/gmp-4.2.2/.libs/libgmp.a +#LIBFLAGS=$(HOME)/dist/mpfr-2.3.1/.libs/libmpfr.a $(HOME)/dist/gmp-4.2.2/.libs/libgmp.a +LIBFLAGS=-lmpfr -lgmp $(ortho_exec): $(AGCC_DEPS) $(ORTHO_BASENAME).ads force $(GNATMAKE) -m -o $@ -g -aI$(ortho_srcdir) \ diff --git a/ortho/gcc/lang.opt b/ortho/gcc/lang.opt index 980fef7bf..eb6395999 100644 --- a/ortho/gcc/lang.opt +++ b/ortho/gcc/lang.opt @@ -65,6 +65,10 @@ fexplicit vhdl Explicit function declarations override implicit one in use +fpsl +vhdl +Allow PSL asserts in comments + -no-direct-drivers vhdl Disable direct drivers optimization @@ -83,4 +87,4 @@ Allow any character in comments -mb-comments vhdl -Allow any character in comments
\ No newline at end of file +Allow any character in comments diff --git a/ortho/mcode/binary_file-memory.adb b/ortho/mcode/binary_file-memory.adb index 4d5f74024..a37af9cb7 100644 --- a/ortho/mcode/binary_file-memory.adb +++ b/ortho/mcode/binary_file-memory.adb @@ -57,7 +57,9 @@ package body Binary_File.Memory is --Sect.Data := new Byte_Array (1 .. 0); end if; end if; - if Sect.Data_Max > 0 and Sect /= Sect_Abs then + if Sect.Data_Max > 0 + and (Sect /= Sect_Abs and Sect.Flags /= Section_Debug) + then Sect.Vaddr := To_Pc_Type (Sect.Data (0)'Address); end if; Sect := Sect.Next; diff --git a/ortho/mcode/binary_file.ads b/ortho/mcode/binary_file.ads index f81292678..1a2bf588d 100644 --- a/ortho/mcode/binary_file.ads +++ b/ortho/mcode/binary_file.ads @@ -33,6 +33,7 @@ package Binary_File is Section_Write : constant Section_Flags; Section_Zero : constant Section_Flags; Section_Strtab : constant Section_Flags; + Section_Debug : constant Section_Flags; type Byte is new Unsigned_8; @@ -218,6 +219,7 @@ private Section_Write : constant Section_Flags := 2#0000_0100#; Section_Zero : constant Section_Flags := 2#0000_1000#; Section_Strtab : constant Section_Flags := 2#0001_0000#; + Section_Debug : constant Section_Flags := 2#0010_0000#; Section_None : constant Section_Flags := 2#0000_0000#; -- Scope of a symbol: diff --git a/ortho/mcode/ortho_code-dwarf.adb b/ortho/mcode/ortho_code-dwarf.adb index a82d63526..14215d37a 100644 --- a/ortho/mcode/ortho_code-dwarf.adb +++ b/ortho/mcode/ortho_code-dwarf.adb @@ -280,7 +280,7 @@ package body Ortho_Code.Dwarf is Set_Symbol_Pc (Orig_Sym, False); End_Sym := Create_Local_Symbol; - Create_Section (Line1_Sect, ".debug_line-1", Section_None); + Create_Section (Line1_Sect, ".debug_line-1", Section_Debug); Set_Current_Section (Line1_Sect); -- Write Address. @@ -291,14 +291,14 @@ package body Ortho_Code.Dwarf is Line_Last := 1; - Create_Section (Line_Sect, ".debug_line", Section_None); + Create_Section (Line_Sect, ".debug_line", Section_Debug); Set_Section_Info (Line_Sect, null, 0, 0); Set_Current_Section (Line_Sect); Line_Sym := Create_Local_Symbol; Set_Symbol_Pc (Line_Sym, False); -- Abbrevs. - Create_Section (Abbrev_Sect, ".debug_abbrev", Section_None); + Create_Section (Abbrev_Sect, ".debug_abbrev", Section_Debug); Set_Section_Info (Abbrev_Sect, null, 0, 0); Set_Current_Section (Abbrev_Sect); @@ -318,7 +318,7 @@ package body Ortho_Code.Dwarf is Abbrev_Last := 1; -- Info. - Create_Section (Info_Sect, ".debug_info", Section_None); + Create_Section (Info_Sect, ".debug_info", Section_Debug); Set_Section_Info (Info_Sect, null, 0, 0); Set_Current_Section (Info_Sect); Info_Sym := Create_Local_Symbol; @@ -340,13 +340,14 @@ package body Ortho_Code.Dwarf is procedure Emit_Decl (Decl : O_Dnode); + -- Next node to be emitted. Last_Decl : O_Dnode := O_Dnode_First; procedure Emit_Decls_Until (Last : O_Dnode) is use Ortho_Code.Decls; begin - while Last_Decl <= Last loop + while Last_Decl < Last loop Emit_Decl (Last_Decl); Last_Decl := Get_Decl_Chain (Last_Decl); end loop; @@ -355,11 +356,16 @@ package body Ortho_Code.Dwarf is procedure Finish is Length : Pc_Type; + Last : O_Dnode; begin Set_Symbol_Pc (End_Sym, False); Length := Get_Current_Pc; - Emit_Decls_Until (Decls.Get_Decl_Last); + Last := Decls.Get_Decl_Last; + Emit_Decls_Until (Last); + if Last_Decl <= Last then + Emit_Decl (Last); + end if; -- Finish abbrevs. Set_Current_Section (Abbrev_Sect); @@ -449,7 +455,7 @@ package body Ortho_Code.Dwarf is Patch_32 (0, Unsigned_32 (Get_Current_Pc - 4)); -- Aranges - Create_Section (Aranges_Sect, ".debug_aranges", Section_None); + Create_Section (Aranges_Sect, ".debug_aranges", Section_Debug); Set_Section_Info (Aranges_Sect, null, 0, 0); Set_Current_Section (Aranges_Sect); @@ -1325,6 +1331,8 @@ package body Ortho_Code.Dwarf is procedure Emit_Subprg (Bod : O_Dnode) is begin Emit_Decls_Until (Bod); + Emit_Decl (Bod); + Last_Decl := Decls.Get_Decl_Chain (Bod); end Emit_Subprg; procedure Mark (M : out Mark_Type) is diff --git a/ortho/mcode/ortho_code-dwarf.ads b/ortho/mcode/ortho_code-dwarf.ads index bdd07eb16..c120bcfe1 100644 --- a/ortho/mcode/ortho_code-dwarf.ads +++ b/ortho/mcode/ortho_code-dwarf.ads @@ -22,6 +22,9 @@ package Ortho_Code.Dwarf is -- For a body. procedure Emit_Subprg (Bod : O_Dnode); + -- Emit all debug info until but not including LAST. + procedure Emit_Decls_Until (Last : O_Dnode); + -- For a line in a subprogram. procedure Set_Line_Stmt (Line : Int32); procedure Set_Filename (Dir : String; File : String); diff --git a/ortho/mcode/ortho_code-x86-abi.adb b/ortho/mcode/ortho_code-x86-abi.adb index 56c5543ce..a915f9235 100644 --- a/ortho/mcode/ortho_code-x86-abi.adb +++ b/ortho/mcode/ortho_code-x86-abi.adb @@ -87,7 +87,6 @@ package body Ortho_Code.X86.Abi is Mark (Decls_Mark); Consts.Mark (Consts_Mark); Mark (Types_Mark); - Dwarf.Mark (Dwarf_Mark); end if; end Start_Body; @@ -114,6 +113,15 @@ package body Ortho_Code.X86.Abi is Emits.Emit_Subprg (Subprg); + if Get_Decl_Depth (Subprg.D_Decl) = O_Toplevel + and then Flag_Debug = Debug_Dwarf + then + Dwarf.Emit_Decls_Until (Subprg.D_Body); + if not Debug.Flag_Debug_Keep then + Dwarf.Mark (Dwarf_Mark); + end if; + end if; + -- Recurse on nested subprograms. Child := Subprg.First_Child; while Child /= null loop diff --git a/ortho/mcode/ortho_code-x86-insns.adb b/ortho/mcode/ortho_code-x86-insns.adb index 4021a994c..d3ea79233 100644 --- a/ortho/mcode/ortho_code-x86-insns.adb +++ b/ortho/mcode/ortho_code-x86-insns.adb @@ -1799,6 +1799,7 @@ package body Ortho_Code.X86.Insns is when R_Irm | R_Rm | R_Ir + | R_Sib | R_Any32 | Regs_R32 | R_Any64 |