Re: [cc65] Re: readdir bug

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2012-09-14 20:43:43
Hello Uz,

* On Fri, Sep 14, 2012 at 06:10:16PM +0200 Ullrich von Bassewitz wrote:
> 
> On Fri, Sep 14, 2012 at 04:39:59PM +0200, Spiro Trikaliotis wrote:
 
> This would mean it's an error in the floppy.

Exactly.

>                                              But why then does the Atari
> behave in an identical manner? Or are these two problems unrelated?

I expect them to be unrelated, indeed. In fact, I do not know anything
about the Atari, I do not even have an emulator for it.

> > Perhaps, we should convince the VICE developers to add a "debugging
> > chip" which only outputs data to the host. That is, something like
> [...]
> 
> That might help a bit.

I like debugging with printf(), so this would help me.

> Fixing the label stuff would also be helpful.

Indeed. Groepaz, do you know what is going on?

> And then
> there's still the debug info generated by the linker. There are emulators that
> are able to debug on source code level, just as a reminder :-(

Well, don't remind me. I already left the VICE team. That's why I am
asking groepaz, as he is the only one of the active VICE member of whom
I know that he is on this ML here.

 
> > Did you change the format of the label files?
> 
> No. The files are actually read without errors. But VICE won't find the labels
> afterwards. At least most of them.

That's indeed weird. But not very surprising, it seems backwards
compatibility is less of an issue nowadays than it was before.

> > Now, what about a fix? I am not sure how to proceed. The directory would
> > have to be read in one chunk (or, by using the offset and seekdir()? But
> > that would slow down the process of reading the dir extremely.)
> 
> Reading the whole directory in one step uses quite some memory. Unfortunately
> the only other idea I have is to document this bug and let the programmer
> handle it.

Just thinking out loud:
If there is a call to open(), close(), and the like, a flag is it.

Now, when readdir() is called, check if the flag is set. If it is not,
do as readdir() is implemented currently. If it is set, however, perform
a seekdir() to the current offset.

Does this make sense? Of course, all the "interesting" functions would
have to be sorted out. Additionally, there is still the risk that
someone uses kernal routines directly, thus, the flag may be wrong.
Thus, the "flag setting" function should be exported, too.

Would this be an option?

Regards,
Spiro.

-- 
Spiro R. Trikaliotis
http://www.trikaliotis.net/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Sep 14 20:44:05 2012

This archive was generated by hypermail 2.1.8 : 2012-09-14 20:44:08 CEST