aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/elfreader.h
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2014-09-07 23:24:10 +0300
committerOrgad Shaneh <orgads@gmail.com>2014-09-18 13:37:04 +0200
commitf0e2708d3e516a2999818dfc85d0d4809b21171e (patch)
tree7200eab8b0b0e35b219a9da7388de4bb49f7d26d /src/libs/utils/elfreader.h
parent63da3cb9e0545fe2ecf143ac32097141e3d4c8af (diff)
Debugger: Support setting substitute path by regexp
This is useful when there are multiple build machines with different path, and the user would like to match anything up to some known directory to his local project (variable support will also be useful - will try to add that later). Syntax: (/home/.*)/KnownSubdir -> /home/my/project Capture group will be replaced by the value. In this example the substitute path will be (in case a source string found such as /home/SomeUser/SomeProject/KnownSubdir/foo.cpp): /home/SomeUser/SomeProject -> /home/my/project Change-Id: I19d03c9388161d8456a86676086dcb06dc3d7370 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/libs/utils/elfreader.h')
-rw-r--r--src/libs/utils/elfreader.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/libs/utils/elfreader.h b/src/libs/utils/elfreader.h
index 4692f0384a5..67d0539de31 100644
--- a/src/libs/utils/elfreader.h
+++ b/src/libs/utils/elfreader.h
@@ -32,12 +32,17 @@
#include "utils_global.h"
+#include <qbytearray.h>
#include <qendian.h>
+#include <qfile.h>
#include <qvector.h>
#include <qcoreapplication.h>
+#include <qsharedpointer.h>
namespace Utils {
+class ElfMapper;
+
enum ElfProgramHeaderType
{
Elf_PT_NULL = 0,
@@ -161,7 +166,7 @@ public:
enum Result { Ok, NotElf, Corrupt };
ElfData readHeaders();
- QByteArray readSection(const QByteArray &sectionName);
+ QSharedPointer<ElfMapper> readSection(const QByteArray &sectionName);
QString errorString() const { return m_errorString; }
QByteArray readCoreName(bool *isCore);
@@ -174,6 +179,19 @@ private:
ElfData m_elfData;
};
+class QTCREATOR_UTILS_EXPORT ElfMapper
+{
+public:
+ ElfMapper(const ElfReader *reader);
+ bool map();
+
+public:
+ QFile file;
+ QByteArray raw;
+ union { const char *start; const uchar *ustart; };
+ quint64 fdlen;
+};
+
} // namespace Utils
#endif // UTILS_ELFREADER_H