{
int tag = (int) in.readUI32();
switch (tag)
{
case kDebugScript:
DebugModule m = new DebugModule();
int id = (int) in.readUI32();
m.id = id;
m.bitmap = (int) in.readUI32();
m.name = in.readString();
m.setText(in.readString());
adjustModuleName(m);
if (modules.contains(id))
{
DebugModule m2 = (DebugModule) modules.get(id);
if (!m.equals(m2))
{
handler.error("Module '" + m2.name + "' has the same ID as Module '" + m.name + "'");
handler.error("Let's check for kDebugOffset that came before Module '" + m2.name + "'");
handler.error("Before: Number of accumulated line records: " + lineRecords.size());
lineRecords = purgeLineRecords(lineRecords, id, handler);
handler.error("After: Number of accumulated line records: " + lineRecords.size());
}
}
modules.put(id, m);
handler.module(m);
break;
case kDebugOffset:
id = (int) in.readUI32();
int lineno = (int) in.readUI32();
DebugModule module = (DebugModule) modules.get(id);
LineRecord lr = new LineRecord(lineno, module);
int offset = (int) in.readUI32();
if (module != null)
{
// not corrupted before we add the offset and offset add fails
boolean wasCorrupt = module.corrupt;
if (!module.addOffset(lr, offset) && !wasCorrupt)
handler.error(module.name+":"+lineno+" does not exist for offset "+offset+", module marked for exclusion from debugging");
handler.offset(offset, lr);
}
else
{