-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the Mac debugger attachment on segfault #1386
Comments
The problematic code referred-to (above) was removed from trick_source/sim_services/Executive/Executive_signal_handler.cpp 72 #elif __APPLE__
73 char command[2048];
74 char path[1024] ;
75 uint32_t size = sizeof(path) ;
76 if (_NSGetExecutablePath(path, &size) == 0 ) {
77 if (attach_debugger == true) {
78 write( 2 , "Attempting to attach debugger... standby.\n" , 41 ) ;
79 sprintf(command, "%s -silent %s %d", debugger_command.c_str(), path, getpid());
80 system(command);
81 } else if (stack_trace == true ) {
82 write( 2 , "Attempting to generate stack trace... standby.\n" , 47 ) ;
83 sprintf(command, "%s -batch -s ${TRICK_HOME}/share/trick/lldb_commands -p %d",
84 debugger_command.c_str(), getpid());
85 system(command);
86 }
87 } |
The debugger_command string is set in Trick::Executive::Executive(), in Executive.cpp. 24 struct stat st ;
25 if ( stat("/usr/bin/gdb",&st) == 0 ) {
26 debugger_command = std::string("/usr/bin/gdb") ;
27 } else if ( stat("/usr/bin/lldb",&st) == 0 ) {
28 debugger_command = std::string("/usr/bin/lldb") ;
29 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, code to attach a debugger and dump a stack trace is failing on Mac. This has been useful in the past, but now is hanging and crashing terminals on Mac, so it has been removed. Investigate this issue and try to restore the stack trace on segfault.
This issue can be closed when:
The text was updated successfully, but these errors were encountered: