Re: [hatari-devel] section, symbols and autocompletion

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 01/01/2018 à 01:18, Eero Tamminen a écrit :
Hi,

On 12/29/2017 04:14 PM, Nicolas Pomarède wrote:
while in the debugger, I noticed that if I enter 'm' and press 'tab' then only the symbols declared in the BSS or DATA sections are displayed.

On the other end, if I enter 'd' and press 'tab', only the symbols in the TEXT section are displayed.

But it's not rare to put everything in the TEXT section and don't use DATA or BSS when coding in asm.

Don't all symbols then have TEXT type?

Having "BSS-like symbols" in TEXT section would just be weird,
because the point of BSS is that the area is zeroed by OS
when the program starts, unlike with DATA section.


Hi and happy new year to all !

Yes, all the symbols have the text type in that case (bss was a bad example as indeed they can't be put in the text section).



Also, you could have a music player in the data section whose code you want to see when using 'd'.
For example :

     DATA
music
     incbin "music.bin"

Then when doing 'd'+'tab', 'music' should be listed in the completion choices.

Maybe symbols autocompletion should not limit to a specific type of section ? (or add an option to do this)

Eero, what do you think ?

There were few reasons for limiting.  Large C-programs can easily
have thousands of symbols.  Limiting the auto-completion makes
things easier, especially if there are TEXT & DATA symbols with
same names.  It avoid user accidentally using wrong symbol, by
not providing choices that are in most cases bogus.

Is that possible to have the same name both in text and data section ? At least in asm I don't think so and in C you can't give the same name to a variable and a function (or maybe if using different source files and handling this at linking time ?)

Also, if one reason for limiting completion to text or data section is the time it takes to search for the symbol or the memory needed to handle the symbols lists in the debugger, I think that given today's PC with CPU and RAM we can remove this limitation.


Note that only auto-completion is limited, the actual disassembly
will still show all symbol types, that are on disassembled addresses (instead of between them).  And you can still type the symbol name
in full.

What others think?

* Should this be changed
* Or should there be an option for it
?

For people coming from real ST and using MonST or adebog, I think a better default would be to auto complete everything.

It all depends on how people use Hatari to code ; based on the most recent programs relased for ST, it would seem that people mostly code demos, then a few games were released (which often require asm for proper performance) and not that much program using C for example.

But maybe I'm biased :)

Nicolas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/