1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-25 13:29:41 +00:00

Added the LineInfo count to the info line of the debug info file. This allows

the debug info module to reduce memory usage.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5265 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2011-08-22 21:52:40 +00:00
parent 3b61ee2f5a
commit 1e0ab407cd
3 changed files with 37 additions and 13 deletions

View File

@ -47,7 +47,7 @@
#include "lineinfo.h"
#include "scopes.h"
#include "segments.h"
#include "span.h"
#include "span.h"
#include "tpool.h"
@ -115,9 +115,10 @@ void CreateDbgFile (void)
*/
fprintf (
F,
"info\tfile=%u,lib=%u,mod=%u,scope=%u,seg=%u,span=%u,type=%u\n",
"info\tfile=%u,lib=%u,line=%u,mod=%u,scope=%u,seg=%u,span=%u,type=%u\n",
FileInfoCount (),
LibraryCount (),
LineInfoCount (),
ObjDataCount (),
ScopeCount (),
SegmentCount (),
@ -128,32 +129,32 @@ void CreateDbgFile (void)
/* Assign the ids to the items */
AssignIds ();
/* Output files */
PrintDbgFileInfo (F);
/* Output libraries */
PrintDbgLibraries (F);
/* Output line info */
PrintDbgLineInfo (F);
/* Output modules */
PrintDbgModules (F);
/* Output the segment info */
PrintDbgSegments (F);
/* Output files */
PrintDbgFileInfo (F);
/* Output line info */
PrintDbgLineInfo (F);
/* Output spans */
PrintDbgSpans (F);
/* Output types */
PrintDbgTypes (F);
/* Output scopes */
PrintDbgScopes (F);
/* Output symbols */
PrintDbgSyms (F);
/* Output scopes */
PrintDbgScopes (F);
/* Output types */
PrintDbgTypes (F);
/* Close the file */
if (fclose (F) != 0) {

View File

@ -177,6 +177,26 @@ const LineInfo* GetAsmLineInfo (const Collection* LineInfos)
unsigned LineInfoCount (void)
/* Return the total number of line infos */
{
/* Walk over all object files */
unsigned I;
unsigned Count = 0;
for (I = 0; I < CollCount (&ObjDataList); ++I) {
/* Get this object file */
const ObjData* O = CollAtUnchecked (&ObjDataList, I);
/* Count spans */
Count += CollCount (&O->LineInfos);
}
return Count;
}
void AssignLineInfoIds (void)
/* Assign the ids to the line infos */
{

View File

@ -171,6 +171,9 @@ INLINE unsigned GetSourceLineFromList (const Collection* LineInfos)
GetSourceLine ((const LineInfo*) CollConstAt ((LineInfos), 0))
#endif
unsigned LineInfoCount (void);
/* Return the total number of line infos */
void AssignLineInfoIds (void);
/* Assign the ids to the line infos */