diff options
Diffstat (limited to 'gdb/exceptions.c')
-rw-r--r-- | gdb/exceptions.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/exceptions.c b/gdb/exceptions.c index 9a10f66..9919938 100644 --- a/gdb/exceptions.c +++ b/gdb/exceptions.c @@ -256,3 +256,21 @@ catch_errors (catch_errors_ftype *func, void *func_args, char *errstring, return 0; return val; } + +/* See exceptions.h. */ + +int +exception_print_same (struct gdb_exception e1, struct gdb_exception e2) +{ + const char *msg1 = e1.message; + const char *msg2 = e2.message; + + if (msg1 == NULL) + msg1 = ""; + if (msg2 == NULL) + msg2 = ""; + + return (e1.reason == e2.reason + && e1.error == e2.error + && strcmp (msg1, msg2) == 0); +} |