aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/elab-vhdl_debug.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth/elab-vhdl_debug.adb')
-rw-r--r--src/synth/elab-vhdl_debug.adb10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/synth/elab-vhdl_debug.adb b/src/synth/elab-vhdl_debug.adb
index 44f642d1e..6f618579c 100644
--- a/src/synth/elab-vhdl_debug.adb
+++ b/src/synth/elab-vhdl_debug.adb
@@ -1329,7 +1329,6 @@ package body Elab.Vhdl_Debug is
is
use Vhdl.Tokens;
use Errorout;
- Cur_Inst : constant Synth_Instance_Acc := Debug_Current_Instance;
Prev_Nbr_Errors : constant Natural := Nbr_Errors;
Index_Str : String := Natural'Image (Buffer_Index);
File : Source_File_Entry;
@@ -1339,6 +1338,7 @@ package body Elab.Vhdl_Debug is
Opt_Name : Boolean := False;
Opt_Type : Boolean := False;
Marker : Mark_Type;
+ Cur_Inst : Synth_Instance_Acc;
Cur_Scope : Node;
begin
-- Decode options: /v
@@ -1374,7 +1374,13 @@ package body Elab.Vhdl_Debug is
return;
end if;
- Cur_Scope := Elab.Vhdl_Context.Get_Source_Scope (Cur_Inst);
+ Get_Debug_Loc (Cur_Inst, Cur_Scope);
+ if Cur_Scope = Null_Node
+ or else Get_Kind (Cur_Scope) not in Iir_Kinds_Sequential_Statement
+ then
+ Cur_Scope := Elab.Vhdl_Context.Get_Source_Scope (Cur_Inst);
+ end if;
+
Enter_Scope (Cur_Scope);
Expr := Vhdl.Sem_Expr.Sem_Expression_Universal (Expr);
Leave_Scope (Cur_Scope);