| 31 | }; |
| 32 | |
| 33 | inline uintptr_t hex_str_to_int(const std::string& str) { |
| 34 | uintptr_t out; |
| 35 | std::stringstream ss; |
| 36 | ss << std::hex << str; |
| 37 | ss >> out; |
| 38 | if(ss.eof() && !ss.fail()) { // whole stream read, with no errors |
| 39 | return out; |
| 40 | } else { |
| 41 | throw std::invalid_argument(std::string("can't convert '") + str + "' to hex"); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | // parse line from /proc/<id>/maps |
| 46 | // format: |
no outgoing calls
no test coverage detected