English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 20 August 2022, 14:32   #141
Rock'n Roll
German Translator
 
Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 185
debugmem_start=<address>
debugmem_size=<size in megabytes> Must be power of 2.

uaedbg <program to debug> <program parameters>

I change my A500 config to:
debugmem_start=0x60000
debugmem_size=0x1000 (2^12=4096=0x1000)

and start from shell >uaedbg example.exe

Shift+F12
Debugger answer is:
Failed to automatically allocate debugmem (no space)!
What I have to do?
Rock'n Roll is offline  
Old 21 August 2022, 11:17   #142
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
It can't be used to move it over any existing memory space. It currently needs to at $7000000+ (won't work with 24-bit addressing)

Note that whole memory space becomes chipset accessible when debugmem is enabled.
Toni Wilen is online now  
Old 28 August 2022, 00:08   #143
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 653
@Toni

I uploaded an executable to AB3DII_fresh.zip

To test I created an A1200 setup with an 030 and 32MB of ZIII fastmem.

Under OS3.1 the executable crashes, but uaedbg is able to debug. You'll see illegal/uninitialized memory access during OpenWindowTagList that can be ignored. Later the executable seems to access invalid chipmem and in this situation I cannot break into the debugger again and I need to kill WinUAE.

Under OS 3.1.4 (3.2) the executable runs, but uaedbg is not able to debug... it will claim illegal instructions early on during startup of the executable, as if the debugger bungled the PC increment.
pipper is offline  
Old 03 September 2022, 00:24   #144
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 653
@Toni Wilen

Is the UAE debugger supposed to work with an emulated 060 CPU?
pipper is offline  
Old 13 September 2022, 19:14   #145
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
Quote:
Originally Posted by pipper View Post
Under OS3.1 the executable crashes, but uaedbg is able to debug. You'll see illegal/uninitialized memory access during OpenWindowTagList that can be ignored. Later the executable seems to access invalid chipmem and in this situation I cannot break into the debugger again and I need to kill WinUAE.
Debugger get stuck (in recent winuae versions) if debugger was entered at least once and then CPU goes in stopped state and there is no interrupt that can wake it up. (This is fixed in winuae.7z) Not sure if this is the problem.

Quote:
Under OS 3.1.4 (3.2) the executable runs, but uaedbg is not able to debug... it will claim illegal instructions early on during startup of the executable, as if the debugger bungled the PC increment.
I haven't tried it with 3.1.4+ and probably won't too soon..

Quote:
Originally Posted by pipper View Post
@Toni Wilen

Is the UAE debugger supposed to work with an emulated 060 CPU?
CPU won't matter but other options might prevent it from working. More information needed. ("not working" don't help much).
Toni Wilen is online now  
Old 15 October 2022, 15:03   #146
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
Quote:
Chip RAM "zero page" (0 to $400) is now watched (like Enforcer). All writes break to debugger immediately, long read from 4 is allowed, if vbr is 0: long aligned exception vector reads are allowed. All other reads break immediately.
Maybe dumb question, but didn't see it answered elsewhere in the thread. Am I supposed to move vbr if it's 0 on program start, and I want to setup my own interrupt handlers (e.g. level3) directly? The debugger breaks on the "illegal" write to $6c and then seems to ignore it (in debugmem_chipmem_lput) meaning the old interrupt handler still runs.
Tried it 4.9.0/4.9.1/4.9.2b2 with different configurations. Test exe+config attached just in case. Uaedbg is the one from post #1.
Attached Files
File Type: 68k inttest.68k (124 Bytes, 77 views)
File Type: uae uaedbg_test.uae (13.0 KB, 72 views)
paraj is offline  
Old 19 October 2022, 20:11   #147
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
Only option currently is to move the VBR.
Toni Wilen is online now  
Old 19 October 2022, 21:17   #148
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
Quote:
Originally Posted by Toni Wilen View Post
Only option currently is to move the VBR.
Thanks, feature request then: Would be nice if it were handled by either amiga or pc side automatically so you don't have to change the executable you're testing.
paraj is offline  
Old 27 December 2022, 19:18   #149
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,197
Found out about this only now (well, I kind of knew something like this existed but never tried it before)

