Changeset 17f28a1 in opengl-game
- Timestamp:
- Jun 19, 2019, 7:22:38 PM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 9d4456b, f024d59
- Parents:
- 4762301
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
CrashLogger.cpp
r4762301 r17f28a1 145 145 146 146 size_t funcnamesize = 1024; 147 char funcname[1024];147 char* funcname = (char*)malloc(sizeof(char) * funcnamesize); 148 148 149 149 // iterate over the returned symbol lines … … 164 164 } 165 165 166 if (begin_name && begin_offset && (begin_name < begin_offset )) { 166 write(fd_out, " ", 2); 167 if (begin_name && begin_offset && (begin_name < begin_offset)) { 167 168 *begin_name++ = '\0'; 168 169 *begin_offset++ = '\0'; … … 176 177 if (status == 0) { 177 178 funcname = ret; // use possibly realloc()-ed string 178 write(fd_out, " ", 2);179 179 write(fd_out, symbollist[i], strlen(symbollist[i])); 180 180 write(fd_out, " ", 1); … … 183 183 } else { 184 184 // demangling failed. Output function name as a C function with no arguments. 185 write(fd_out, " ", 2);186 185 write(fd_out, symbollist[i], strlen(symbollist[i])); 187 186 write(fd_out, " ", 1); … … 190 189 } 191 190 write(fd_out, begin_offset, strlen(begin_offset)); 192 write(fd_out, "\n", 1); 193 } else {` 191 } else { 194 192 // couldn't parse the line? print the whole line. 195 193 write(fd_out, symbollist[i], strlen(symbollist[i])); 196 194 } 195 write(fd_out, "\n", 1); 197 196 #else 198 197 for (char *p = symbollist[i]; *p; p++) { … … 206 205 } 207 206 207 write(fd_out, " ", 2); 208 208 if (begin_name && end_offset && (begin_name < end_offset)) { 209 209 *begin_name++ = '\0'; … … 219 219 char* ret = abi::__cxa_demangle(begin_name, funcname, &funcnamesize, &status); 220 220 221 write(fd_out, " ", 2);222 221 write(fd_out, symbollist[i], strlen(symbollist[i])); 223 222 write(fd_out, " ( ", 3); … … 226 225 } else { 227 226 write(fd_out, begin_name, strlen(begin_name)); 228 } 227 } 228 229 229 if (begin_offset) { 230 230 write(fd_out, " + ", 3); … … 235 235 write(fd_out, ") ", 1); 236 236 write(fd_out, end_offset, strlen(end_offset)); 237 write(fd_out, "\n", 1);238 237 } else { 239 238 // couldn't parse the line? print the whole line. 240 239 write(fd_out, symbollist[i], strlen(symbollist[i])); 241 240 } 241 write(fd_out, "\n", 1); 242 242 #endif 243 243 } 244 244 245 free(funcname); 245 246 free(symbollist); 246 247 -
makefile
r4762301 r17f28a1 2 2 CC = g++ 3 3 CFLAGS = -std=c++0x -Wall -pedantic -rdynamic 4 # -rdynamic is to generate debug info for dynamic symbols on debian-based 5 # systems (tested on Linux Mint) 6 # for OSX, using -g generates a newgame.dSYS directory which has debug symbols. 7 # However, this has no effect on the stack trace, so there must be a way to specify a *.dSYS directory when running ./newgame 8 # or to instead put thos symbols directly into the executable, like -rdynamic does for Linux 4 9 #-Wextra -fno-inline 5 10
Note:
See TracChangeset
for help on using the changeset viewer.