From 7fa197337b9f168914417734aeb63a3173ccaf9b Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 19 Aug 2011 14:31:03 +0000 Subject: [PATCH] Add the number of attached lines and scopes to a span. git-svn-id: svn://svn.cc65.org/cc65/trunk@5229 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/dbginfo/dbginfo.c | 10 ++++++++++ src/dbginfo/dbginfo.h | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/dbginfo/dbginfo.c b/src/dbginfo/dbginfo.c index 1f91c637b..60a813798 100644 --- a/src/dbginfo/dbginfo.c +++ b/src/dbginfo/dbginfo.c @@ -1481,6 +1481,16 @@ static void CopySpanInfo (cc65_spandata* D, const SpanInfo* S) D->span_start = S->Start; D->span_end = S->End; D->segment_id = S->Seg.Info->Id; + if (S->ScopeInfoList) { + D->scope_count = CollCount (S->ScopeInfoList); + } else { + D->scope_count = 0; + } + if (S->LineInfoList) { + D->line_count = CollCount (S->LineInfoList); + } else { + D->line_count = 0; + } } diff --git a/src/dbginfo/dbginfo.h b/src/dbginfo/dbginfo.h index 04eff93d8..42edec502 100644 --- a/src/dbginfo/dbginfo.h +++ b/src/dbginfo/dbginfo.h @@ -265,6 +265,8 @@ struct cc65_spandata { cc65_addr span_start; /* Start of the span */ cc65_addr span_end; /* End of the span (inclusive!) */ unsigned segment_id; /* Id of the segment */ + unsigned line_count; /* Number of lines attached */ + unsigned scope_count; /* Number of scopes attached */ }; typedef struct cc65_spaninfo cc65_spaninfo; @@ -426,8 +428,7 @@ typedef enum { * - For an import, the fields symbol_value and segment_id are taken from * the export, if it is available, since imports have no value or segments * by itself. - * - For an import symbol_type and symbol_size are more or less unusable - * because they don't have a meaning for imports. + * - For an import symbol_size doesn't have a meaning. * - For normal symbols (not cheap locals) parent_id contains CC65_INV_ID, * for cheap locals it contains the symbol id of the parent symbol. */ -- 2.39.5