English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. General (https://eab.abime.net/forumdisplay.php?f=37)
-   -   HUNK_DEBUG contents (https://eab.abime.net/showthread.php?t=63895)

copse 14 April 2012 10:39

HUNK_DEBUG contents
 
Writing my own Amiga executable parser, one of the aspects which I find it difficult to locate information on is the structure of HUNK_DEBUG hunks.

I've added a breakdown of the SAS C line debug hunk structure to my wiki page.

Does anyone know of documentation on other types of HUNK_DEBUG hunks?

matthey 14 April 2012 22:17

Quote:

Originally Posted by copse (Post 812538)
Does anyone know of documentation on other types of HUNK_DEBUG hunks?

No, but I can tell you there is more. There is HiSoft Compressed Line Numbers (HCLN). It's supported by Devpac v3 at least which the manual says of the HCLN option:

"generate HCLN (HiSoft Compressed Line Numbers)
debug hunks for this file. These provide the same
information as LINE hunks but normally require only 2
bytes of extra information per line that generates code."

Good luck finding specific information on it though. It's probably better to stick with SAS/C style LINE debug anyway as size isn't so much an issue anymore.

Vbbc looks like it can output DWARF2 debugging information inside an Amiga hunk executable. I'm not sure what and how that is supported but the vbbc docs have information:

http://sun.hasenbraten.de/vbcc/

The Dwarf2 format documentation is readily available elsewhere. How and what fits in an Amiga hunk executable is I don't know.

copse 15 April 2012 02:57

Quote:

Originally Posted by matthey (Post 812677)
No, but I can tell you there is more. There is HiSoft Compressed Line Numbers (HCLN). It's supported by Devpac v3 at least which the manual says of the HCLN option:

"generate HCLN (HiSoft Compressed Line Numbers)
debug hunks for this file. These provide the same
information as LINE hunks but normally require only 2
bytes of extra information per line that generates code."

Good luck finding specific information on it though. It's probably better to stick with SAS/C style LINE debug anyway as size isn't so much an issue anymore.

Vbbc looks like it can output DWARF2 debugging information inside an Amiga hunk executable. I'm not sure what and how that is supported but the vbbc docs have information:

http://sun.hasenbraten.de/vbcc/

The Dwarf2 format documentation is readily available elsewhere. How and what fits in an Amiga hunk executable is I don't know.

Thanks for the pointers. There's also the Barfly variant which includes embedded source code. It's good to be aware of these, for future exploration.

copse 15 April 2012 05:52

I don't know why, but I spent an hour or two this afternoon looking into some obscure debug hunks. It's not productive time spent, but it's added to the wiki page.
  • Added Devpac HEAD debug hunk information.
  • Added probably most of the Devpac HCLN debug hunk information.
  • Added the Barfly ODEF "full source code" debug hunk format.

phx 17 April 2012 13:40

Quote:

Originally Posted by matthey (Post 812677)
Vbbc looks like it can output DWARF2 debugging information inside an Amiga hunk executable. I'm not sure what and how that is supported

This is just a side effect of DWARF2 being the default debugging format in vbcc. There is no debugger which understands DWARF in a Hunk format executable.
Usually you will specify -g together with the -hunkdebug option to make vbcc output SAS/C-style LINE debug information instead.

matthey 18 April 2012 04:26

Quote:

Originally Posted by phx (Post 813209)
This is just a side effect of DWARF2 being the default debugging format in vbcc. There is no debugger which understands DWARF in a Hunk format executable.
Usually you will specify -g together with the -hunkdebug option to make vbcc output SAS/C-style LINE debug information instead.

Hi Frank,

I noticed that I needed "vc -g -hunkdebug MyProgram.c" in order to get hunk symbols. Why isn't the vbbc -hunkdebug option the default in vbcc:config/aos68k? GCC 2 and 3 (support the Amiga hunk format) don't need a switch for Amiga symbol hunks (included by default). I don't know what kind of debug hunks they can output though.

Your new 68k optimizations in vasm have been working well. I found some compiled code with a simple peephole optimization that we somehow missed. Vasm could optimize:

lea 0,An -> suba.l An,An

The Natami fpga CPU project was split from the Natami project and is now called the Apollo. This was done to market to and support other customers better. I have been busy helping with that. I am working on some of the documentation and will probably contact you in the next few weeks about ISA changes and support.

phx 20 April 2012 16:41

Quote:

Originally Posted by matthey (Post 813358)
Why isn't the vbbc -hunkdebug option the default in vbcc:config/aos68k? GCC 2 and 3 (support the Amiga hunk format) don't need a switch for Amiga symbol hunks (included by default).

In most cases you don't want symbols in your executable, to limit its size and to make reengineering of your code harder.

If somebody doesn't like that then it is easy for him to add the options to the aos68k config file. ;)

Quote:

Vasm could optimize:

lea 0,An -> suba.l An,An
Thanks. Will add that.

Quote:

will probably contact you in the next few weeks about ISA changes and support.
Ok.

matthey 21 April 2012 20:08

Quote:

Originally Posted by matthey
Why isn't the vbbc -hunkdebug option the default in vbcc:config/aos68k? GCC 2 and 3 (support the Amiga hunk format) don't need a switch for Amiga symbol hunks (included by default).

Quote:

Originally Posted by phx (Post 813833)
In most cases you don't want symbols in your executable, to limit its size and to make reengineering of your code harder.

If somebody doesn't like that then it is easy for him to add the options to the aos68k config file. ;)

I would expect the -hunkdebug option to select Amiga hunkdebug format (and symbols) but not output them unless the vbcc -g option is specified. That would make setting the hunkdebug option in vbcc:config/aos68k have no disadvantage that I see. It would be less confusing to programmers I would think. Maybe it's not easy to do it that way or it would be more confusing to change it now?

phx 23 April 2012 16:30

Quote:

Originally Posted by matthey (Post 814015)
I would expect the -hunkdebug option to select Amiga hunkdebug format (and symbols) but not output them unless the vbcc -g option is specified. That would make setting the hunkdebug option in vbcc:config/aos68k have no disadvantage that I see.

Er... indeed. Now I understand you. Clever idea. Done. :)

Quote:

Vasm could optimize:

lea 0,An -> suba.l An,An
Done.


All times are GMT +2. The time now is 14:29.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04593 seconds with 11 queries