Re: [hatari-devel] symbols not always loaded when entering debugger ?

[ Thread Index | Date Index | More Archives ]


On 11/13/2017 04:10 PM, Nicolas Pomarède wrote:
Le 12/11/2017 à 22:29, Eero Tamminen a écrit :
I confirm that with your latest changes there's no more warning "ignoring symbol xxxx with invalid offset" when symbol is the last of a section.

Still, I see some warning if 2 symbols share the same address, I'm not sure this is meaningful as this can be done on purpose in the source code.
See the attached .s and .prg for an example :



WARNING: symbols 'buf' & 'end_main' have the same 0x128ba address.

In the case where bss section is allocated just after the text section, addresses will be the same.

Sure.  However, normally most of the symbols come from libraries
user is linking, not from the code user has written himself.

For example, calling memcpy() instead of memmove() when src & dst
address ranges overlap, would be a bug.  C-library itself can
alias the functions though, if it's memcpy() implementation is
safe for this.  So, user could get confused when seeing memcpy()
symbol in disassembly, when he called memmove() in his own code.
That's why the warning is needed.

-> I added extra message about why user should be aware of
   the symbol name & address duplicates.

Also, you can test the case where symbols are not loaded after the crash. run the attached prg and when screen goes "green", press alt+pause to go to debugger and symbols will be loaded. Now go back to emulation (press 'c') and press "space" to create a 3 bombs address error.
Debugger is called, but symbols are not loaded.

As symbols are already loaded, there's no point in debugger loading
them again for the same program, when debugger is re-entered.

>As Thorsten suggested,
this might because the prg is not running anymore from TOS point of view, but still if you compare with "monst" for example, it would be good to have symbols anyway from the prg that was running.

Maybe symbols could be loaded once at start, and not later when entering debugger ?

They *are* loaded only once, automatically, when the debugger
is entered for the first time after starting given program.

(Unless user has re-started the program, at which point debugger
does(?) the right thing and re-loads the symbols, in case program
changed, or it got located to different address.)

Btw. To avoid debugger being invoked at TOS bootup exceptions,
you can use "--debug-except" option instead of "-D" one:
	hatari --debug-except autostart,address ./test.prg

"autostart" flag will enable the selected exceptions only when
TOS autostarts(*) the indicated program.

	- Eero

(*) as instructed by Hatari with the modified/virtual *.INF file.

PS. I'm on the list, please drop me from CC and reply just to the list.

(At least my email program, Thunderbird, has an option where replies
to a message on list automatically go just to the list.)

Mail converted by MHonArc 2.6.19+