English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 18 April 2016, 11:27   #1
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
Can I find what ASM has executed so far?

Hello, is there a way how to see what ASM is being executed (or the last ASM commands executed before current point? from WinUAE or other?
Sim085 is online now  
Old 18 April 2016, 13:01   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,120
If any breakpoint is active (f <something>), UAE debugger H-command will list last (up to 500) executed commands. HH does same but also includes all registers.
Toni Wilen is online now  
Old 18 April 2016, 14:46   #3
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
Yes but you need to know the address to add the breakpoints (f <address>). I do not know the address in memory

I was hoping I could run the program till the part I am interested in and see what commands are being executed so I can then find these in the program ASM file.

Quote:
Originally Posted by Toni Wilen View Post
If any breakpoint is active (f <something>), UAE debugger H-command will list last (up to 500) executed commands. HH does same but also includes all registers.
Sim085 is online now  
Old 18 April 2016, 14:49   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,120
Quote:
Originally Posted by Sim085 View Post
Yes but you need to know the address to add the breakpoints (f <address>). I do not know the address in memory
Address does not matter. Even "f 0" works in this case. Breakpoint is only needed to enable execution history.
Toni Wilen is online now  
Old 18 April 2016, 15:35   #5
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
I am not home at the moment so cannot try this out. Correct me if I am wrong. So I can launch Workbench from WinUAE, press Shift+F12, enter command "f 1", enter "xx" to go back Workbench, run the program and when I arrive to the where I am interested in I Shift+F12 again and enter "H"?

Quote:
Originally Posted by Toni Wilen View Post
Address does not matter. Even "f 0" works in this case. Breakpoint is only needed to enable execution history.
Sim085 is online now  
Old 18 April 2016, 18:40   #6
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
When I do these steps all I get is the following line repeated for 10 times.

-1 00F81476 60e6 BT .B #$ffffffe7 == $00f8146e (T)

Quote:
Originally Posted by Sim085 View Post
I am not home at the moment so cannot try this out. Correct me if I am wrong. So I can launch Workbench from WinUAE, press Shift+F12, enter command "f 1", enter "xx" to go back Workbench, run the program and when I arrive to the where I am interested in I Shift+F12 again and enter "H"?
Sim085 is online now  
Old 18 April 2016, 19:43   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,120
JIT enabled? (Many debugger options don't work with JIT).
Toni Wilen is online now  
Old 18 April 2016, 21:06   #8
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
No do not have JIT enabled.

Quote:
Originally Posted by Toni Wilen View Post
JIT enabled? (Many debugger options don't work with JIT).
Sim085 is online now  
Old 18 April 2016, 22:19   #9
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
Sometimes I get what looks like valid assembly (i.e. - different commands one after the other). However when I look for these commands in the assembly file I have I don't find any of these.


Quote:
Originally Posted by Sim085 View Post
No do not have JIT enabled.
Sim085 is online now  
Old 19 April 2016, 10:31   #10
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
I spent hours on this yesterday but can't really understand what is going on. So I have the assembly of the app I am interested in by using ReSource.

There is a lot of assembly and I am only interested in one area. So my idea was to run the app until that part I want to modify, see what assembly was being executed, find that assembly sequence in the assembly I have through ReSource, understand it, modify it, re-assemble.

However I cannot find any assembly I get from WinUAE debuger

Could it be I am getting assembly from another program running at the same time? For example, one assembly line belongs to the app and the next from another program and then again from app, etc etc?
Sim085 is online now  
Old 19 April 2016, 10:38   #11
demolition
Unregistered User
demolition's Avatar
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 38
Posts: 3,772
If you are running with the system enabled, you could see code from the system. Also, if the source data are compressed on the disk, you need to decrunch it before you will be able to compare it with what you find in memory.
demolition is offline  
Old 19 April 2016, 11:34   #12
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
How do I run without system enabled? Run from adf's instead of workbench?

Quote:
Originally Posted by demolition View Post
If you are running with the system enabled, you could see code from the system. Also, if the source data are compressed on the disk, you need to decrunch it before you will be able to compare it with what you find in memory.
Sim085 is online now  
Old 19 April 2016, 12:12   #13
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,120
STOP-command may confuse it. Better boot some game or demo that takes over the system and use it to learn how it works.

If you want to trace your own program, usually best way is to put some illegal memory access and use memwatch points. For example put clr.w $100 in your code and add memwatch point with debugger command "w 0 100 2 w" (memwatch point index zero, watch addresses from $100 to $100+2, CPU writes only).
Toni Wilen is online now  
Old 19 April 2016, 12:37   #14
demolition
Unregistered User
demolition's Avatar
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 38
Posts: 3,772
Quote:
Originally Posted by Sim085 View Post
How do I run without system enabled? Run from adf's instead of workbench?
That is controlled by the software you are running. Earlier commercial games and demos that boot from floppy usually turn off the system. If you can drag down the screen and reveal WB behind it (like DPaint, DOpus etc), then it is surely system friendly and you can't change that. If it can be started from WB that is an indication that it is system friendly, although it may not always be the case (WHDLoad turns off the system for example).
demolition is offline  
Old 19 April 2016, 14:36   #15
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
mmm... have to find how to add a new command from ReSource. So far I have only managed to edit existing commands.

Quote:
Originally Posted by Toni Wilen
For example put clr.w $100 in your code and add memwatch point with debugger command "w 0 100 2 w"


So for a game if it would be easier if doing debugging while running in WHDload?

Quote:
Originally Posted by demolition View Post
(WHDLoad turns off the system for example).
Sim085 is online now  
Old 19 April 2016, 14:42   #16
demolition
Unregistered User
demolition's Avatar
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 38
Posts: 3,772
Quote:
Originally Posted by Sim085 View Post
So for a game if it would be easier if doing debugging while running in WHDload?
But then you'll be looking at the WHDLoad version of the software you're interested in. It may be similar to a floppy version, but it could also be changed in many ways to remove copy protection, create trainers, modify keyboard/joy/mouse handler or to allow for relocation of code to other memory addresses, i.e. to move stuff to fastmem which may have been originally hardcoded to run in chip.

Edit: But I don't know what your goal is - if you just want to make some changes and see it working, then starting out with a WHDLoad version is probably easier than dealing with a floppy version with a custom loader where files may be compressed in some way.
demolition is offline  
Old 19 April 2016, 15:22   #17
Sim085
Registered User
 
Join Date: Apr 2009
Location: Lija
Posts: 464
Spot on I am mostly learning at this stage. Not planning to do anything fruitful any time soon. I want to get familiar with the tools.



Quote:
Originally Posted by demolition View Post
Edit: But I don't know what your goal is - if you just want to make some changes and see it working
Sim085 is online now  
Old 19 April 2016, 15:25   #18
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
from my point of understanding, Sim085 is looking for somthing like gdb, from the gnu compiler package.
I for myself never managed to get some usefull results from winuae debugger - not a judgement - just my limitations.
but i think gdb, or some kind of program-only-debugger would give better result.
a tutorial you can find on os4coding - at least worth a look.
#1) I'm not sure, gdb will work with prgram files without source code - need to test this by myself
emufan 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
Asm-One crashes in 3.1.0 b00mer support.WinUAE 4 10 November 2015 10:11
Tool to convert asm to gnu asm (gas) Asman Coders. Asm / Hardware 6 12 October 2013 13:45
Need an ASM manual VoltureX Coders. General 2 17 November 2011 16:24
For my First ASM Prog BippyM Coders. Tutorials 44 03 September 2010 16:06
ASM Uni Course BippyM Coders. Tutorials 27 18 September 2008 11:37

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:14.


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