English Amiga Board Amiga Lore


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 08 June 2017, 14:32   #1
selco
Registered User
 
Join Date: Aug 2013
Location: Germany
Posts: 41
WinUAE Debugger HH PC history

Hi,
(How) is the PC history working?

I try to find an Enforcer-Hit. My Program reads a byte from Address 0. The hit seems to point into the linker-library function vprintf, so I have probably passed a Null-Ptr somewhere to a printf-family function, but where?

I did
Shift F12
w 1 0 1 r ; Mem watch point to stop after the illegal read
run my program
WinUAE stops, Rgister A0 is 1

Ok. I see the instruction after my illegal access. One Instruction before is
TST.B (A0)+
So I think this looks like the offending instruction.

Now I thought I can find out where the program came from by typing H or HH or HH 100 or something like that.

But what I see cannot be correct, the instructions in the history do not access memory nor is A1 0 or 1!?

What do I have to do to get a history before the illegal access?
Is Jit or MMU or the selected CPU important?

(I tried with winUAE 3.4.0)

selco
selco is offline  
AdSense AdSense  
Old 08 June 2017, 17:28   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,531
At least one normal break point (f) must be active. It also enables history collection.

EDIT: JIT must be off. MMU is supported (but it can get confusing if MMU is used to translate addresses)
Toni Wilen is offline  
Old 09 June 2017, 09:19   #3
selco
Registered User
 
Join Date: Aug 2013
Location: Germany
Posts: 41
Thanks Toni, now it works.

But...
I have the impression it does not work as expeced in GUI-debugger? (Only in console debugger)

If I do
Shift F12 ; Enter (GUI) debugger
w 1 0 1 R ; Memwatchpoint Read Byte from addr $00000000
f 100 ; add a dummy brakpoint to start history collection
g ; attempt to contininue emulation

It immidetaly stops again as if a breakoint or watchpoint had been reached.
g ; immidetly stop again
g ; immidetly stop again
g ; immidetly stop again

When I switch do console debugger it works
xx ; switch to console
g ; emulation runs until I start my bad program and the memwatch point is reached
HH ; show history, nice!


Is there still a bug or do I something wrong?
selco is offline  
Old 09 June 2017, 10:22   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,531
GUI debugger is not supported. I didn't make it and I don't use it. Basic options probably work, most GUI-only features probably have problems.
Toni Wilen is offline  
Old 09 June 2017, 11:26   #5
selco
Registered User
 
Join Date: Aug 2013
Location: Germany
Posts: 41
OK, I will try to remember next time ;-)

Thanks Toni, I found the hit with the help of the PC history eventually. There was a snprintf-call that used getenv("HOME") as an argument and HOME was not set... (porting a linux-program with gcc and libnix)

Thanks Alexander
selco is offline  
Old 10 June 2017, 21:45   #6
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,531
It usually is null pointer (or null pointer + offset). It is too common

Perhaps some kind of UAE AmigaOS "debug" mode would be useful, for example internal segtracker like thingy (which would be nearly completely in UAE side so that debugger can easily access the data even when AmigaOS side is too corrupted) and hooking to LoadSeg() so that debugged program gets loaded to special reserved debug memory space, no more annoying changing segment addresses between debug sessions!
Toni Wilen is offline  
Old 10 June 2017, 23:44   #7
alpine9000
Registered User

 
Join Date: Mar 2016
Location: Australia
Posts: 348
Quote:
Originally Posted by Toni Wilen View Post
It usually is null pointer (or null pointer + offset). It is too common

Perhaps some kind of UAE AmigaOS "debug" mode would be useful, for example internal segtracker like thingy (which would be nearly completely in UAE side so that debugger can easily access the data even when AmigaOS side is too corrupted) and hooking to LoadSeg() so that debugged program gets loaded to special reserved debug memory space, no more annoying changing segment addresses between debug sessions!
Yes please!
alpine9000 is online now  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
WinUAE debugger TreacleWench support.WinUAE 3 16 December 2016 14:49
Need help using the WinUAE Debugger Steve support.WinUAE 9 10 January 2009 20:00
WinUAE Debugger BippyM support.WinUAE 7 02 April 2008 07:59
WinUAE Debugger help Jherek Carnelia Coders. General 3 26 May 2007 15:52
WinUAE Debugger ???? RetroMan support.WinUAE 2 27 January 2004 12:17

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 02:22.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.22677 seconds with 11 queries