[Exspiminator-commits] CVS: exspiminator/gui GUI.java,1.22,1.23
Status: Alpha
Brought to you by:
nphillips
|
From: Nigel P. <nph...@us...> - 2001-11-20 11:59:02
|
Update of /cvsroot/exspiminator/exspiminator/gui
In directory usw-pr-cvs1:/tmp/cvs-serv31158/gui
Modified Files:
GUI.java
Log Message:
Tidy up and produce user notification on IO error.
Index: GUI.java
===================================================================
RCS file: /cvsroot/exspiminator/exspiminator/gui/GUI.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** GUI.java 2001/11/19 16:17:49 1.22
--- GUI.java 2001/11/20 11:58:59 1.23
***************
*** 400,441 ****
in.read(source, 0, (int) fileLength);
! /** BUG: temporarily use preprocessor to produce label table, until we get
! back patching working.*/
! //Preprocessor pp=new Preprocessor(
! // SimplifiedPowerPCInstructionSet.getInstructionSet());
! //String data=pp.preprocess(new String(source));
! //if (data==null)
! //{
! // JOptionPane.showMessageDialog(frame,
! // pp.getErrorMessage(),
! // "Preprocessing failed",
! // JOptionPane.ERROR_MESSAGE);
! //}
! //else
! //{
! //Assembler asm=new Assembler(
! NewAssembler asm=new NewAssembler(
! SimplifiedPowerPCInstructionSet.getInstructionSet());
! //asm.setLabelTable(pp.getLabelTable());
//System.err.println(pp.getLabelTable().toString());
! try
{
- byte[] code=asm.assemble(new String(source));
- //(new String(data), pp.getLabelTable());
- MemoryModel m=new MemoryModel(code);
- setModels(new PowerPC(m), m);
- }
- catch (AssemblerException aEx)
- {
JOptionPane.showMessageDialog(frame,
! aEx.getMessage(),
! "Assembling failed",
! JOptionPane.ERROR_MESSAGE);
}
! //}
}
catch (IOException ex)
{
! //BUG: nice error handling! :-)
}
finally
--- 400,433 ----
in.read(source, 0, (int) fileLength);
! NewAssembler asm=new NewAssembler(
! SimplifiedPowerPCInstructionSet.getInstructionSet());
//System.err.println(pp.getLabelTable().toString());
! try
! {
! byte[] code=asm.assemble(new String(source));
! //(new String(data), pp.getLabelTable());
! if (asm.hasWarnings())
{
JOptionPane.showMessageDialog(frame,
! asm.getWarnings(),
! "Warning",
! JOptionPane.WARNING_MESSAGE);
}
!
! MemoryModel m=new MemoryModel(code);
! setModels(new PowerPC(m), m);
! }
! catch (AssemblerException aEx)
! {
! JOptionPane.showMessageDialog(frame,
! aEx.getMessage(),
! "Assembling failed",
! JOptionPane.ERROR_MESSAGE);
! }
}
catch (IOException ex)
{
! JOptionPane.showMessageDialog(frame, "An error occured:" + ex.getMessage(),
! "IO Error", JOptionPane.ERROR_MESSAGE);
}
finally
|