-static void* CollAt (Collection* C, unsigned Index)
+static void* CollAt (const Collection* C, unsigned Index)
/* Return the item at the given index */
{
/* Check the index */
-static const void* CollConstAt (const Collection* C, unsigned Index)
-/* Return the item at the given index */
-{
- /* Check the index */
- assert (Index < C->Count);
-
- /* Return the element */
- return C->Items[Index].Ptr;
-}
-
-
-
-static unsigned CollIdAt (Collection* C, unsigned Index)
+static unsigned CollIdAt (const Collection* C, unsigned Index)
/* Return the id at the given index */
{
/* Check the index */
/* File info */
for (I = 0; I < CollCount (FileInfos); ++I) {
- const FileInfo* FI = CollConstAt (FileInfos, I);
+ const FileInfo* FI = CollAt (FileInfos, I);
printf ("File info %u:\n"
" Name: %s\n"
" Size: %lu\n"
-static LineInfo* FindLineInfoByLine (Collection* LineInfos, cc65_line Line)
+static LineInfo* FindLineInfoByLine (const Collection* LineInfos, cc65_line Line)
/* Find the LineInfo for a given line number. The function returns the line
* info or NULL if none was found.
*/
-static SegInfo* FindSegInfoByName (Collection* SegInfos, const char* Name)
+static SegInfo* FindSegInfoByName (const Collection* SegInfos, const char* Name)
/* Find the SegInfo for a given segment name. The function returns the segment
* info or NULL if none was found.
*/
int Cur = (Lo + Hi) / 2;
/* Get item */
- const ScopeInfo* CurItem = CollConstAt (ScopeInfos, Cur);
+ const ScopeInfo* CurItem = CollAt (ScopeInfos, Cur);
/* Compare */
int Res = strcmp (CurItem->Name, Name);
int Cur = (Lo + Hi) / 2;
/* Get item */
- const SymInfo* CurItem = CollConstAt (SymInfos, Cur);
+ const SymInfo* CurItem = CollAt (SymInfos, Cur);
/* Compare */
int Res = strcmp (CurItem->Name, Name);
-static int FindSymInfoByValue (Collection* SymInfos, long Value, unsigned* Index)
+static int FindSymInfoByValue (const Collection* SymInfos, long Value,
+ unsigned* Index)
/* Find the SymInfo for a given value. The function returns true if the
* value was found. In this case, Index contains the index of the first item
* that matches. If the item wasn't found, the function returns false and
const cc65_libraryinfo* cc65_get_librarylist (cc65_dbginfo Handle)
/* Return a list of all libraries */
{
- DbgInfo* Info;
- Collection* LibInfoById;
+ const DbgInfo* Info;
cc65_libraryinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
-
- /* Get a pointer to the library list */
- LibInfoById = &Info->LibInfoById;
+ Info = Handle;
/* Allocate memory for the data structure returned to the caller */
- D = new_cc65_libraryinfo (CollCount (LibInfoById));
+ D = new_cc65_libraryinfo (CollCount (&Info->LibInfoById));
/* Fill in the data */
- for (I = 0; I < CollCount (LibInfoById); ++I) {
+ for (I = 0; I < CollCount (&Info->LibInfoById); ++I) {
/* Copy the data */
- CopyLibInfo (D->data + I, CollConstAt (LibInfoById, I));
+ CopyLibInfo (D->data + I, CollAt (&Info->LibInfoById, I));
}
/* Return the result */
* library information.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_libraryinfo* D;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (Id >= CollCount (&Info->LibInfoById)) {
D = new_cc65_libraryinfo (1);
/* Fill in the data */
- CopyLibInfo (D->data, CollConstAt (&Info->LibInfoById, Id));
+ CopyLibInfo (D->data, CollAt (&Info->LibInfoById, Id));
/* Return the result */
return D;
* module information.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_lineinfo* D;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (Id >= CollCount (&Info->LineInfoById)) {
D = new_cc65_lineinfo (1);
/* Fill in the data */
- CopyLineInfo (D->data, CollConstAt (&Info->LineInfoById, Id));
+ CopyLineInfo (D->data, CollAt (&Info->LineInfoById, Id));
/* Return the result */
return D;
* function returns NULL if no line information was found.
*/
{
- DbgInfo* Info;
- FileInfo* F;
+ const DbgInfo* Info;
+ const FileInfo* F;
cc65_lineinfo* D;
LineInfo* L = 0;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the source file id is valid */
if (FileId >= CollCount (&Info->FileInfoById)) {
* file id is invalid.
*/
{
- DbgInfo* Info;
- FileInfo* F;
+ const DbgInfo* Info;
+ const FileInfo* F;
cc65_lineinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the source file id is valid */
if (FileId >= CollCount (&Info->FileInfoById)) {
/* Fill in the data */
for (I = 0; I < CollCount (&F->LineInfoByLine); ++I) {
/* Copy the data */
- CopyLineInfo (D->data + I, CollConstAt (&F->LineInfoByLine, I));
+ CopyLineInfo (D->data + I, CollAt (&F->LineInfoByLine, I));
}
/* Return the allocated struct */
* returns NULL if the symbol id is invalid, otherwise a list of line infos.
*/
{
- DbgInfo* Info;
- SymInfo* S;
+ const DbgInfo* Info;
+ const SymInfo* S;
cc65_lineinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the symbol id is valid */
if (SymId >= CollCount (&Info->SymInfoById)) {
/* Fill in the data */
for (I = 0; I < CollCount (&S->DefLineInfoList); ++I) {
/* Copy the data */
- CopyLineInfo (D->data + I, CollConstAt (&S->DefLineInfoList, I));
+ CopyLineInfo (D->data + I, CollAt (&S->DefLineInfoList, I));
}
/* Return the allocated struct */
* returns NULL if the symbol id is invalid, otherwise a list of line infos.
*/
{
- DbgInfo* Info;
- SymInfo* S;
+ const DbgInfo* Info;
+ const SymInfo* S;
cc65_lineinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the symbol id is valid */
if (SymId >= CollCount (&Info->SymInfoById)) {
/* Fill in the data */
for (I = 0; I < CollCount (&S->RefLineInfoList); ++I) {
/* Copy the data */
- CopyLineInfo (D->data + I, CollConstAt (&S->RefLineInfoList, I));
+ CopyLineInfo (D->data + I, CollAt (&S->RefLineInfoList, I));
}
/* Return the allocated struct */
const cc65_moduleinfo* cc65_get_modulelist (cc65_dbginfo Handle)
/* Return a list of all modules */
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_moduleinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Allocate memory for the data structure returned to the caller */
D = new_cc65_moduleinfo (CollCount (&Info->ModInfoById));
/* Fill in the data */
for (I = 0; I < CollCount (&Info->ModInfoById); ++I) {
/* Copy the data */
- CopyModInfo (D->data + I, CollConstAt (&Info->ModInfoById, I));
+ CopyModInfo (D->data + I, CollAt (&Info->ModInfoById, I));
}
/* Return the result */
* module information.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_moduleinfo* D;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (Id >= CollCount (&Info->ModInfoById)) {
D = new_cc65_moduleinfo (1);
/* Fill in the data */
- CopyModInfo (D->data, CollConstAt (&Info->ModInfoById, Id));
+ CopyModInfo (D->data, CollAt (&Info->ModInfoById, Id));
/* Return the result */
return D;
const cc65_spaninfo* cc65_get_spanlist (cc65_dbginfo Handle)
/* Return a list of all spans */
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_spaninfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Allocate memory for the data structure returned to the caller */
D = new_cc65_spaninfo (CollCount (&Info->SpanInfoById));
/* Fill in the data */
for (I = 0; I < CollCount (&Info->SpanInfoById); ++I) {
/* Copy the data */
- CopySpanInfo (D->data + I, CollConstAt (&Info->SpanInfoById, I));
+ CopySpanInfo (D->data + I, CollAt (&Info->SpanInfoById, I));
}
/* Return the result */
* span information.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_spaninfo* D;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (Id >= CollCount (&Info->SpanInfoById)) {
D = new_cc65_spaninfo (1);
/* Fill in the data */
- CopySpanInfo (D->data, CollConstAt (&Info->SpanInfoById, Id));
+ CopySpanInfo (D->data, CollAt (&Info->SpanInfoById, Id));
/* Return the result */
return D;
* if no spans were found for this address.
*/
{
+ const DbgInfo* Info;
SpanInfoListEntry* E;
cc65_spaninfo* D = 0;
/* Check the parameter */
assert (Handle != 0);
+ /* The handle is actually a pointer to a debug info struct */
+ Info = Handle;
+
/* Search for spans that cover this address */
- E = FindSpanInfoByAddr (&((DbgInfo*) Handle)->SpanInfoByAddr, Addr);
+ E = FindSpanInfoByAddr (&Info->SpanInfoByAddr, Addr);
/* Do we have spans? */
if (E != 0) {
* if the line id is invalid, otherwise the spans for this line (possibly zero).
*/
{
- DbgInfo* Info;
- LineInfo* L;
+ const DbgInfo* Info;
+ const LineInfo* L;
cc65_spaninfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the line id is valid */
if (LineId >= CollCount (&Info->LineInfoById)) {
/* Fill in the data */
for (I = 0; I < CollCount (&L->SpanInfoList); ++I) {
/* Copy the data */
- CopySpanInfo (D->data + I, CollConstAt (&L->SpanInfoList, I));
+ CopySpanInfo (D->data + I, CollAt (&L->SpanInfoList, I));
}
/* Return the result */
* the scope id is invalid, otherwise the spans for this scope (possibly zero).
*/
{
- DbgInfo* Info;
- ScopeInfo* S;
+ const DbgInfo* Info;
+ const ScopeInfo* S;
cc65_spaninfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the scope id is valid */
if (ScopeId >= CollCount (&Info->ScopeInfoById)) {
/* Fill in the data */
for (I = 0; I < CollCount (&S->SpanInfoList); ++I) {
/* Copy the data */
- CopySpanInfo (D->data + I, CollConstAt (&S->SpanInfoList, I));
+ CopySpanInfo (D->data + I, CollAt (&S->SpanInfoList, I));
}
/* Return the result */
const cc65_sourceinfo* cc65_get_sourcelist (cc65_dbginfo Handle)
/* Return a list of all source files */
{
- DbgInfo* Info;
- Collection* FileInfoById;
+ const DbgInfo* Info;
cc65_sourceinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
-
- /* Get a pointer to the file list */
- FileInfoById = &Info->FileInfoById;
+ Info = Handle;
/* Allocate memory for the data structure returned to the caller. */
- D = new_cc65_sourceinfo (CollCount (FileInfoById));
+ D = new_cc65_sourceinfo (CollCount (&Info->FileInfoById));
/* Fill in the data */
- for (I = 0; I < CollCount (FileInfoById); ++I) {
+ for (I = 0; I < CollCount (&Info->FileInfoById); ++I) {
/* Copy the data */
- CopyFileInfo (D->data + I, CollConstAt (FileInfoById, I));
+ CopyFileInfo (D->data + I, CollAt (&Info->FileInfoById, I));
}
/* Return the result */
* source file information.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_sourceinfo* D;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (Id >= CollCount (&Info->FileInfoById)) {
D = new_cc65_sourceinfo (1);
/* Fill in the data */
- CopyFileInfo (D->data, CollConstAt (&Info->FileInfoById, Id));
+ CopyFileInfo (D->data, CollAt (&Info->FileInfoById, Id));
/* Return the result */
return D;
* otherwise a cc65_sourceinfo structure with one entry per source file.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
const ModInfo* M;
cc65_sourceinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the module id is valid */
if (Id >= CollCount (&Info->ModInfoById)) {
}
/* Get a pointer to the module info */
- M = CollConstAt (&Info->ModInfoById, Id);
+ M = CollAt (&Info->ModInfoById, Id);
/* Allocate memory for the data structure returned to the caller */
D = new_cc65_sourceinfo (CollCount (&M->FileInfoByName));
/* Fill in the data */
for (I = 0; I < CollCount (&M->FileInfoByName); ++I) {
- CopyFileInfo (D->data + I, CollConstAt (&M->FileInfoByName, I));
+ CopyFileInfo (D->data + I, CollAt (&M->FileInfoByName, I));
}
/* Return the result */
const cc65_segmentinfo* cc65_get_segmentlist (cc65_dbginfo Handle)
/* Return a list of all segments referenced in the debug information */
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_segmentinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Allocate memory for the data structure returned to the caller */
D = new_cc65_segmentinfo (CollCount (&Info->SegInfoById));
/* Fill in the data */
for (I = 0; I < CollCount (&Info->SegInfoById); ++I) {
/* Copy the data */
- CopySegInfo (D->data + I, CollConstAt (&Info->SegInfoById, I));
+ CopySegInfo (D->data + I, CollAt (&Info->SegInfoById, I));
}
/* Return the result */
* structure with one entry that contains the requested segment information.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_segmentinfo* D;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (Id >= CollCount (&Info->SegInfoById)) {
D = new_cc65_segmentinfo (1);
/* Fill in the data */
- CopySegInfo (D->data, CollConstAt (&Info->SegInfoById, Id));
+ CopySegInfo (D->data, CollAt (&Info->SegInfoById, Id));
/* Return the result */
return D;
* information.
*/
{
- DbgInfo* Info;
- SegInfo* S;
+ const DbgInfo* Info;
+ const SegInfo* S;
cc65_segmentinfo* D;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Search for the segment */
S = FindSegInfoByName (&Info->SegInfoByName, Name);
* with this id was found.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_symbolinfo* D;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (Id >= CollCount (&Info->SymInfoById)) {
D = new_cc65_symbolinfo (1);
/* Fill in the data */
- CopySymInfo (D->data, CollConstAt (&Info->SymInfoById, Id));
+ CopySymInfo (D->data, CollAt (&Info->SymInfoById, Id));
/* Return the result */
return D;
* no symbol with this name was found.
*/
{
- DbgInfo* Info;
- Collection* SymInfoByName;
+ const DbgInfo* Info;
cc65_symbolinfo* D;
unsigned I;
unsigned Index;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
-
- /* Get a pointer to the symbol list */
- SymInfoByName = &Info->SymInfoByName;
+ Info = Handle;
/* Search for the symbol */
- if (!FindSymInfoByName (SymInfoByName, Name, &Index)) {
+ if (!FindSymInfoByName (&Info->SymInfoByName, Name, &Index)) {
/* Not found */
return 0;
}
* we have. Skip the first one, since we have at least one.
*/
Count = 1;
- while ((unsigned) Index + Count < CollCount (SymInfoByName)) {
- const SymInfo* S = CollConstAt (SymInfoByName, (unsigned) Index + Count);
+ while ((unsigned) Index + Count < CollCount (&Info->SymInfoByName)) {
+ const SymInfo* S = CollAt (&Info->SymInfoByName, (unsigned) Index + Count);
if (strcmp (S->Name, Name) != 0) {
break;
}
/* Fill in the data */
for (I = 0; I < Count; ++I) {
/* Copy the data */
- CopySymInfo (D->data + I, CollConstAt (SymInfoByName, Index++));
+ CopySymInfo (D->data + I, CollAt (&Info->SymInfoByName, Index++));
}
/* Return the result */
* symbol list.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_symbolinfo* D;
- ScopeInfo* S;
+ const ScopeInfo* S;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (ScopeId >= CollCount (&Info->ScopeInfoById)) {
/* Fill in the data */
for (I = 0; I < CollCount (&S->SymInfoByName); ++I) {
/* Copy the data */
- CopySymInfo (D->data + I, CollConstAt (&S->SymInfoByName, I));
+ CopySymInfo (D->data + I, CollAt (&S->SymInfoByName, I));
}
/* Return the result */
* symbols are ignored and not returned.
*/
{
- DbgInfo* Info;
- Collection* SymInfoByVal;
+ const DbgInfo* Info;
Collection SymInfoList = COLLECTION_INITIALIZER;
cc65_symbolinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
-
- /* Get a pointer to the symbol list */
- SymInfoByVal = &Info->SymInfoByVal;
+ Info = Handle;
/* Search for the symbol. Because we're searching for a range, we cannot
* make use of the function result.
*/
- FindSymInfoByValue (SymInfoByVal, Start, &Index);
+ FindSymInfoByValue (&Info->SymInfoByVal, Start, &Index);
/* Start from the given index, check all symbols until the end address is
* reached. Place all symbols into SymInfoList for later.
*/
- for (I = Index; I < CollCount (SymInfoByVal); ++I) {
+ for (I = Index; I < CollCount (&Info->SymInfoByVal); ++I) {
/* Get the item */
- SymInfo* Item = CollAt (SymInfoByVal, I);
+ SymInfo* Item = CollAt (&Info->SymInfoByVal, I);
/* The collection is sorted by address, so if we get a value larger
* than the end address, we're done.
/* Fill in the data */
for (I = 0; I < CollCount (&SymInfoList); ++I) {
/* Copy the data */
- CopySymInfo (D->data + I, CollConstAt (&SymInfoList, I));
+ CopySymInfo (D->data + I, CollAt (&SymInfoList, I));
}
/* Free the collection */
const cc65_scopeinfo* cc65_get_scopelist (cc65_dbginfo Handle)
/* Return a list of all scopes in the debug information */
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_scopeinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Allocate memory for the data structure returned to the caller */
D = new_cc65_scopeinfo (CollCount (&Info->ScopeInfoById));
/* Fill in the data */
for (I = 0; I < CollCount (&Info->ScopeInfoById); ++I) {
/* Copy the data */
- CopyScopeInfo (D->data + I, CollConstAt (&Info->ScopeInfoById, I));
+ CopyScopeInfo (D->data + I, CollAt (&Info->ScopeInfoById, I));
}
/* Return the result */
* with this id was found.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_scopeinfo* D;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (Id >= CollCount (&Info->ScopeInfoById)) {
D = new_cc65_scopeinfo (1);
/* Fill in the data */
- CopyScopeInfo (D->data, CollConstAt (&Info->ScopeInfoById, Id));
+ CopyScopeInfo (D->data, CollAt (&Info->ScopeInfoById, Id));
/* Return the result */
return D;
* scope with the given id was found.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
const ModInfo* M;
cc65_scopeinfo* D;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the module id is valid */
if (ModId >= CollCount (&Info->ModInfoById)) {
}
/* Get a pointer to the module info */
- M = CollConstAt (&Info->ModInfoById, ModId);
+ M = CollAt (&Info->ModInfoById, ModId);
/* Allocate memory for the data structure returned to the caller */
D = new_cc65_scopeinfo (CollCount (&M->ScopeInfoByName));
/* Fill in the data */
for (I = 0; I < CollCount (&M->ScopeInfoByName); ++I) {
- CopyScopeInfo (D->data + I, CollConstAt (&M->ScopeInfoByName, I));
+ CopyScopeInfo (D->data + I, CollAt (&M->ScopeInfoByName, I));
}
/* Return the result */
* the given name was found, otherwise a non empty scope list.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
unsigned Index;
- ScopeInfo* S;
+ const ScopeInfo* S;
cc65_scopeinfo* D;
unsigned Count;
unsigned I;
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Search for the first item with the given name */
if (!FindScopeInfoByName (&Info->ScopeInfoByName, Name, &Index)) {
/* Fill in the data */
for (I = 0; I < Count; ++I, ++Index) {
- CopyScopeInfo (D->data + I, CollConstAt (&Info->ScopeInfoByName, Index));
+ CopyScopeInfo (D->data + I, CollAt (&Info->ScopeInfoByName, Index));
}
/* Return the result */
* direct childs.
*/
{
- DbgInfo* Info;
+ const DbgInfo* Info;
cc65_scopeinfo* D;
- ScopeInfo* S;
+ const ScopeInfo* S;
unsigned I;
/* Check the parameter */
assert (Handle != 0);
/* The handle is actually a pointer to a debug info struct */
- Info = (DbgInfo*) Handle;
+ Info = Handle;
/* Check if the id is valid */
if (Id >= CollCount (&Info->ScopeInfoById)) {
/* Fill in the data */
for (I = 0; I < D->count; ++I) {
- CopyScopeInfo (D->data + I, CollConstAt (S->ChildScopeList, I));
+ CopyScopeInfo (D->data + I, CollAt (S->ChildScopeList, I));
}
/* Return the result */