English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 14 April 2012, 10:39   #1
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 290
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?
copse is offline  
Old 14 April 2012, 22:17   #2
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by copse View Post
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.
matthey is offline  
Old 15 April 2012, 02:57   #3
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 290
Quote:
Originally Posted by matthey View Post
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 is offline  
Old 15 April 2012, 05:52   #4
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 290
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.

Last edited by copse; 15 April 2012 at 07:17. Reason: Further work on Barfly format.
copse is offline  
Old 17 April 2012, 13:40   #5
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,919
Quote:
Originally Posted by matthey View Post
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.
phx is offline  
Old 18 April 2012, 04:26   #6
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by phx View Post
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.
matthey is offline  
Old 20 April 2012, 16:41   #7
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,919
Quote:
Originally Posted by matthey View Post
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.
phx is offline  
Old 21 April 2012, 20:08   #8
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
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 View Post
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?

Last edited by matthey; 21 April 2012 at 20:17.
matthey is offline  
Old 23 April 2012, 16:30   #9
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,919
Quote:
Originally Posted by matthey View Post
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.
phx 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
HELP! HD contents to CD-ROM trilobitepix request.Other 1 17 May 2009 22:29
List of contents skateblind HOL suggestions and feedback 0 10 May 2009 14:43

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 03:33.


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