Oberon Community Platform Forum
December 12, 2019, 09:59:42 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Debugger under WinAos  (Read 6167 times)
BohdanT
Sr. Member
****
Posts: 271


Life is difficult, but fortunately is short!


WWW
« on: March 23, 2009, 04:24:06 PM »

Proof of concept was successful.
Debugger runs under WinAos.
was added:
- to the compiler: generation PosInfo.
- Minimal changes in Traps.Mod

Anybody is willing to help?


* Debug-2.png (33.63 KB, 1253x624 - viewed 712 times.)
Logged
tfrey
Newbie
*
Posts: 13


« Reply #1 on: March 25, 2009, 04:05:33 PM »

Interesting. Is there a link ?
Logged
staubesv
Administrator
Sr. Member
*****
Posts: 387



« Reply #2 on: March 26, 2009, 12:20:48 PM »

Cool! I don't have time to help programming, but if you need testers/users, I'm interrested to use it.
Logged
BohdanT
Sr. Member
****
Posts: 271


Life is difficult, but fortunately is short!


WWW
« Reply #3 on: April 17, 2009, 01:42:49 PM »

sorry for the pause and my English Cheesy



1. Debugging information.

1.1. Generate debugging information

To create a symbolic debugger requires some debugging information that would establish a link with the source code program.
It is noteworthy that in contrast to the traditional approach to other compilers (which uses an outdated, in my view, the approach), the AOS information exists for the position in the text, and not for line.
In the first place the idea of using FindPC for debugging information. However, it turned out that FindPC is not suitable for this task, as well as to find the position of the source code compiles address until the address code generated will not exceed the specified:

IF pc >= PCM.breakpc THEN PCM.Error(400, errpos, ""); PCM.breakpc := MAX(LONGINT) END; (* << mh 30.8.94 *)

This had to make a small addition to the procedure PCO.PutByte, PCO.PutWord, PCO.PutDWord. Before recording of bytes is called:
   PROCEDURE PosInfo;
   BEGIN
      IF PCM.DebugInfo IN PCM.codeOptions THEN
         IF errpos#PCM.debuglinepos THEN (*put info only if new source position*)
            PCM.debuglinepos:=errpos;
            PCM.WritePI(errpos,pc); (*write info in file*)
         END;
      END;
   END PosInfo;

1.2. Compiler Options

It was added option "B" (Bug). Parsing options occurs in the PC. ParseOptions. Was added variable DebugInfo and the following code:
      ELSIF ch = "B" THEN
         cOpt := cOpt / {PCM.DebugInfo}
      END

1.3. Creating a debug file
Debug information is stored in a separate file with the extension "Dpi" (Debug position information), the file name corresponds to the name of the module. Take the module name, rather than the source file name from the fact that in one source file can have multiple modules. Here there were problems with the implementation and I am not sure that everything was made correctly.
To use the Debug file were added to the PCM module is the following:
   PROCEDURE CreatePIFile*(name:ARRAY OF CHAR);
   VAR
      file: Files.FileName;
   BEGIN
      IF DebugInfo IN codeOptions THEN
            MakeFileName(file,name,"",".Dpi");
            pif := Files.New(file);
            Files.Register(pif);
            Files.OpenWriter(piw, pif, 0);
            debuglinepos:=-1;
      END;
   END CreatePIFile;
   PROCEDURE WritePI*(a,b:LONGINT);
   VAR
      Ri: Files.Rider;
   BEGIN
      IF piw#NIL THEN
         piw.RawLInt(a);
         piw.RawLInt(b);
      END;
   END WritePI;
   PROCEDURE ClosePIFile*;
   BEGIN
      IF DebugInfo IN codeOptions THEN
         piw.Update;
      END;
   END ClosePIFile;

The file is created when the parser determines the module name in the procedure PCP.ParseInterface.
Closing the file occurs at the end of the cycle REPEAT in procedure PC.Module.

I very much doubt the correctness of their actions and look forward to the Board.

* debuginfo.rar (39.64 KB - downloaded 404 times.)
« Last Edit: April 17, 2009, 01:47:42 PM by BohdanT » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!