Re: [hatari-users] nm style symbols |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-users Archives
]
- To: hatari-users@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-users] nm style symbols
- From: Charles Curley <charlescurley@xxxxxxxxxxxxxxxxx>
- Date: Thu, 24 Dec 2020 12:50:19 -0700
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=charlescurley.com; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:To:From:Date:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Vs0upmPRq0arn9tloI9oPQr1auI5sXBXL2qRUQmnuU4=; b=FJ9MumKVA594dIobNn7aE8aoHQ gNKXef9eOLZ2AZ2FnkyUo5Q6PLOZvi3GV6FJreytxVQ0h4sWTcmrICcCYCxXzKpdq7dUM545P+HEE +bWAH+BaRfNuG1dugitV+RIVwm9I969x8NAxVZlWOuUw3spFBGBP9spjp2JXjz8ho8GcNt5OtHewX debtsyShEaLHKPm7RyPv58J89SIROTDs/2flQqECCypUaBhPyWvz/uh2iceJB1SI/aaSlapGssRIG MJNIR345gaSFCYxw2e0x1yYjJHjCQfg6nm1xVZtUOM88C69sJpO3URPB7uOqIDviylb/py514yUJy XREYFjww==;
- Organization: occasionally
On Thu, 24 Dec 2020 12:20:22 +0200
Eero Tamminen <oak@xxxxxxxxxxxxxx> wrote:
> Hi,
>
> On 12/23/20 9:38 PM, Charles Curley wrote:
> > On Wed, 23 Dec 2020 12:43:23 +0200
> > Eero Tamminen <oak@xxxxxxxxxxxxxx> wrote:
> >> On 12/23/20 2:44 AM, Charles Curley wrote:
>
> >> If I remember right, symbol names match pattern:
> >> [a-zA-Z0-9_.]+
>
> Actually:
> [a-zA-Z0-9_.-]+
>
> See:https://git.tuxfamily.org/hatari/hatari.git/tree/src/debug/symbols.c#n891
Thanks, most useful. That also answers another question, which I now
need not ask.
>
>
> > It seems to accept [0-9], but trying to set a breakpoint on some of
> > them causes problems, so effectively those are also out.
>
> Could you give a concrete example of what fails?
One obvious one is a symbol of "0", which I actually have. If I try to
set a breakpoint on it with "a 0", the debugger, not unreasonably,
takes that as a breakpoint on the address of 0.
Otherwise, leading numbers don't seem to be a problem. I tested with
"0EQ", and that worked correctly. I haven't tried others. I remember
having a problem with a symbol with a number in it, but now I don't
recall what the symbol was.
>
>
> > Otherwise, that agrees with my experience.
> >
> > I now have a shell script that substitutes two letter sequences for
> > unaccepted characters. Awkward, but it should work.
>
> When doing profiling, I sometimes use scripts also
> to remove some symbols that mess up profiling
> (profiling is faster and you get better profile
> info if you remove loop labels).
A good idea. If I use the profiling, I'll keep that in mind.
>
>
> >>> The documentation mentions creating symbols by hand. How does one
> >>> do that, and how does one then preserve such symbols?
> >>
> >> You just write the file in some text editor
> >> and load that in debugger.
> >
> > Ah. I was thinking there was a way to define symbols within the
> > debugger. This works.
>
> Symbols are in a fixed sized array to speed up
> binary searches done during profiling.
>
> (Symbol addresses are used to indicate which
> addresses profiling tracks. These checks need
> to be done on every instruction during profiling,
> so speed is critical.)
>
> One could of course re-alloc the symbol table,
> but I think doing that for each new symbol could
> easily fragment memory, so I haven't added support
> for that yet, as then one would need to support
> also saving the symbols (either as absolute, or
> relative to program address etc)...
Ah, yes. Or consider a binary tree. It takes longer to load up, but
would be very quick to search. (I have no idea how you are doing it
now, so that may be out of order.)
>
>
> > I now have a lot of what I need to generate an ASCII symbol table at
> > compile time.
>
> Have you thought of generating the standard DRI
> symbol table for the binary, like Atari specific
> compilers and assemblers do?
I will if I need to. For now, the ASCII symbols get me what I want.
--
Does anybody read signatures any more?
https://charlescurley.com
https://charlescurley.com/blog/