aboutsummaryrefslogtreecommitdiff
path: root/gold/object.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-09-25 17:50:26 +0000
committerIan Lance Taylor <iant@google.com>2007-09-25 17:50:26 +0000
commit9eb9fa57c2a9eec4c08491715d3341df811b7f9c (patch)
treec68eac98b999ebfb3251ab5f9851900bf8e4179b /gold/object.h
parent0b058123a01a282fe112ee8863bfbf0abf89f29b (diff)
downloadgdb-9eb9fa57c2a9eec4c08491715d3341df811b7f9c.zip
gdb-9eb9fa57c2a9eec4c08491715d3341df811b7f9c.tar.gz
gdb-9eb9fa57c2a9eec4c08491715d3341df811b7f9c.tar.bz2
Add cache parameter to get_view. Discard uncached views on unlock.
Fix bug this exposed in archive armap symbol name handling.
Diffstat (limited to 'gold/object.h')
-rw-r--r--gold/object.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/gold/object.h b/gold/object.h
index 55935c1..cc1d5b2 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -168,9 +168,9 @@ class Object
{ return this->shnum_; }
// Return a view of the contents of a section. Set *PLEN to the
- // size.
+ // size. CACHE is a hint as in File_read::get_view.
const unsigned char*
- section_contents(unsigned int shndx, off_t* plen);
+ section_contents(unsigned int shndx, off_t* plen, bool cache);
// Return the name of a section given a section index. This is only
// used for error messages.
@@ -224,7 +224,7 @@ class Object
// Return a View.
View
view(off_t file_offset, off_t data_size)
- { return View(this->get_view(file_offset, data_size)); }
+ { return View(this->get_view(file_offset, data_size, true)); }
// Report an error.
void
@@ -243,7 +243,7 @@ class Object
// Get a View given a Location.
View view(Location loc)
- { return View(this->get_view(loc.file_offset, loc.data_size)); }
+ { return View(this->get_view(loc.file_offset, loc.data_size, true)); }
protected:
// Read the symbols--implemented by child class.
@@ -284,15 +284,18 @@ class Object
// Get a view into the underlying file.
const unsigned char*
- get_view(off_t start, off_t size)
- { return this->input_file_->file().get_view(start + this->offset_, size); }
+ get_view(off_t start, off_t size, bool cache)
+ {
+ return this->input_file_->file().get_view(start + this->offset_, size,
+ cache);
+ }
// Get a lasting view into the underlying file.
File_view*
- get_lasting_view(off_t start, off_t size)
+ get_lasting_view(off_t start, off_t size, bool cache)
{
return this->input_file_->file().get_lasting_view(start + this->offset_,
- size);
+ size, cache);
}
// Read data from the underlying file.