Works a treat, showing symbols & other features are just awesome compared to the crap way I had to debug stuff. Going to help a lot with my stalled projects!!

32-bit mode is required, as reminded several times, else it just fails without any explanation.

having the symbol printed is so noice:

Code:
70008190 [000188] 4ef9 7000 83f2           jmp $700083f2 xevious_reset
but then "f" command still asks for addresses. Isn't there a new debug command which can understand loaded symbols? I'd like to do

Code:
f xevious_reset
jotd is offline  
Old 27 December 2022, 20:06   #150
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 653
Quote:
Originally Posted by paraj View Post
Thanks, feature request then: Would be nice if it were handled by either amiga or pc side automatically so you don't have to change the executable you're testing.

You can use a tool like “vbrcontrol” on the Amiga side to move the VBR away from 0x00000000
pipper is offline  
Old 28 December 2022, 12:24   #151
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
Quote:
Originally Posted by jotd View Post
Code:
70008190 [000188] 4ef9 7000 83f2           jmp $700083f2 xevious_reset
but then "f" command still asks for addresses. Isn't there a new debug command which can understand loaded symbols? I'd like to do

Code:
f xevious_reset
f #xevious_reset should work. (without # it tries decode it as possible CPU register name and it does not have fallback)
Toni Wilen is online now  
Old 03 January 2023, 19:59   #152
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 653
Does the prefetcher cause Invalid Memory Access?
In this example it seems that the JMP instruction is directly adjacent
to uninitialized memory. But since we jump away from that address, the prefetcher is wrong and running into unallocated memory.


Code:
...
AllocMem ID= 140: 00000000 70e6d800 - 70e6d81d (30) AllocFlags: 00010001 PC: 00f820a0
....



Invalid access. Addr=70e6d81c RW=R Size=4: Accessing invalid memory
Page: 70e6d800 - 70e6d8ff. State=W Modified=*, Start=00, End=1D
  D0 00000000   D1 70E6D818   D2 00000000   D3 00000000
  D4 00000000   D5 00000000   D6 00000000   D7 00000000
  A0 00000000   A1 70E6D818   A2 00000000   A3 00000000
  A4 00000000   A5 00000000   A6 70E5C600   A7 70E5D6DC
USP  70E5D6DC ISP  400022A8 SFC  00000000 DFC  00000000
CACR 00002111 VBR  41FFFF00 CAAR 00000000 MSP  00000000
T=00 S=0 M=0 X=0 N=0 Z=0 V=0 C=0 IMASK=0 STP=0
SRP: 0 CRP: 0
TT0: 00000000 TT1: 00000000 TC: 00000000
Prefetch 70e6d81c deadf00d (1) 4018 (NEGX) dead (ADD) f00d (MMUOP030) Chip latch 00000000
70e6d818 4ef9 4018 19b6           jmp $401819b6
Next PC: 70e6d81e
>
>
>seg
Segment 1: 000003e9 70008000 - 700c2c5b (765020)
Segment 2: 000003ea 700cad00 - 700dc7ff (72448)
Segment 3: 000003eb 700e4800 - 70158c03 (476164)
Segment 4: 000003ea 70160d00 - 70160d87 (136)
Segment 5: 0000ffff 70168e00 - 70199b3f (200000) STACK
>d 70e6d818
70e6d818 4ef9 4018 19b6           jmp $401819b6
70e6d81e 9797                     sub.l d3,(a7) [00f9f86a]
70e6d820 9797                     sub.l d3,(a7) [00f9f86a]
70e6d822 9797                     sub.l d3,(a7) [00f9f86a]
70e6d824 9797                     sub.l d3,(a7) [00f9f86a]
70e6d826 9797                     sub.l d3,(a7) [00f9f86a]
70e6d828 9797                     sub.l d3,(a7) [00f9f86a]
70e6d82a 9797                     sub.l d3,(a7) [00f9f86a]
70e6d82c 9797                     sub.l d3,(a7) [00f9f86a]
70e6d82e 9797                     sub.l d3,(a7) [00f9f86a]
pipper is offline  
Old 05 January 2023, 07:40   #153
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 653
Another question: do the custom chips create memory violations like reading from 0 or reading from uninitialized memory?
pipper is offline  
Old 10 April 2023, 00:36   #154
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,197
I have started using it to debug one of my games.

