Maintain the types as separate indexed items in the debug info file.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5263 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-08-22 18:22:45 +00:00
parent b064002266
commit 374b106b06
7 changed files with 89 additions and 25 deletions

View File

@@ -33,6 +33,9 @@
/* common */
#include "gentype.h"
/* ld65 */
#include "tpool.h"
@@ -55,16 +58,35 @@ StringPool* TypePool = 0;
void PrintDbgTypes (FILE* F)
/* Output the types to a debug info file */
{
StrBuf Type = STATIC_STRBUF_INITIALIZER;
/* Get the number of strings in the type pool */
unsigned Count = SP_GetCount (TypePool);
/* Output all of them */
unsigned Id;
for (Id = 0; Id < Count; ++Id) {
/* Output it */
fprintf (F, "type\tid=%u,val=\"%s\"\n", Id,
GT_AsString (SP_Get (TypePool, Id), &Type));
}
/* Free the memory for the temporary string */
SB_Done (&Type);
}
void InitTypePool (void)
/* Initialize the type pool */
{
/* Allocate a type pool */
TypePool = NewStringPool (137);
/* We insert the empty string as first entry here, so it will have id
* zero.
*/
SP_AddStr (TypePool, "");
}