File tree 3 files changed +19
-11
lines changed
3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ std::string gdb_apit::extract_value(const std::string &line)
268
268
std::regex memmory_access_error (" Cannot access memory" );
269
269
if (regex_search (line, memmory_access_error))
270
270
{
271
- throw gdb_inaccessible_memoryt (" ERROR: " + line);
271
+ throw gdb_inaccessible_memory_exceptiont (" ERROR: " + line);
272
272
}
273
273
throw gdb_interaction_exceptiont (" Cannot extract value from this: " + line);
274
274
}
Original file line number Diff line number Diff line change @@ -42,29 +42,36 @@ class gdb_apit
42
42
static gdb_output_recordt parse_gdb_output_record (const std::string &s);
43
43
};
44
44
45
- class gdb_interaction_exceptiont : public std :: exception
45
+ class gdb_interaction_exceptiont : public cprover_exception_baset
46
46
{
47
47
public:
48
- explicit gdb_interaction_exceptiont (std::string reason) : std::exception( )
48
+ explicit gdb_interaction_exceptiont (std::string reason) : reason(reason )
49
49
{
50
- error = reason;
51
50
}
52
- const char * what () const throw()
51
+ std::string what () const override
53
52
{
54
- return error. c_str () ;
53
+ return reason ;
55
54
}
56
55
57
56
private:
58
- std::string error ;
57
+ std::string reason ;
59
58
};
60
59
61
- class gdb_inaccessible_memoryt : public gdb_interaction_exceptiont
60
+ class gdb_inaccessible_memory_exceptiont : public cprover_exception_baset
62
61
{
63
62
public:
64
- explicit gdb_inaccessible_memoryt (std::string reason)
65
- : gdb_interaction_exceptiont (reason)
63
+ explicit gdb_inaccessible_memory_exceptiont (std::string reason)
64
+ : reason (reason)
66
65
{
67
66
}
67
+
68
+ std::string what () const override
69
+ {
70
+ return reason;
71
+ }
72
+
73
+ private:
74
+ std::string reason;
68
75
};
69
76
#endif
70
77
#endif
Original file line number Diff line number Diff line change @@ -218,7 +218,8 @@ SCENARIO(
218
218
const std::string line = " Cannot access memory at address 0x71" ;
219
219
THEN (" a gdb_inaccesible_memoryt excepition must be raised" )
220
220
{
221
- REQUIRE_THROWS_AS (gdb_api.extract_value (line), gdb_inaccessible_memoryt);
221
+ REQUIRE_THROWS_AS (
222
+ gdb_api.extract_value (line), gdb_inaccessible_memory_exceptiont);
222
223
}
223
224
}
224
225
You can’t perform that action at this time.
0 commit comments