this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dSYM generation improvements, thread name support for LLDB

+34 -11
+6 -5
cmake/dsym.cmake
··· 1 1 2 2 function(dsym target) 3 - if (DSYMUTIL_EXE AND CMAKE_BUILD_TYPE MATCHES DEBUG) 3 + string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type) 4 + if (DSYMUTIL_EXE AND build_type MATCHES debug) 4 5 5 - add_custom_command(OUTPUT "${target}.dSYM" COMMAND ${CMAKE_COMMAND} -E env 6 + add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}.dSYM" DEPENDS "${target}" COMMAND ${CMAKE_COMMAND} -E env 6 7 "PATH=${CMAKE_BINARY_DIR}/src/external/cctools-port/cctools/misc:$ENV{PATH}" 7 8 "${DSYMUTIL_EXE}" "-flat" "-o" "${target}.dSYM" "$<TARGET_FILE:${target}>") 8 9 9 - add_custom_target("${target}-dSYM" ALL DEPENDS "${target}" "${target}.dSYM" getuuid lipo) 10 + add_custom_target("${target}-dSYM" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${target}.dSYM" getuuid lipo) 10 11 11 12 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${target}.dSYM" DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/Caches/dsym/files") 12 13 install(DIRECTORY DESTINATION "${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/Caches/dsym/uuid") ··· 26 27 endforeach (uuid) 27 28 endif() 28 29 ") 29 - 30 30 endif () 31 31 32 32 endfunction(dsym) 33 33 34 34 function(FindDsymutil) 35 - find_program(DSYMUTIL_EXE NAMES "llvm-dsymutil" "dsymutil" "llvm-dsymutil-7.0" "llvm-dsymutil-6.0" "llvm-dsymutil-5.0" "llvm-dsymutil-4.0" "llvm-dsymutil-3.9" "llvm-dsymutil-3.8" "llvm-dsymutil-3.7") 35 + # llvm-dsymutil-4.0 is not listed, because it's very buggy 36 + find_program(DSYMUTIL_EXE NAMES "llvm-dsymutil" "dsymutil" "llvm-dsymutil-7.0" "llvm-dsymutil-6.0" "llvm-dsymutil-5.0" "llvm-dsymutil-3.9" "llvm-dsymutil-3.8" "llvm-dsymutil-3.7") 36 37 if (DSYMUTIL_EXE) 37 38 message(STATUS "Found dsymutil: ${DSYMUTIL_EXE}") 38 39 else (DSYMUTIL_EXE)
+28 -6
src/kernel/emulation/linux/misc/proc_info.c
··· 81 81 static long _proc_pidinfo_shortbsdinfo(int32_t pid, void* buffer, int32_t bufsize); 82 82 static long _proc_pidonfo_uniqinfo(int32_t pid, void* buffer, int32_t bufsize); 83 83 static long _proc_pidinfo_tbsdinfo(int32_t pid, void* buffer, int32_t bufsize); 84 - static long _proc_pidinfo_pidthreadinfo(int32_t pid, void* buffer, int32_t bufsize); 84 + static long _proc_pidinfo_pidthreadinfo(int32_t pid, uint64_t thread_handle, void* buffer, int32_t bufsize); 85 85 86 86 long _proc_pidinfo(int32_t pid, uint32_t flavor, uint64_t arg, void* buffer, int32_t bufsize) 87 87 { ··· 107 107 { 108 108 return _proc_pidinfo_tbsdinfo(pid, buffer, bufsize); 109 109 } 110 - /* Not implemented yet 111 110 case PROC_PIDTHREADINFO: 112 111 { 113 - return _proc_pidinfo_pidthreadinfo(pid, buffer, bufsize); 112 + return _proc_pidinfo_pidthreadinfo(pid, arg, buffer, bufsize); 114 113 } 115 - */ 116 114 default: 117 115 { 118 116 __simple_printf("sys_proc_info(): Unsupported pidinfo flavor: %d\n", ··· 227 225 return err; 228 226 } 229 227 230 - static long _proc_pidinfo_pidthreadinfo(int32_t pid, void* buffer, int32_t bufsize) 228 + static long _proc_pidinfo_pidthreadinfo(int32_t pid, uint64_t thread_handle, void* buffer, int32_t bufsize) 231 229 { 232 - // TODO 230 + char path[64], stat[1024]; 231 + int32_t tid = (int32_t)(thread_handle & 0xffffffff); 232 + 233 + // __simple_printf("Asking for pid/tid %d/%d\n", pid, tid); 234 + 235 + struct proc_threadinfo* info = (struct proc_threadinfo*) buffer; 236 + if (bufsize < sizeof(*info)) 237 + return -ENOSPC; 238 + 239 + memset(buffer, 0, bufsize); 240 + 241 + __simple_sprintf(path, "/proc/%d/task/%d/comm", pid, tid); 242 + // __simple_printf("Reading thread name from %s\n", path); 243 + if (!read_string(path, info->pth_name, sizeof(info->pth_name))) 244 + return -ESRCH; 245 + else 246 + { 247 + // Kill LF at the end of pth_name 248 + int length = strlen(info->pth_name); 249 + if (length > 0 && info->pth_name[length-1] == '\n') 250 + info->pth_name[length-1] = 0; 251 + } 252 + 253 + // TODO: Other proc_threadinfo fields 254 + return 1; 233 255 } 234 256 235 257 static long _proc_pidinfo_shortbsdinfo(int32_t pid, void* buffer, int32_t bufsize)