Search site Dead Hackers Society
Other BBSes »

Sillyventure 2017
Demoscene   º   Coding   º   CT60   º   Buy/sell   º   Misc/crap   º   Alive magazine   º   SNDH/Tracking

Atari coding BBS
Re: gcc and hatari debugging
Posted by: dml Jul,06.2017-17:24 


There are at least two different ways to get labels into Hatari from an external program. Hatari can sometimes lift them direct from the .prg by using the command:

'symbols prg'

This works fine with Devpac/VASM programs - however I don't remember it working too well with GCC (4.6). It just reports no symbols or complains about the format.

There is a separate route you can use for GCC programs. Use the 'nm' tool which comes with gcc to output an ascii file for the symbol table.

You then filter this file (with grep, SED or whatever) to get rid of lines representing locals, interrupt vectors or other stuff you don't want during debugging (or profiling). You can then import the filtered file into Hatari with:

'symbols mysym.txt TEXT DATA BSS'

The last 3 terms specify the order/mapping of symbols in the .txt to the various memory spaces at runtime. However this process is also a bit funny - if you get problems with offsets being wrong for some symbols (particularly data/bss), try just using 'TEXT' or 'TEXT TEXT BSS'. It's been a while since I used this so I can't remember exactly the magic combination that works :D

If this isn't clear I can dig out the relevant make rules as an example.

[All messages in this thread]

Topic Posted by  Date 
gcc and hatari debugging MKM Jul,06.2017-13:11
  Re: gcc and hatari debugging dml Jul,06.2017-17:24
    Re: gcc and hatari debugging dml Jul,06.2017-17:32
      Re: gcc and hatari debugging ggn Jul,06.2017-19:05
        Re: gcc and hatari debugging MKM Jul,06.2017-21:21
  Re: gcc and hatari debugging mikro Jul,06.2017-23:13
    Re: gcc and hatari debugging MKM Jul,07.2017-09:07
      Re: gcc and hatari debugging saulot Jul,07.2017-21:39

Reply to this message
Human verification (enter the text of the ASCII-art below):

       _       _ _             _   
 _____|_|___ _| | |_ ___ _____| |_ 
|     | |   | . | . | . |     | . |

© 1994-2016 Dead Hackers Society Contact: Anders Eriksson