uses EClasses, EDebugInfo; procedure Test; begin end; procedure TForm1.Button1Click(Sender: TObject); var Info: TELLocationInfo; begin Info := GetLocationInfo(@Test); Label1.Caption := Info.UnitName + '.' + Info.ProcedureName; // Will output 'Unit1.Test' end;