Apologies for forgetting to attach the patch itself...
--------------------------------------------
On Sun, 21/9/14, Hin-Tak Leung <[email protected]> wrote:
Subject: [PATCH] More conversions of off_t to lldb::offset_t for llvm 3.4.x
To: [email protected], "Greg Clayton" <[email protected]>
Date: Sunday, 21 September, 2014, 19:36
This is the version for llvm 3.4.x .
See previous e-mail on further
background.
Hin-Tak
---
This is the set of changes I need to make to build 32-bit
llvm on
fedora 20 x86_64 (to get 32-bit mesa llvmpipe Gallium drm
driver), against
llvm 3.4.2.
Similar problems were apparently seen with Ubuntu 11.04
32bit and
Ubuntu 12.04 32-bit in the thread leading up to this post:
http://lists.cs.uiuc.edu/pipermail/lldb-dev/2013-February/001470.html
and was worked around, but didn't get addressed.
Part of the changes I need is already part of:
commit 6201a1a109e4c43ece8dbcc81571f1d095bca6d3
Author: Zachary Turner <[email protected]>
Date: Wed Jul 2 17:24:07 2014 +0000
Start converting usages of off_t to other
types.
So I am preparing two patches, one for trunk and one for
3.4.x.
This is the full version I used for 3.4.x, which does not
contain
6201a1a109e4c43ece8dbcc81571f1d095bca6d3 .
From 6fca7062e8f1743d0a118a476378898bbe78cd62 Mon Sep 17 00:00:00 2001
From: Hin-Tak Leung <[email protected]>
Date: Sun, 21 Sep 2014 18:06:40 +0100
Subject: [PATCH] More conversions of off_t to lldb::offset_t for llvm 3.4.x
This is the set of changes I need to make to build 32-bit llvm on
fedora 20 x86_64 (to get 32-bit mesa llvmpipe Gallium drm driver), against
llvm 3.4.2.
Similar problems were apparently seen with Ubuntu 11.04 32bit and
Ubuntu 12.04 32-bit in the thread leading up to this post:
http://lists.cs.uiuc.edu/pipermail/lldb-dev/2013-February/001470.html
and was worked around, but didn't get addressed.
Part of the changes I need is already part of:
commit 6201a1a109e4c43ece8dbcc81571f1d095bca6d3
Author: Zachary Turner <[email protected]>
Date: Wed Jul 2 17:24:07 2014 +0000
Start converting usages of off_t to other types.
So I am preparing two patches, one for trunk and one for 3.4.x.
This is the full version I used for 3.4.x, which does not contain
6201a1a109e4c43ece8dbcc81571f1d095bca6d3 .
Signed-off-by: Hin-Tak Leung <[email protected]>
Cc: Greg Clayton <[email protected]>
---
include/lldb/Core/Module.h | 2 +-
include/lldb/Host/File.h | 8 ++++----
include/lldb/Host/FileSpec.h | 4 ++--
include/lldb/Symbol/ObjectFile.h | 2 +-
source/Core/Module.cpp | 2 +-
source/Host/common/File.cpp | 8 ++++----
source/Host/common/FileSpec.cpp | 8 ++++----
source/Symbol/ObjectFile.cpp | 2 +-
8 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/include/lldb/Core/Module.h b/include/lldb/Core/Module.h
index 1473fb9..3371389 100644
--- a/include/lldb/Core/Module.h
+++ b/include/lldb/Core/Module.h
@@ -88,7 +88,7 @@ public:
Module (const FileSpec& file_spec,
const ArchSpec& arch,
const ConstString *object_name = NULL,
- off_t object_offset = 0,
+ lldb::offset_t object_offset = 0,
const TimeValue *object_mod_time_ptr = NULL);
Module (const ModuleSpec &module_spec);
diff --git a/include/lldb/Host/File.h b/include/lldb/Host/File.h
index 7ca5824..d3d7c53 100644
--- a/include/lldb/Host/File.h
+++ b/include/lldb/Host/File.h
@@ -319,8 +319,8 @@ public:
/// @return
/// The resulting seek offset, or -1 on error.
//------------------------------------------------------------------
- off_t
- SeekFromStart (off_t offset, Error *error_ptr = NULL);
+ lldb::offset_t
+ SeekFromStart (lldb::offset_t offset, Error *error_ptr = NULL);
//------------------------------------------------------------------
/// Seek to an offset relative to the current file position.
@@ -393,7 +393,7 @@ public:
/// failure.
//------------------------------------------------------------------
Error
- Read (void *dst, size_t &num_bytes, off_t &offset);
+ Read (void *dst, size_t &num_bytes, lldb::offset_t &offset);
//------------------------------------------------------------------
/// Read bytes from a file from the specified file offset.
@@ -426,7 +426,7 @@ public:
//------------------------------------------------------------------
Error
Read (size_t &num_bytes,
- off_t &offset,
+ lldb::offset_t &offset,
bool null_terminate,
lldb::DataBufferSP &data_buffer_sp);
diff --git a/include/lldb/Host/FileSpec.h b/include/lldb/Host/FileSpec.h
index dfc6b71..a1df729 100644
--- a/include/lldb/Host/FileSpec.h
+++ b/include/lldb/Host/FileSpec.h
@@ -524,10 +524,10 @@ public:
/// pointer must be checked prior to using it.
//------------------------------------------------------------------
lldb::DataBufferSP
- ReadFileContents (off_t offset = 0, size_t length = SIZE_MAX, Error *error_ptr = NULL) const;
+ ReadFileContents (lldb::offset_t offset = 0, size_t length = SIZE_MAX, Error *error_ptr = NULL) const;
size_t
- ReadFileContents (off_t file_offset, void *dst, size_t dst_len, Error *error_ptr) const;
+ ReadFileContents (lldb::offset_t file_offset, void *dst, size_t dst_len, Error *error_ptr) const;
//------------------------------------------------------------------
diff --git a/include/lldb/Symbol/ObjectFile.h b/include/lldb/Symbol/ObjectFile.h
index ad500f5..afe8a9a 100644
--- a/include/lldb/Symbol/ObjectFile.h
+++ b/include/lldb/Symbol/ObjectFile.h
@@ -743,7 +743,7 @@ public:
size_t
ReadSectionData (const Section *section,
- off_t section_offset,
+ lldb::offset_t section_offset,
void *dst,
size_t dst_len) const;
size_t
diff --git a/source/Core/Module.cpp b/source/Core/Module.cpp
index 3f3be93..bcfdcb3 100644
--- a/source/Core/Module.cpp
+++ b/source/Core/Module.cpp
@@ -171,7 +171,7 @@ Module::Module (const ModuleSpec &module_spec) :
Module::Module(const FileSpec& file_spec,
const ArchSpec& arch,
const ConstString *object_name,
- off_t object_offset,
+ lldb::offset_t object_offset,
const TimeValue *object_mod_time_ptr) :
m_mutex (Mutex::eMutexTypeRecursive),
m_mod_time (file_spec.GetModificationTime()),
diff --git a/source/Host/common/File.cpp b/source/Host/common/File.cpp
index addd435..42f7bad 100644
--- a/source/Host/common/File.cpp
+++ b/source/Host/common/File.cpp
@@ -391,8 +391,8 @@ File::GetFileSpec (FileSpec &file_spec) const
return error;
}
-off_t
-File::SeekFromStart (off_t offset, Error *error_ptr)
+lldb::offset_t
+File::SeekFromStart (lldb::offset_t offset, Error *error_ptr)
{
off_t result = 0;
if (DescriptorIsValid())
@@ -636,7 +636,7 @@ File::Write (const void *buf, size_t &num_bytes)
Error
-File::Read (void *buf, size_t &num_bytes, off_t &offset)
+File::Read (void *buf, size_t &num_bytes, lldb::offset_t &offset)
{
#ifndef _WIN32
Error error;
@@ -677,7 +677,7 @@ File::Read (void *buf, size_t &num_bytes, off_t &offset)
}
Error
-File::Read (size_t &num_bytes, off_t &offset, bool null_terminate, DataBufferSP &data_buffer_sp)
+File::Read (size_t &num_bytes, lldb::offset_t &offset, bool null_terminate, DataBufferSP &data_buffer_sp)
{
Error error;
diff --git a/source/Host/common/FileSpec.cpp b/source/Host/common/FileSpec.cpp
index 33de198..4e39ecc 100644
--- a/source/Host/common/FileSpec.cpp
+++ b/source/Host/common/FileSpec.cpp
@@ -805,7 +805,7 @@ FileSpec::MemorySize() const
size_t
-FileSpec::ReadFileContents (off_t file_offset, void *dst, size_t dst_len, Error *error_ptr) const
+FileSpec::ReadFileContents (lldb::offset_t file_offset, void *dst, size_t dst_len, Error *error_ptr) const
{
Error error;
size_t bytes_read = 0;
@@ -816,7 +816,7 @@ FileSpec::ReadFileContents (off_t file_offset, void *dst, size_t dst_len, Error
error = file.Open(resolved_path, File::eOpenOptionRead);
if (error.Success())
{
- off_t file_offset_after_seek = file_offset;
+ lldb::offset_t file_offset_after_seek = file_offset;
bytes_read = dst_len;
error = file.Read(dst, bytes_read, file_offset_after_seek);
}
@@ -842,7 +842,7 @@ FileSpec::ReadFileContents (off_t file_offset, void *dst, size_t dst_len, Error
// verified using the DataBuffer::GetByteSize() function.
//------------------------------------------------------------------
DataBufferSP
-FileSpec::ReadFileContents (off_t file_offset, size_t file_size, Error *error_ptr) const
+FileSpec::ReadFileContents (lldb::offset_t file_offset, size_t file_size, Error *error_ptr) const
{
Error error;
DataBufferSP data_sp;
@@ -878,7 +878,7 @@ FileSpec::ReadFileContentsAsCString(Error *error_ptr)
error = file.Open(resolved_path, File::eOpenOptionRead);
if (error.Success())
{
- off_t offset = 0;
+ lldb::offset_t offset = 0;
size_t length = SIZE_MAX;
const bool null_terminate = true;
error = file.Read (length, offset, null_terminate, data_sp);
diff --git a/source/Symbol/ObjectFile.cpp b/source/Symbol/ObjectFile.cpp
index ec69c9d..bc7b641 100644
--- a/source/Symbol/ObjectFile.cpp
+++ b/source/Symbol/ObjectFile.cpp
@@ -466,7 +466,7 @@ ObjectFile::CopyData (off_t offset, size_t length, void *dst) const
size_t
-ObjectFile::ReadSectionData (const Section *section, off_t section_offset, void *dst, size_t dst_len) const
+ObjectFile::ReadSectionData (const Section *section, lldb::offset_t section_offset, void *dst, size_t dst_len) const
{
// If some other objectfile owns this data, pass this to them.
if (section->GetObjectFile() != this)
--
1.9.3
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits