28 March 2016, 12:18 | #1 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 882
|
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 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) 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 Anyone have any other ideas for debugger hacks ? Source is on my fork of FS-UAE: https://github.com/alpine9000/fs-uae.git |
28 March 2016, 16:45 | #2 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,357
|
Jolly good!
|
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 |
|
|