English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 28 March 2016, 12:18   #1
alpine9000
Registered User

 
Join Date: Mar 2016
Location: Australia
Posts: 722
Hacking the fs-uae console debugger

Being a noob I need a debugger. I think the UAE console debugger is pretty cool.

So today I hacked some stuff into it that I was used to coming from GDB. I thought I'd share this here in case anyone else finds it useful.

Firstly I added gnu readline support. The main advantage this gives me is "up arrow" history. The history is saved to disk so each time I run FS-UAE, my commands from the previous run are there. You pretty much get all the features of the bash command editor (search, cut paste etc). I also made another small change so that hitting "enter" without a command runs the previous command, so if you're stepping through a bunch of code you can go "t" or "z", then just keep hitting enter.

Next I wanted symbols. I only debug bootblock run programs, so there are no symbols on the adf, so I added an option to tell fs-uae to load the symbols from a file. The file is just is list of names and addresses, that I generate with vlink or objdump.

So now, any command in the debugger that takes an address will optionally take a symbol:

Code:
>f Entry
Breakpoint added
>fl
00004008 (Entry) 
>f Entry
Breakpoint removed
or

Code:
>d MainLoop
MainLoop:
00004078 4eb9 0000 4314           JSR $00004314 (WaitVerticalBlank)
0000407E 6100 0124                BSR.W #$0124 == $000041a4 (InstallPalette)
00004082 207a 0244                MOVEA.L (PC,$0244) == $000042c8 (offscreen),A0
00004086 7003                     MOVE.L #$00000003,D0
00004088 323c 000a                MOVE.W #$000a,D1
0000408C 243a 00a6                MOVE.L (PC,$00a6) == $00004134 (ypos),D2
00004090 4eb9 0001 8594           JSR $00018594 (BlitFillColor)
Whenever an address matches a symbol during disasm the symbol name (should) be shown.

The last thing I added was tab completion for symbol names. So if you type a command then the start of a symbol you can hit TAB and it will complete it, or show you a list of matches:

Code:
>d doy<TAB>
doy_full_000015  doy_lcopy_near   doy_literal      doy_mcopy        doy_mgetlen      doy_mrefill      doynaxdepack
doy_full_000018  doy_lendlen      doy_lsingle      doy_mendlen1     doy_mhalf        doy_return       
doy_lcopy        doy_lgetlen      doy_match        doy_mendlen2     doy_mprefix      doy_table
So far I am finding the hacks really useful. There might be some issues as I haven't exhaustively tested it yet, but the changes were all pretty simple.

Anyone have any other ideas for debugger hacks ?

Source is on my fork of FS-UAE:

https://github.com/alpine9000/fs-uae.git
alpine9000 is online now  
Old 28 March 2016, 16:45   #2
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,821
Jolly good!
idrougge 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
Added SegTracker to FS-UAE's Debugger lallafa support.FS-UAE 7 16 January 2016 11:03
Step commands in debugger are throwing exceptions in console Dr. MefistO support.WinUAE 8 29 December 2015 13:48
Hacking an LCD TV Photon support.Hardware 5 21 October 2008 22:38
Hacking attempt Hercules Coders. General 18 26 December 2005 01:47

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 08:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.05587 seconds with 13 queries