diff options
author | pierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-03-06 22:00:30 +0000 |
---|---|---|
committer | pierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2021-03-06 22:00:30 +0000 |
commit | c034735ca46edb4aa7eb8ba8e22f725b94a8dcac (patch) | |
tree | d9160e52ceeab7bac274118bffacea8e3d608cd1 | |
parent | becb5c83fef87d60b801b79cb608cb0e90f71f97 (diff) | |
download | fpc-c034735ca46edb4aa7eb8ba8e22f725b94a8dcac.tar.gz |
* Improve DEBUG_PPU code
* Move flog file closing from closefile method to destroy destructor.
* Fix write_data output into flog
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@48890 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | compiler/entfile.pas | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/compiler/entfile.pas b/compiler/entfile.pas index 3f2fcb9b57..65fcd55180 100644 --- a/compiler/entfile.pas +++ b/compiler/entfile.pas @@ -380,6 +380,11 @@ end; destructor tentryfile.destroy; begin closefile; +{$ifdef DEBUG_PPU} + if flog_open then + close(flog); + flog_open:=false; +{$endif DEBUG_PPU} if assigned(buf) then freemem(buf,entryfilebufsize); end; @@ -573,11 +578,6 @@ begin f.Free; mode:=0; closed:=true; -{$ifdef DEBUG_PPU} - if flog_open then - close(flog); - flog_open:=false; -{$endif DEBUG_PPU} end; end; @@ -683,14 +683,6 @@ var begin p:=pchar(@b); pbuf:=@buf[bufidx]; -{$ifdef DEBUG_PPU} - if ppu_log_level <= 0 then - begin - ppu_log('writedata, length='+tostr(len)+' level='+tostr(ppu_log_level)); - for i:=0 to len-1 do - ppu_log_val('p['+tostr(i)+']=$'+hexstr(byte(p[i]),2)); - end; -{$endif DEBUG_PPU} repeat left:=bufsize-bufidx; if len<left then @@ -704,6 +696,14 @@ begin exit; until false; move(pbuf^,p^,len); +{$ifdef DEBUG_PPU} + if ppu_log_level <= 0 then + begin + ppu_log('writedata, length='+tostr(len)+' level='+tostr(ppu_log_level)); + for i:=0 to len-1 do + ppu_log_val('p['+tostr(i)+']=$'+hexstr(byte(p[i]),2)); + end; +{$endif DEBUG_PPU} inc(bufidx,len); end; |