Re: [cc65] New version of debug info available

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2011-08-23 14:41:27
Hi!

On Tue, Aug 23, 2011 at 01:34:18PM +0300, thefox xofeht wrote:
> I noticed that if I retrieve spans for an address using
> cc65_span_byaddr, and then retrieve scopes for each span with
> cc65_scope_byspan, the scopes come out in sorted order (global scope
> first, then other scopes in order). Is it OK to rely on this or should
> I use the scopes' parent_id to figure out their relationships?

This is because the scopes are sorted by id and the ids are given in the order
the scopes are created by the assembler. Anyway, I wouldn't rely on that,
because it is unintentional (id order being "the right" order) and may change.

I will look over the calls and document what you can expect, but first I need
to finish it. What I can say now is that the cc65_get_xxxlist calls do always
return all items, that the items will be in id order, and that the ids are
continous. Which finally means that cc65_xxxinfo.data can be accessed as an
array indexed by id.

So while I wouldn't recommand that for all items, it is possible and probably
advisable to cache the smaller lists like files, modules and segments (don't
forget to delete them before you call cc65_free_dbginfo). Once you have the
file or segment list, if you have a file or segment id you can simply locate
the matching entry my accessing cc65_fileinfo.data[file_id] or
cc65_segmentinfo.data[segment_id].

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Aug 23 14:41:34 2011

This archive was generated by hypermail 2.1.8 : 2011-08-23 14:41:37 CEST