Skip to content

Commit dcb93ff

Browse files
committed
Add helper for querying offset
to pointer_valuet.
1 parent c61e2b3 commit dcb93ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/memory-analyzer/gdb_api.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Author: Malte Mues <[email protected]>
1919
#define CPROVER_MEMORY_ANALYZER_GDB_API_H
2020
#include <unistd.h>
2121

22+
#include <algorithm>
2223
#include <exception>
2324
#include <forward_list>
2425

@@ -81,6 +82,12 @@ class gdb_apit
8182
const std::string pointee;
8283
const std::string character;
8384
const optionalt<std::string> string;
85+
86+
bool has_known_offset() const
87+
{
88+
return std::any_of(
89+
pointee.begin(), pointee.end(), [](char c) { return c == '+'; });
90+
}
8491
};
8592

8693
/// Create a new gdb process for analysing the binary indicated by the member

0 commit comments

Comments
 (0)