English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 30 May 2018, 09:54   #81
selco
Registered User
 
Join Date: Aug 2013
Location: Germany
Posts: 56
>winuae.7z updated, added one more path variant test..



It is still the older file from May,28th ?
selco is offline  
Old 30 May 2018, 20:52   #82
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,129
Sometimes cached data is returned even when file is updated. Reuploaded today, try again..
Toni Wilen is offline  
Old 31 May 2018, 11:27   #83
FlynnTheAvatar
Registered User

 
Join Date: Jan 2018
Location: Germany
Posts: 21
Hi Toni,

WinUAE Public Beta 11 crashes hard when I try to debug a minimal assembler program linked with NDK2.0 astartup.obj:

Code:
	opt	l+

	XDEF	_main
_main:
	rts
Compiling with Devpac 3.18 and linking with BLINK 5.10B (SAS/C 5.10B):
genam minimal.s
blink from include2.0:startups/Astartup.obj,minimal.o lib include3.9:linker_libs/amiga.lib to minimal

uaedbg minimal

Quote:
Automatically allocated debugmem location: 70000000 - 7fffffff 10000000
Loaded 'amiga.lib', 76 libraries, 1295 LVOs.
Loading executable, exe=0781e3f8
Hunk 0: 32 symbols loaded.
Hunk 1: 8 symbols loaded.
Segment 1: 000003e9 70008000 - 70008293 (660)
Segment 2: 000003ea 70010300 - 7001032b (44)
Segment 3: 000003e9 70018400 - 7001840b (12)
Segment 4: 0000ffff 70020500 - 700214ff (4096)
Executable load complete.
19 libraries matched with library symbols.
D0 00000001 D1 01E073F9 D2 00001000 D3 07802394
D4 00000008 D5 01E06EB1 D6 01E05E87 D7 0781CFE4
A0 0780239C A1 0781D3F8 A2 07810C84 A3 0781CFE4
A4 0781E3F0 A5 00F959E6 A6 00F959DA A7 700214F8
USP 700214F8 ISP 07802288 SFC 00000000 DFC 00000000
CACR 00002001 VBR 00000000 CAAR 00000000 MSP 00000000
T=00 S=0 M=0 X=1 N=0 Z=0 V=0 C=0 IMASK=0 STP=0
0: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
2: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
4: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
6: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
FPSR: 00000000 FPCR: 00000000 FPIAR: 00000000 N=0 Z=0 I=0 NAN=0
Segment 1: 000003e9 70008000-70008293
startup:
70008008 [000000] 2400 MOVE.L D0,D2
Next PC: 7000800a
>g
AllocMem ID= 5: 00000000 70029500 - 7002951d (30) AllocFlags: 00010001 PC: 7000806a
Please find the configuration, log files and dump attached.

Thank you.
Attached Files
File Type: dmp winuae_x64_4.0.0_b11_2018.05.31_10.23.28.dmp (161.8 KB, 76 views)
File Type: txt winuaebootlog.txt (64.9 KB, 86 views)
File Type: txt winuaelog.txt (11.7 KB, 81 views)
File Type: uae Debug 3.1.uae (17.1 KB, 79 views)
FlynnTheAvatar is offline  
Old 31 May 2018, 11:45   #84
selco
Registered User
 
Join Date: Aug 2013
Location: Germany
Posts: 56
You must disable JIT before. Did you?
selco is offline  
Old 31 May 2018, 12:08   #85
FlynnTheAvatar
Registered User

 
Join Date: Jan 2018
Location: Germany
Posts: 21
Yes, I know. I configured a 68030 with 68882 and JIT disabled.
FlynnTheAvatar is offline  
Old 31 May 2018, 13:10   #86
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,129
Attach also your test executable. It probably is needed, at least to confirm the fix quickly.
Toni Wilen is offline  
Old 31 May 2018, 13:19   #87
FlynnTheAvatar
Registered User

 
Join Date: Jan 2018
Location: Germany
Posts: 21
Sure, please find the test executable attached.

The crash happens right after the AllocMem call for parsing the command line.
Attached Files
File Type: lha minimal.lha (1,007 Bytes, 78 views)
FlynnTheAvatar is offline  
Old 31 May 2018, 17:27   #88
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,129
Fixed, redownload uaedbg.zip. Startup code uses pr_ReturnAddr which was not adjusted.
Toni Wilen is offline  
Old 31 May 2018, 17:50   #89
FlynnTheAvatar
Registered User

 
Join Date: Jan 2018
Location: Germany
Posts: 21
Thank you very much for fixing it so quickly. No more crashes.
FlynnTheAvatar is offline  
Old 31 May 2018, 18:19   #90
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,129
Quick new feature: break to debugger when debugged task causes any unexpected exception. Uses tc_TrapCode so if debugged program also sets it, it should properly call old handler if program's own handler gets unexpected exception.

Note: currently debugger breaks to internal uaedbg trap code routine. You need to manually trace few following instructions to get back to user code. EDIT: Fixed, now it automatically executes out of exception routine and then breaks to debugger.

