[Lldb-commits] [lldb] r334320 - Delete some dead code

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 8 14:13:26 PDT 2018


Author: xiaobai
Date: Fri Jun  8 14:13:26 2018
New Revision: 334320

URL: http://llvm.org/viewvc/llvm-project?rev=334320&view=rev
Log:
Delete some dead code

Modified:
    lldb/trunk/source/Host/macosx/Host.mm
    lldb/trunk/tools/debugserver/source/RNBRemote.cpp
    lldb/trunk/tools/driver/Driver.cpp

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=334320&r1=334319&r2=334320&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Fri Jun  8 14:13:26 2018
@@ -182,175 +182,6 @@ static bool WaitForProcessToSIGSTOP(cons
 }
 #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
 
-// static lldb::pid_t
-// LaunchInNewTerminalWithCommandFile
-//(
-//    const char **argv,
-//    const char **envp,
-//    const char *working_dir,
-//    const ArchSpec *arch_spec,
-//    bool stop_at_entry,
-//    bool disable_aslr
-//)
-//{
-//    if (!argv || !argv[0])
-//        return LLDB_INVALID_PROCESS_ID;
-//
-//    OSStatus error = 0;
-//
-//    FileSpec program (argv[0], false);
-//
-//
-//    std::string unix_socket_name;
-//
-//    char temp_file_path[PATH_MAX];
-//    const char *tmpdir = ::getenv ("TMPDIR");
-//    if (tmpdir == NULL)
-//        tmpdir = "/tmp/";
-//    ::snprintf (temp_file_path, sizeof(temp_file_path), "%s%s-XXXXXX", tmpdir,
-//    program.GetFilename().AsCString());
-//
-//    if (::mktemp (temp_file_path) == NULL)
-//        return LLDB_INVALID_PROCESS_ID;
-//
-//    unix_socket_name.assign (temp_file_path);
-//
-//    ::strlcat (temp_file_path, ".command", sizeof (temp_file_path));
-//
-//    StreamFile command_file;
-//    command_file.GetFile().Open (temp_file_path,
-//                                 File::eOpenOptionWrite |
-//                                 File::eOpenOptionCanCreate,
-//                                 lldb::eFilePermissionsDefault);
-//
-//    if (!command_file.GetFile().IsValid())
-//        return LLDB_INVALID_PROCESS_ID;
-//
-//    FileSpec darwin_debug_file_spec;
-//    if (!HostInfo::GetLLDBPath (ePathTypeSupportExecutableDir,
-//    darwin_debug_file_spec))
-//        return LLDB_INVALID_PROCESS_ID;
-//    darwin_debug_file_spec.GetFilename().SetCString("darwin-debug");
-//
-//    if (!darwin_debug_file_spec.Exists())
-//        return LLDB_INVALID_PROCESS_ID;
-//
-//    char launcher_path[PATH_MAX];
-//    darwin_debug_file_spec.GetPath(launcher_path, sizeof(launcher_path));
-//    command_file.Printf("\"%s\" ", launcher_path);
-//
-//    command_file.Printf("--unix-socket=%s ", unix_socket_name.c_str());
-//
-//    if (arch_spec && arch_spec->IsValid())
-//    {
-//        command_file.Printf("--arch=%s ", arch_spec->GetArchitectureName());
-//    }
-//
-//    if (disable_aslr)
-//    {
-//        command_file.PutCString("--disable-aslr ");
-//    }
-//
-//    command_file.PutCString("-- ");
-//
-//    if (argv)
-//    {
-//        for (size_t i=0; argv[i] != NULL; ++i)
-//        {
-//            command_file.Printf("\"%s\" ", argv[i]);
-//        }
-//    }
-//    command_file.PutCString("\necho Process exited with status $?\n");
-//    command_file.GetFile().Close();
-//    if (::chmod (temp_file_path, S_IRWXU | S_IRWXG) != 0)
-//        return LLDB_INVALID_PROCESS_ID;
-//
-//    CFCMutableDictionary cf_env_dict;
-//
-//    const bool can_create = true;
-//    if (envp)
-//    {
-//        for (size_t i=0; envp[i] != NULL; ++i)
-//        {
-//            const char *env_entry = envp[i];
-//            const char *equal_pos = strchr(env_entry, '=');
-//            if (equal_pos)
-//            {
-//                std::string env_key (env_entry, equal_pos);
-//                std::string env_val (equal_pos + 1);
-//                CFCString cf_env_key (env_key.c_str(), kCFStringEncodingUTF8);
-//                CFCString cf_env_val (env_val.c_str(), kCFStringEncodingUTF8);
-//                cf_env_dict.AddValue (cf_env_key.get(), cf_env_val.get(),
-//                can_create);
-//            }
-//        }
-//    }
-//
-//    LSApplicationParameters app_params;
-//    ::memset (&app_params, 0, sizeof (app_params));
-//    app_params.flags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
-//    app_params.argv = NULL;
-//    app_params.environment = (CFDictionaryRef)cf_env_dict.get();
-//
-//    CFCReleaser<CFURLRef> command_file_url
-//    (::CFURLCreateFromFileSystemRepresentation (NULL,
-//                                                                                       (const UInt8 *)temp_file_path,
-//                                                                                       strlen(temp_file_path),
-//                                                                                       false));
-//
-//    CFCMutableArray urls;
-//
-//    // Terminal.app will open the ".command" file we have created
-//    // and run our process inside it which will wait at the entry point
-//    // for us to attach.
-//    urls.AppendValue(command_file_url.get());
-//
-//
-//    lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
-//
-//    Status lldb_error;
-//    // Sleep and wait a bit for debugserver to start to listen...
-//    char connect_url[128];
-//    ::snprintf (connect_url, sizeof(connect_url), "unix-accept://%s",
-//    unix_socket_name.c_str());
-//
-//    // Spawn a new thread to accept incoming connection on the connect_url
-//    // so we can grab the pid from the inferior
-//    lldb::thread_t accept_thread = Host::ThreadCreate
-//    (unix_socket_name.c_str(),
-//                                                       AcceptPIDFromInferior,
-//                                                       connect_url,
-//                                                       &lldb_error);
-//
-//    ProcessSerialNumber psn;
-//    error = LSOpenURLsWithRole(urls.get(), kLSRolesShell, NULL, &app_params,
-//    &psn, 1);
-//    if (error == noErr)
-//    {
-//        thread_result_t accept_thread_result = NULL;
-//        if (Host::ThreadJoin (accept_thread, &accept_thread_result,
-//        &lldb_error))
-//        {
-//            if (accept_thread_result)
-//            {
-//                pid = (intptr_t)accept_thread_result;
-//
-//                // Wait for process to be stopped the entry point by watching
-//                // for the process status to be set to SSTOP which indicates
-//                it it
-//                // SIGSTOP'ed at the entry point
-//                WaitForProcessToSIGSTOP (pid, 5);
-//            }
-//        }
-//    }
-//    else
-//    {
-//        Host::ThreadCancel (accept_thread, &lldb_error);
-//    }
-//
-//    return pid;
-//}
-
 const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
                                     "   activate\n"
                                     "	do script \"/bin/bash -c '%s';exit\"\n"
