This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Flash support part 2: flash programming


On Tuesday 01 August 2006 17:12, Daniel Jacobowitz wrote:
> On Tue, Aug 01, 2006 at 09:23:23AM +0400, Vladimir Prus wrote:
> > No, this is intentional change. The target_write_memory_blocks uses it,
> > and it was made explicitly so that we can produce progress report while
> > loading data. It's currently used by MI frontend, and if
> > target_write_memory_blocks is coded to call progress reporting routine
> > only at the end of a section, it will make progress reporting much less
> > usefull.
>
> Vlad, I'm a little scared by how many versions of this patch are
> floating around :-) I have a copy from the internal list on 2006-07-12 
> which uses target_write_memory instead.  

Yep, that one does not have *any* progress reporting, I believe.

> And there's also the 
> xfer_partial_using_stratum change we discussed, in order to keep using
> target_write_memory_partial.
>
> But the last suggestion I can find in the discussion was:
> > But that suggests there's a simpler way to do it.  We could break out
> > target_write into another function, target_write_with_progress, that
> > takes a progress callback.  Have target_write call that without a
> > callback.  Then you could use the new interface to write out large
> > chunks of data, without having to perform the partial transfers
> > yourself, or having to do the bookkeeping for the progress bar.
> > Maybe that would be easier.
>
> I think that may be the way to go; I don't really want to re-export
> target_write_partial if we can avoid it.  I realize you're not going to
> have time to revise these for a while, so I may take care of this,
> once we're finished with expat.

I think I've missed that email. Yes, for a flash code having 
target_write_with_progress is more convenient. The trick is, and still was, 
to propagate callbacks all the way along the all codepaths, including writing 
memory via xfer_using_stratum and writing target objects via to_xfer_partial.

For the case at hand, flash code knows it will only be writing to target 
object, so it can directly call target_write_partial. That's why I took this 
route. 

- Volodya



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]