OLD | NEW |
1 // Copyright (c) 2010 Google Inc. | 1 // Copyright (c) 2010 Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 21 matching lines...) Expand all Loading... |
32 // dump_stabs.cc --- implement the StabsToModule class. | 32 // dump_stabs.cc --- implement the StabsToModule class. |
33 | 33 |
34 #include <assert.h> | 34 #include <assert.h> |
35 #include <cxxabi.h> | 35 #include <cxxabi.h> |
36 #include <stdarg.h> | 36 #include <stdarg.h> |
37 #include <stdio.h> | 37 #include <stdio.h> |
38 | 38 |
39 #include <algorithm> | 39 #include <algorithm> |
40 | 40 |
41 #include "common/stabs_to_module.h" | 41 #include "common/stabs_to_module.h" |
| 42 #include "common/using_std_string.h" |
42 | 43 |
43 namespace google_breakpad { | 44 namespace google_breakpad { |
44 | 45 |
45 using std::string; | |
46 | |
47 // Demangle using abi call. | 46 // Demangle using abi call. |
48 // Older GCC may not support it. | 47 // Older GCC may not support it. |
49 static string Demangle(const string &mangled) { | 48 static string Demangle(const string &mangled) { |
50 int status = 0; | 49 int status = 0; |
51 char *demangled = abi::__cxa_demangle(mangled.c_str(), NULL, NULL, &status); | 50 char *demangled = abi::__cxa_demangle(mangled.c_str(), NULL, NULL, &status); |
52 if (status == 0 && demangled != NULL) { | 51 if (status == 0 && demangled != NULL) { |
53 string str(demangled); | 52 string str(demangled); |
54 free(demangled); | 53 free(demangled); |
55 return str; | 54 return str; |
56 } | 55 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 last_line->size = (f->address + f->size) - last_line->address; | 191 last_line->size = (f->address + f->size) - last_line->address; |
193 } | 192 } |
194 } | 193 } |
195 // Now that everything has a size, add our functions to the module, and | 194 // Now that everything has a size, add our functions to the module, and |
196 // dispose of our private list. | 195 // dispose of our private list. |
197 module_->AddFunctions(functions_.begin(), functions_.end()); | 196 module_->AddFunctions(functions_.begin(), functions_.end()); |
198 functions_.clear(); | 197 functions_.clear(); |
199 } | 198 } |
200 | 199 |
201 } // namespace google_breakpad | 200 } // namespace google_breakpad |
OLD | NEW |