/* */
/* */
/* */
-/* (C) 1998-2003 Ullrich von Bassewitz */
-/* Römerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
+/* (C) 1998-2010, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
#include <string.h>
/* common */
+#include "addrsize.h"
#include "check.h"
#include "symdefs.h"
#include "xmalloc.h"
D->Flags = 0;
D->Obj = O;
D->Expr = 0;
- D->Name = 0;
+ D->Name = 0;
D->Type = Type;
D->AddrSize = AddrSize;
{
/* Create the hash. We hash over the symbol value */
unsigned Hash = ((Val >> 24) & 0xFF) ^
- ((Val >> 16) & 0xFF) ^
- ((Val >> 8) & 0xFF) ^
- ((Val >> 0) & 0xFF);
+ ((Val >> 16) & 0xFF) ^
+ ((Val >> 8) & 0xFF) ^
+ ((Val >> 0) & 0xFF);
/* Check for this symbol */
DbgSym* Sym = DbgSymPool[Hash];
-static void ClearDbgSymTable (void)
+void ClearDbgSymTable (void)
/* Clear the debug symbol table */
{
unsigned I;
-long GetDbgSymVal (DbgSym* D)
+long GetDbgSymVal (const DbgSym* D)
/* Get the value of this symbol */
{
CHECK (D->Expr != 0);
{
unsigned I;
- /* Clear the debug sym table */
- ClearDbgSymTable ();
-
/* Walk through all debug symbols in this module */
- for (I = 0; I < O->DbgSymCount; ++I) {
+ for (I = 0; I < CollCount (&O->DbgSyms); ++I) {
long Val;
/* Get the next debug symbol */
- DbgSym* D = O->DbgSyms [I];
+ DbgSym* D = CollAt (&O->DbgSyms, I);
/* Get the symbol value */
Val = GetDbgSymVal (D);
/* Emit the debug file line */
fprintf (F,
- "sym\t\"%s\", %08lX, %s\n",
+ "sym\t\"%s\",value=0x%08lX,addrsize=%s,type=%s\n",
GetString (D->Name),
Val,
+ AddrSizeToStr (D->AddrSize),
IS_EXP_LABEL (D->Type)? "label" : "equate");
/* Insert the symbol into the table */
{
unsigned I;
- /* Clear the debug sym table */
- ClearDbgSymTable ();
-
/* Walk through all debug symbols in this module */
- for (I = 0; I < O->DbgSymCount; ++I) {
+ for (I = 0; I < CollCount (&O->DbgSyms); ++I) {
long Val;
/* Get the next debug symbol */
- DbgSym* D = O->DbgSyms [I];
+ DbgSym* D = CollAt (&O->DbgSyms, I);
/* Emit this symbol only if it is a label (ignore equates) */
if (IS_EXP_EQUATE (D->Type)) {
-
+