#135 Source browser confused by missing files

None
closed-fixed
nobody
None
5
2014-10-26
2012-01-06
No

If one of the source files referenced by the COD file cannot be found (e.g. it's been deleted) then the source browser gets confused and shows the current PC in the wrong file. (I found this because my build system auto-generates one of the headers and I tried to run GPSim after a partial clean).

I've done a bit of digging and found that the PicCodProgramFileType::read_src_files_from_cod method in cod.cc calls cpu->files.Add(filenm) for the missing file, but that FileContextList::Add in processor.cc gives up immediately if the file cannot be opened. However, Processor::read_src_files allocates a mapping of instructions to source locations to the FileContext returned by files[program_memory[addr]->get_file_id()] -- which explicitly assumes that the array built up matches the indices in the COD.

The fix will require missing files not to be ignored, but instead to be entered into the files array as a placeholder of some sort. NULL is not sufficient. It needs to be an instance of (a sub-class of) FileContext that returns zero from max_lines().

Discussion

  • Martin Habets

    Martin Habets - 2014-09-07

    Attached is a patch for this issue.

     
  • Roy Rankin

    Roy Rankin - 2014-10-26

    Martin's patch applied in svn 2273

     
  • Roy Rankin

    Roy Rankin - 2014-10-26
    • status: open --> closed-fixed
    • Group: -->
     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks