Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 1 | //===-- Status.cpp -----------------------------------------------*- C++ |
| 2 | //-*-===// |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 3 | // |
| 4 | // The LLVM Compiler Infrastructure |
| 5 | // |
| 6 | // This file is distributed under the University of Illinois Open Source |
| 7 | // License. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 11 | #include "lldb/Utility/Status.h" |
Zachary Turner | 4479ac1 | 2017-04-06 18:12:24 +0000 | [diff] [blame] | 12 | |
| 13 | #include "lldb/Utility/VASPrintf.h" |
Pavel Labath | 10c41f3 | 2017-06-06 14:06:17 +0000 | [diff] [blame] | 14 | #include "lldb/lldb-defines.h" // for LLDB_GENERIC_ERROR |
| 15 | #include "lldb/lldb-enumerations.h" // for ErrorType, ErrorType::eErr... |
| 16 | #include "llvm/ADT/SmallString.h" // for SmallString |
| 17 | #include "llvm/ADT/StringRef.h" // for StringRef |
| 18 | #include "llvm/Support/Errno.h" |
Zachary Turner | 4479ac1 | 2017-04-06 18:12:24 +0000 | [diff] [blame] | 19 | #include "llvm/Support/FormatProviders.h" // for format_provider |
| 20 | |
| 21 | #include <cerrno> |
| 22 | #include <cstdarg> |
| 23 | #include <string> // for string |
| 24 | #include <system_error> |
| 25 | |
Charles Davis | 322fc84 | 2013-08-27 06:13:56 +0000 | [diff] [blame] | 26 | #ifdef __APPLE__ |
Charles Davis | 510938e | 2013-08-27 05:04:57 +0000 | [diff] [blame] | 27 | #include <mach/mach.h> |
Charles Davis | 322fc84 | 2013-08-27 06:13:56 +0000 | [diff] [blame] | 28 | #endif |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 29 | |
Zachary Turner | 4479ac1 | 2017-04-06 18:12:24 +0000 | [diff] [blame] | 30 | #include <stdint.h> // for uint32_t |
Eugene Zelenko | a74f37a | 2016-03-10 23:57:12 +0000 | [diff] [blame] | 31 | |
Zachary Turner | 4479ac1 | 2017-04-06 18:12:24 +0000 | [diff] [blame] | 32 | namespace llvm { |
| 33 | class raw_ostream; |
| 34 | } |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 35 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 36 | using namespace lldb; |
| 37 | using namespace lldb_private; |
| 38 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 39 | Status::Status() : m_code(0), m_type(eErrorTypeInvalid), m_string() {} |
Greg Clayton | ca512b3 | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 40 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 41 | Status::Status(ValueType err, ErrorType type) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 42 | : m_code(err), m_type(type), m_string() {} |
Greg Clayton | ca512b3 | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 43 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 44 | Status::Status(std::error_code EC) |
Zachary Turner | 7d86ee5 | 2017-03-08 17:56:08 +0000 | [diff] [blame] | 45 | : m_code(EC.value()), m_type(ErrorType::eErrorTypeGeneric), |
| 46 | m_string(EC.message()) {} |
| 47 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 48 | Status::Status(const Status &rhs) = default; |
Greg Clayton | ca512b3 | 2011-01-14 04:54:56 +0000 | [diff] [blame] | 49 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 50 | Status::Status(const char *format, ...) |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 51 | : m_code(0), m_type(eErrorTypeInvalid), m_string() { |
| 52 | va_list args; |
| 53 | va_start(args, format); |
| 54 | SetErrorToGenericError(); |
| 55 | SetErrorStringWithVarArg(format, args); |
| 56 | va_end(args); |
Enrico Granata | f2bbf71 | 2011-07-15 02:26:42 +0000 | [diff] [blame] | 57 | } |
| 58 | |
Pavel Labath | 3adc408 | 2017-06-15 11:23:26 +0000 | [diff] [blame^] | 59 | const Status &Status::operator=(llvm::Error error) { |
| 60 | if (!error) { |
| 61 | Clear(); |
| 62 | return *this; |
| 63 | } |
Pavel Labath | a24a3a3 | 2017-05-18 12:46:50 +0000 | [diff] [blame] | 64 | |
| 65 | // if the error happens to be a errno error, preserve the error code |
| 66 | error = llvm::handleErrors( |
| 67 | std::move(error), [&](std::unique_ptr<llvm::ECError> e) -> llvm::Error { |
| 68 | std::error_code ec = e->convertToErrorCode(); |
| 69 | if (ec.category() == std::generic_category()) { |
| 70 | m_code = ec.value(); |
| 71 | m_type = ErrorType::eErrorTypePOSIX; |
| 72 | return llvm::Error::success(); |
| 73 | } |
| 74 | return llvm::Error(std::move(e)); |
| 75 | }); |
| 76 | |
| 77 | // Otherwise, just preserve the message |
Pavel Labath | 3adc408 | 2017-06-15 11:23:26 +0000 | [diff] [blame^] | 78 | if (error) { |
| 79 | SetErrorToGenericError(); |
Pavel Labath | a24a3a3 | 2017-05-18 12:46:50 +0000 | [diff] [blame] | 80 | SetErrorString(llvm::toString(std::move(error))); |
Pavel Labath | 3adc408 | 2017-06-15 11:23:26 +0000 | [diff] [blame^] | 81 | } |
| 82 | |
| 83 | return *this; |
Pavel Labath | a24a3a3 | 2017-05-18 12:46:50 +0000 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | llvm::Error Status::ToError() const { |
| 87 | if (Success()) |
| 88 | return llvm::Error::success(); |
| 89 | if (m_type == ErrorType::eErrorTypePOSIX) |
| 90 | return llvm::errorCodeToError(std::error_code(m_code, std::generic_category())); |
| 91 | return llvm::make_error<llvm::StringError>(AsCString(), |
| 92 | llvm::inconvertibleErrorCode()); |
| 93 | } |
| 94 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 95 | //---------------------------------------------------------------------- |
| 96 | // Assignment operator |
| 97 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 98 | const Status &Status::operator=(const Status &rhs) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 99 | if (this != &rhs) { |
| 100 | m_code = rhs.m_code; |
| 101 | m_type = rhs.m_type; |
| 102 | m_string = rhs.m_string; |
| 103 | } |
| 104 | return *this; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 105 | } |
| 106 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 107 | //---------------------------------------------------------------------- |
| 108 | // Assignment operator |
| 109 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 110 | const Status &Status::operator=(uint32_t err) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 111 | m_code = err; |
| 112 | m_type = eErrorTypeMachKernel; |
| 113 | m_string.clear(); |
| 114 | return *this; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 115 | } |
| 116 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 117 | Status::~Status() = default; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 118 | |
| 119 | //---------------------------------------------------------------------- |
| 120 | // Get the error value as a NULL C string. The error string will be |
| 121 | // fetched and cached on demand. The cached error string value will |
| 122 | // remain until the error value is changed or cleared. |
| 123 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 124 | const char *Status::AsCString(const char *default_error_str) const { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 125 | if (Success()) |
| 126 | return nullptr; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 127 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 128 | if (m_string.empty()) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 129 | switch (m_type) { |
| 130 | case eErrorTypeMachKernel: |
| 131 | #if defined(__APPLE__) |
Pavel Labath | 10c41f3 | 2017-06-06 14:06:17 +0000 | [diff] [blame] | 132 | if (const char *s = ::mach_error_string(m_code)) |
| 133 | m_string.assign(s); |
Eli Friedman | 6eb685c | 2010-06-10 23:45:58 +0000 | [diff] [blame] | 134 | #endif |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 135 | break; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 136 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 137 | case eErrorTypePOSIX: |
Pavel Labath | 10c41f3 | 2017-06-06 14:06:17 +0000 | [diff] [blame] | 138 | m_string = llvm::sys::StrError(m_code); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 139 | break; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 140 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 141 | default: |
| 142 | break; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 143 | } |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 144 | } |
| 145 | if (m_string.empty()) { |
| 146 | if (default_error_str) |
| 147 | m_string.assign(default_error_str); |
| 148 | else |
| 149 | return nullptr; // User wanted a nullptr string back... |
| 150 | } |
| 151 | return m_string.c_str(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 152 | } |
| 153 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 154 | //---------------------------------------------------------------------- |
| 155 | // Clear the error and any cached error string that it might contain. |
| 156 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 157 | void Status::Clear() { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 158 | m_code = 0; |
| 159 | m_type = eErrorTypeInvalid; |
| 160 | m_string.clear(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | //---------------------------------------------------------------------- |
| 164 | // Access the error value. |
| 165 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 166 | Status::ValueType Status::GetError() const { return m_code; } |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 167 | |
| 168 | //---------------------------------------------------------------------- |
| 169 | // Access the error type. |
| 170 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 171 | ErrorType Status::GetType() const { return m_type; } |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 172 | |
| 173 | //---------------------------------------------------------------------- |
Ed Maste | 75500e7 | 2016-07-19 15:28:02 +0000 | [diff] [blame] | 174 | // Returns true if this object contains a value that describes an |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 175 | // error or otherwise non-success result. |
| 176 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 177 | bool Status::Fail() const { return m_code != 0; } |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 178 | |
| 179 | //---------------------------------------------------------------------- |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 180 | // Set accesssor for the error value to "err" and the type to |
| 181 | // "eErrorTypeMachKernel" |
| 182 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 183 | void Status::SetMachError(uint32_t err) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 184 | m_code = err; |
| 185 | m_type = eErrorTypeMachKernel; |
| 186 | m_string.clear(); |
| 187 | } |
| 188 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 189 | void Status::SetExpressionError(lldb::ExpressionResults result, |
| 190 | const char *mssg) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 191 | m_code = result; |
| 192 | m_type = eErrorTypeExpression; |
| 193 | m_string = mssg; |
| 194 | } |
| 195 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 196 | int Status::SetExpressionErrorWithFormat(lldb::ExpressionResults result, |
| 197 | const char *format, ...) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 198 | int length = 0; |
| 199 | |
| 200 | if (format != nullptr && format[0]) { |
| 201 | va_list args; |
| 202 | va_start(args, format); |
| 203 | length = SetErrorStringWithVarArg(format, args); |
| 204 | va_end(args); |
| 205 | } else { |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 206 | m_string.clear(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 207 | } |
| 208 | m_code = result; |
| 209 | m_type = eErrorTypeExpression; |
| 210 | return length; |
Jim Ingham | 1624a2d | 2014-05-05 02:26:40 +0000 | [diff] [blame] | 211 | } |
| 212 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 213 | //---------------------------------------------------------------------- |
| 214 | // Set accesssor for the error value and type. |
| 215 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 216 | void Status::SetError(ValueType err, ErrorType type) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 217 | m_code = err; |
| 218 | m_type = type; |
| 219 | m_string.clear(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | //---------------------------------------------------------------------- |
| 223 | // Update the error value to be "errno" and update the type to |
| 224 | // be "POSIX". |
| 225 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 226 | void Status::SetErrorToErrno() { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 227 | m_code = errno; |
| 228 | m_type = eErrorTypePOSIX; |
| 229 | m_string.clear(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | //---------------------------------------------------------------------- |
| 233 | // Update the error value to be LLDB_GENERIC_ERROR and update the type |
| 234 | // to be "Generic". |
| 235 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 236 | void Status::SetErrorToGenericError() { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 237 | m_code = LLDB_GENERIC_ERROR; |
| 238 | m_type = eErrorTypeGeneric; |
| 239 | m_string.clear(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | //---------------------------------------------------------------------- |
| 243 | // Set accessor for the error string value for a specific error. |
| 244 | // This allows any string to be supplied as an error explanation. |
| 245 | // The error string value will remain until the error value is |
| 246 | // cleared or a new error value/type is assigned. |
| 247 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 248 | void Status::SetErrorString(llvm::StringRef err_str) { |
Zachary Turner | c156427 | 2016-11-16 21:15:24 +0000 | [diff] [blame] | 249 | if (!err_str.empty()) { |
| 250 | // If we have an error string, we should always at least have an error |
| 251 | // set to a generic value. |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 252 | if (Success()) |
| 253 | SetErrorToGenericError(); |
Zachary Turner | c156427 | 2016-11-16 21:15:24 +0000 | [diff] [blame] | 254 | } |
| 255 | m_string = err_str; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | //------------------------------------------------------------------ |
| 259 | /// Set the current error string to a formatted error string. |
| 260 | /// |
| 261 | /// @param format |
| 262 | /// A printf style format string |
| 263 | //------------------------------------------------------------------ |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 264 | int Status::SetErrorStringWithFormat(const char *format, ...) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 265 | if (format != nullptr && format[0]) { |
| 266 | va_list args; |
| 267 | va_start(args, format); |
| 268 | int length = SetErrorStringWithVarArg(format, args); |
| 269 | va_end(args); |
| 270 | return length; |
| 271 | } else { |
| 272 | m_string.clear(); |
| 273 | } |
| 274 | return 0; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 275 | } |
| 276 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 277 | int Status::SetErrorStringWithVarArg(const char *format, va_list args) { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 278 | if (format != nullptr && format[0]) { |
| 279 | // If we have an error string, we should always at least have |
| 280 | // an error set to a generic value. |
| 281 | if (Success()) |
| 282 | SetErrorToGenericError(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 283 | |
Zachary Turner | 24ae629 | 2017-02-16 19:38:21 +0000 | [diff] [blame] | 284 | llvm::SmallString<1024> buf; |
| 285 | VASprintf(buf, format, args); |
Pavel Labath | a272fa8 | 2017-02-17 10:19:46 +0000 | [diff] [blame] | 286 | m_string = buf.str(); |
Zachary Turner | 24ae629 | 2017-02-16 19:38:21 +0000 | [diff] [blame] | 287 | return buf.size(); |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 288 | } else { |
| 289 | m_string.clear(); |
| 290 | } |
| 291 | return 0; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 292 | } |
| 293 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 294 | //---------------------------------------------------------------------- |
| 295 | // Returns true if the error code in this object is considered a |
| 296 | // successful return value. |
| 297 | //---------------------------------------------------------------------- |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 298 | bool Status::Success() const { return m_code == 0; } |
Jim Ingham | 4e5c821 | 2013-06-07 22:09:53 +0000 | [diff] [blame] | 299 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 300 | bool Status::WasInterrupted() const { |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 301 | return (m_type == eErrorTypePOSIX && m_code == EINTR); |
Jim Ingham | 4e5c821 | 2013-06-07 22:09:53 +0000 | [diff] [blame] | 302 | } |
Zachary Turner | 33aba3c | 2017-02-06 18:31:44 +0000 | [diff] [blame] | 303 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 304 | void llvm::format_provider<lldb_private::Status>::format( |
| 305 | const lldb_private::Status &error, llvm::raw_ostream &OS, |
Zachary Turner | 33aba3c | 2017-02-06 18:31:44 +0000 | [diff] [blame] | 306 | llvm::StringRef Options) { |
| 307 | llvm::format_provider<llvm::StringRef>::format(error.AsCString(), OS, |
| 308 | Options); |
| 309 | } |