@@ -460,19 +291,8 @@ LaunchInNewTerminalWithAppleScript(const
 
   StreamString applescript_source;
 
-  //    if (tty_name && tty_name[0])
-  //    {
-  //        applescript_source.Printf (applscript_in_existing_tty,
-  //                                   tty_command,
-  //                                   tty_name);
-  //    }
-  //    else
-  //    {
   applescript_source.Printf(applscript_in_new_tty,
                             command.GetString().str().c_str());
-  //    }
-
-  // puts (script_source);
   NSAppleScript *applescript = [[NSAppleScript alloc]
       initWithSource:[NSString stringWithCString:applescript_source.GetString()
                                                      .str()

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=334320&r1=334319&r2=334320&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Jun  8 14:13:26 2018
@@ -5446,11 +5446,6 @@ rnb_err_t RNBRemote::HandlePacket_jThrea
                                                  p);
     uint64_t dti_qos_class_index =
         get_integer_value_for_key_name_from_json("dti_qos_class_index", p);
-    // Commented out the two variables below as they are not being used
-    //        uint64_t dti_queue_index =
-    //        get_integer_value_for_key_name_from_json ("dti_queue_index", p);
-    //        uint64_t dti_voucher_index =
-    //        get_integer_value_for_key_name_from_json ("dti_voucher_index", p);
 
     if (tid != INVALID_NUB_ADDRESS) {
       nub_addr_t pthread_t_value = DNBGetPThreadT(pid, tid);

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=334320&r1=334319&r2=334320&view=diff
==============================================================================
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Fri Jun  8 14:13:26 2018
@@ -866,7 +866,6 @@ SBError Driver::ParseArgs(int argc, cons
   } else {
     // Skip any options we consumed with getopt_long_only
     argc -= optind;
-    // argv += optind; // Commented out to keep static analyzer happy
 
     if (argc > 0)
       ::fprintf(out_fh,




More information about the lldb-commits mailing list