I had to move some variables far from RTS of previous routines (else fake prefetch issue, ok)
I had to relocate VBR in fastmem and account for a relocated VBR: ok runs

But I get some spurious breaks, then game runs (practice). When moving to main event I get spurious interrupts again, and then I get a bus error (vector VBR+8 is called) at $7FFFFFFE apparently (from my game debug)

Running without uaedbg doesn't crash.

Zoned the exe & startup sequence. Using WinUAE 4.10.0
jotd is offline  
Old 10 April 2023, 19:03   #155
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
Quote:
Originally Posted by pipper View Post
Another question: do the custom chips create memory violations like reading from 0 or reading from uninitialized memory?
No. You can use debugger memwatch points do this partially.

Quote:
Originally Posted by jotd View Post
I have started using it to debug one of my games.

I had to move some variables far from RTS of previous routines (else fake prefetch issue, ok)
I had to relocate VBR in fastmem and account for a relocated VBR: ok runs

But I get some spurious breaks, then game runs (practice). When moving to main event I get spurious interrupts again, and then I get a bus error (vector VBR+8 is called) at $7FFFFFFE apparently (from my game debug)

Running without uaedbg doesn't crash.

Zoned the exe & startup sequence. Using WinUAE 4.10.0
Log messages probably would help. Fake bus error (generated if CPU jumps to non-existing address space) logging should have some extra info. If it is repeatable, set break point to bus error exception vector (whatever it points, usually it is ROM code) and use H to see history of CPU.

(I'll check files later)
Toni Wilen is online now  
Old 11 April 2023, 10:44   #156
CFou!
Moderator
 
CFou!'s Avatar
 
Join Date: Sep 2004
Location: France
Age: 50
Posts: 4,277
never tested, to do!
it seems really interesting
CFou! is offline  
Old 11 April 2023, 14:09   #157
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,197
I think it needs some tuning, but the concept is really great. Enforcer sucks compared to this.
jotd is offline  
Old 12 April 2023, 08:51   #158
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
Quote:
Originally Posted by jotd View Post
Zoned the exe & startup sequence. Using WinUAE 4.10.0
I don't see any bus errors when using my usual config. Included config can't be used because 24-bit address space is too small, can't fit large enough debugger special memory space.
Toni Wilen is online now  
Old 15 May 2023, 23:13   #159
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,197
Can you start the game (press fire to skip the training part). The problem arose here. Training part were OK.
jotd is offline  
Old 16 May 2023, 19:13   #160
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,516
Quote:
Originally Posted by jotd View Post
Can you start the game (press fire to skip the training part). The problem arose here. Training part were OK.
When first screen appears, nothing happens, firebutton does nothing. Does it need some special config?
Toni Wilen is online now  
 


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 22:27
Hacking the fs-uae console debugger alpine9000 Coders. Asm / Hardware 1 28 March 2016 16:45
Added SegTracker to FS-UAE's Debugger lallafa support.FS-UAE 7 16 January 2016 11:03
Amiga Segment!!! :) :) blade002 Amiga scene 8 08 October 2015 15:00
SAS/C: Undefined symbols Yesideez Coders. C/C++ 14 13 February 2014 16: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 14:46.

Top

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