Also note that it automatically adjusts stack and returns to following instruction even if 68k documentation says it should have returned to instruction that caused the exception.

Last edited by Toni Wilen; 31 May 2018 at 20:56.
Toni Wilen is offline  
Old 26 June 2018, 11:20   #91
selco
Registered User
 
Join Date: Aug 2013
Location: Germany
Posts: 56
Reading uninitialized memory

Stupid question:
What is "uninitialized memory"? How is that detected? What marks memory "initialized"?


I am testing here an gcc/libnix-compiled program and get the messeage in fread()-call when inside fread() the stream-buffer is acessed. The buffer was filled before from an AmigaOS-Read()-call and the program works just fine.


Invalid access. Addr=70149510 RW=R Size=1: Reading uninitialized memory
Page: 70149500 - 701495ff. State=R Modified=-, Start=00, End=100
D0 000000DD D1 7014950D D2 00000000 D3 00000000
D4 00000000 D5 00000000 D6 00000000 D7 401B41CC
A0 70216B28 A1 70149510 A2 700A848C A3 700A84C8
A4 4021FD80 A5 701202B4 A6 40000830 A7 7012028C
USP 7012028C ISP 400022A8 SFC 00000000 DFC 00000000
CACR 00000001 VBR 00000000 CAAR 00000000 MSP 00000000
T=00 S=0 M=0 X=1 N=1 Z=0 V=0 C=0 IMASK=0 STP=0
0: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
2: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
4: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
6: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
FPSR: 00000000 FPCR: 00000090 FPIAR: 00f8161a N=0 Z=0 I=0 NAN=0
70045F1E [03DF16] 1011 MOVE.B (A1) [6d],D0
Segment 1: 000003e9 70008000-700a03b3
70045F20 [03DF18] 1080 MOVE.B D0,(A0) [00]
Next PC: 70045f22
selco is offline  
Old 26 June 2018, 15:31   #92
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,129
Uninitialized = memory was allocated with allocmem/allocvec without MEMF_CLEAR flag and someone read from address that wasn't previously written to at least once.

It is not always a bug.
Toni Wilen is offline  
Old 26 June 2018, 16:48   #93
selco
Registered User
 
Join Date: Aug 2013
Location: Germany
Posts: 56
Thanks for explaination!


Does that always work?


I have file with "1234567890abcdf..." as contents. That file is beeing fopened and fread.


fread() does internally an AmigaOS Read() to a internal stream buffer. Then the internal stream buffer is copied to the fread-argument. This copy stops the debugger. I see however in the debugger the internal stream buffer and it contains the values from the file, so the file was read and the values have been stored into the stream buffer. So the stream buffer cannot be uninitalited any more!?


Can AmigaOS Read() somehow outsmart your memory-not-initialised detection?


Invalid access. Addr=70149710 RW=R Size=1: Reading uninitialized memory
Page: 70149700 - 701497ff. State=R Modified=-, Start=00, End=100
D0 000000DD D1 7014970D D2 00000000 D3 00000000
D4 00000000 D5 00000000 D6 00000000 D7 401B4614
A0 70149710 A1 7014970F A2 700A868C A3 700A86C8
A4 4021FE98 A5 701204B4 A6 40000830 A7 7012048C
USP 7012048C ISP 400022A8 SFC 00000000 DFC 00000000
CACR 00000001 VBR 00000000 CAAR 00000000 MSP 00000000
T=00 S=0 M=0 X=0 N=1 Z=0 V=0 C=0 IMASK=0 STP=0
0: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
2: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
4: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
6: 7FFF-FFFFFFFF-FFFFFFFF +nan 7FFF-FFFFFFFF-FFFFFFFF +nan
FPSR: 00000000 FPCR: 00000090 FPIAR: 00f8161a N=0 Z=0 I=0 NAN=0
70045FD2 [03DFCA] 1010 MOVE.B (A0) [35],D0
Segment 1: 000003e9 70008000-700a057b
70045FD4 [03DFCC] 1000 MOVE.B D0,D0
Next PC: 70045fd6
>m 7014970d
7014970D 3233 3435 3637 3839 3061 6263 6465 6667 234567890abcdefg
7014971D 6869 6A6C 6B6D 6E6F 7071 7273 7475 7677 hijlkmnopqrstuvw
7014972D 7879 7A0A 9999 9999 9999 9999 9999 9999 xyz.............

7014973D 9999 9999 9999 9999 9999 9999 9999 9999 ................
7014974D 9999 9999 9999 9999 9999 9999 9999 9999 ................

Last edited by selco; 26 June 2018 at 16:57.
selco is offline  
Old 26 June 2018, 22:25   #94
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,129
Right, directory filesystem and uae hardfiles bypass all normal memory access functions and access the host RAM directly (DMA-like) so debugger can't see it either..

Workaround added that forces indirect mode when debugger is enabled.
Toni Wilen is offline  
Old 03 July 2018, 11:49   #95
selco
Registered User
 
Join Date: Aug 2013
Location: Germany
Posts: 56
WinUAE crashes on "rs"

