Increased the file count to 16 bits when written to the object file.
Moved the input file table to a separate module and added an AddFile() function to add files to this table. Removed the 8 bit limit for the file number in several places (the file number is still 8 bits in the file position structure). Added a pseudo instruction .dbg that will be used to add debug info from high level code to the assembler source. Added a subkey "file" to the .dbg command that allows to add a file to the file table that is later written to the object file. git-svn-id: svn://svn.cc65.org/cc65/trunk@258 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
|
||||
/* ca65 */
|
||||
#include "condasm.h"
|
||||
#include "dbginfo.h"
|
||||
#include "error.h"
|
||||
#include "expr.h"
|
||||
#include "global.h"
|
||||
@@ -347,6 +348,42 @@ static void DoData (void)
|
||||
|
||||
|
||||
|
||||
static void DoDbg (void)
|
||||
/* Add debug information from high level code */
|
||||
{
|
||||
static const char* Keys[] = {
|
||||
"FILE",
|
||||
"LINE",
|
||||
"SYM",
|
||||
};
|
||||
int Key;
|
||||
|
||||
|
||||
/* We expect a subkey */
|
||||
if (Tok != TOK_IDENT) {
|
||||
ErrorSkip (ERR_IDENT_EXPECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Map the following keyword to a number */
|
||||
Key = GetSubKey (Keys, sizeof (Keys) / sizeof (Keys [0]));
|
||||
|
||||
/* Skip the subkey */
|
||||
NextTok ();
|
||||
|
||||
/* Parameters are separated by a comma */
|
||||
ConsumeComma ();
|
||||
|
||||
/* Check the key and dispatch to a handler */
|
||||
switch (Key) {
|
||||
case 0: DbgInfoFile (); break;
|
||||
case 1:
|
||||
default: ErrorSkip (ERR_SYNTAX); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void DoDByt (void)
|
||||
/* Output double bytes */
|
||||
{
|
||||
@@ -1113,6 +1150,7 @@ static CtrlDesc CtrlCmdTab [] = {
|
||||
{ ccNone, DoUnexpected }, /* .CONST */
|
||||
{ ccNone, DoUnexpected }, /* .CPU */
|
||||
{ ccNone, DoData },
|
||||
{ ccNone, DoDbg, },
|
||||
{ ccNone, DoDByt },
|
||||
{ ccNone, DoDebugInfo },
|
||||
{ ccNone, DoDefine },
|
||||
|
||||
Reference in New Issue
Block a user