Your fix seemes to have solved my fread() issue.
Thnx!


Now I get a unitilized access later which I am inverstigating currently.
I wanted to see where it happened and entered "rs" to show the stackframe. It shows the following lines and then crashes. Please find dump and bootloag attached.



Code:

>rs
70008066 -> 7000a4b0 SP=7011f488 [0024A8] Segment 1: 000003e9 70008000-7009f62f _main
70008066 [00005E] 4eb9 7000 a4b0           JSR $7000a4b0 _main
7000806C [000064] 2f40 0004                MOVE.L D0,(A7, $0004) == $7011f48c [00000003]

7000b9cc -> 70009fe4 SP=7011f404 [001FDC] Segment 1: 000003e9 70008000-7009f62f
7000B9CC [0039C4] 4eba e616                JSR (PC,$e616) == $70009fe4
7000B9D0 [0039C8] 2039 700b 90cc           MOVE.L $700b90cc [00000000],D0

7000a124 -> 7004601c SP=7011f3e8 [03E014] Segment 1: 000003e9 70008000-7009f62f __Z10LoadPhDataPi
7000A124 [00211C] 4eb9 7004 601c           JSR $7004601c __Z10LoadPhDataPi
7000A12A [002122] 588f                     ADDA.L #$04,A7

7004644e -> 7009b6a0 SP=7011f3ac [093698] Segment 1: 000003e9 70008000-7009f62f _memcpy
memcpy (F)
7004644E [03E446] 4eb9 7009 b6a0           JSR $7009b6a0 _memcpy
memcpy (F)
70046454 [03E44C] 4fef 000c                LEA.L (A7, $000c) == $7011f3b8,A7

7009b6cc -> 400005c0 SP=7011f394
Attached Files
File Type: zip WinUAE.zip (44.0 KB, 67 views)
selco is offline  
Old 03 July 2018, 17:06   #96
sigma63
Registered User

 
Join Date: Oct 2014
Location: Berlin
Posts: 128
Improvement to the debugger

Hello Toni,

for debugging i sometimes print out the address of a function, Press Shift-F12 for debugger, set a breakpoint to the printed address and continue with g.

What do you think, is it a good idea to have some kind of API for the debugger?
So you could set the breakpoint from within the running Amiga-Program?
Also it will be good to have a function to clear the breakpoint before the program exits, because the next time this old breakpoint may be "stalled".

I think of using the uae.resource like a library with LVOs so one can check if running under WinUAE to use these functions only in this case.

Cheers and keep up that marvellous work!
sigma63 is offline  
Old 03 July 2018, 19:30   #97
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,129
Quote:
Originally Posted by selco View Post
Now I get a unitilized access later which I am inverstigating currently.
I wanted to see where it happened and entered "rs" to show the stackframe. It shows the following lines and then crashes. Please find dump and bootloag attached.
Use official beta (4010b1), dump files from winuae.7z are useless. EDIT: or b2.

Last edited by Toni Wilen; 04 July 2018 at 09:59.
Toni Wilen is offline  
Old 04 July 2018, 10:00   #98
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,129
Quote:
Originally Posted by sigma63 View Post
Hello Toni,

for debugging i sometimes print out the address of a function, Press Shift-F12 for debugger, set a breakpoint to the printed address and continue with g.

What do you think, is it a good idea to have some kind of API for the debugger?
So you could set the breakpoint from within the running Amiga-Program?
Also it will be good to have a function to clear the breakpoint before the program exits, because the next time this old breakpoint may be "stalled".

I think of using the uae.resource like a library with LVOs so one can check if running under WinUAE to use these functions only in this case.

Cheers and keep up that marvellous work!
It is already possible to inject debugger commands from emulation using uae-configuration but it probably isn't that good solution

Lots of work to do..
Toni Wilen is offline  
Old 10 July 2018, 19:39   #99
sigma63
Registered User

 
Join Date: Oct 2014
Location: Berlin
Posts: 128
Quote:
Originally Posted by Toni Wilen View Post
It is already possible to inject debugger commands from emulation using uae-configuration
Could anybody give an example, please?
sigma63 is offline  
Old 10 July 2018, 20:12   #100
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,129
Quote:
Originally Posted by sigma63 View Post
Could anybody give an example, please?
uae-configuration dbg "debugger command". Whole command must be in quotes.

for example uae-configuration dbg "f 123456" to set break point.
Toni Wilen is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugger updates (was: WinUAE Debugger HH PC history) selco support.WinUAE 8 14 March 2018 23:27
Hacking the fs-uae console debugger alpine9000 Coders. Asm / Hardware 1 28 March 2016 17:45
Added SegTracker to FS-UAE's Debugger lallafa support.FS-UAE 7 16 January 2016 12:03
Amiga Segment!!! :) :) blade002 Amiga scene 8 08 October 2015 16:00
SAS/C: Undefined symbols Yesideez Coders. C/C++ 14 13 February 2014 17:36

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:39.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.09443 seconds with 14 queries