Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d9a03e6

Browse files
committedNov 3, 2015
Squelch a silly warning regarding an extra 'default' in 'case'
Let the editor also clean up whitespace for that file. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13816 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@251979 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 044be93 commit d9a03e6

File tree

1 file changed

+38
-39
lines changed

1 file changed

+38
-39
lines changed
 

‎tools/debugserver/source/debugserver.cpp

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ RNBRunLoopLaunchInferior (RNBRemote *remote, const char *stdin_path, const char
319319

320320
switch (pid_state)
321321
{
322-
default:
323322
case eStateInvalid:
324323
case eStateUnloaded:
325324
case eStateAttaching:
@@ -637,28 +636,28 @@ RNBRunLoopPlatform (RNBRemote *remote)
637636
while (mode == eRNBRunLoopModePlatformMode)
638637
{
639638
std::string set_events_str;
640-
const uint32_t event_mask = RNBContext::event_read_packet_available |
639+
const uint32_t event_mask = RNBContext::event_read_packet_available |
641640
RNBContext::event_read_thread_exiting;
642-
641+
643642
DNBLogThreadedIf (LOG_RNB_EVENTS, "%s ctx.Events().WaitForSetEvents(0x%08x) ...",__FUNCTION__, event_mask);
644643
nub_event_t set_events = ctx.Events().WaitForSetEvents(event_mask);
645644
DNBLogThreadedIf (LOG_RNB_EVENTS, "%s ctx.Events().WaitForSetEvents(0x%08x) => 0x%08x (%s)",__FUNCTION__, event_mask, set_events, ctx.EventsAsString(set_events, set_events_str));
646-
645+
647646
if (set_events)
648647
{
649648
if (set_events & RNBContext::event_read_packet_available)
650649
{
651650
if (remote->HandleReceivedPacket() == rnb_not_connected)
652651
mode = eRNBRunLoopModeExit;
653652
}
654-
653+
655654
if (set_events & RNBContext::event_read_thread_exiting)
656655
{
657656
mode = eRNBRunLoopModeExit;
658657
}
659658
ctx.Events().ResetEvents(set_events);
660659
}
661-
}
660+
}
662661
return eRNBRunLoopModeExit;
663662
}
664663

@@ -671,9 +670,9 @@ static void
671670
PortWasBoundCallbackUnixSocket (const void *baton, in_port_t port)
672671
{
673672
//::printf ("PortWasBoundCallbackUnixSocket (baton = %p, port = %u)\n", baton, port);
674-
673+
675674
const char *unix_socket_name = (const char *)baton;
676-
675+
677676
if (unix_socket_name && unix_socket_name[0])
678677
{
679678
// We were given a unix socket name to use to communicate the port
@@ -685,37 +684,37 @@ PortWasBoundCallbackUnixSocket (const void *baton, in_port_t port)
685684
perror("error: socket (AF_UNIX, SOCK_STREAM, 0)");
686685
exit(1);
687686
}
688-
687+
689688
saddr_un.sun_family = AF_UNIX;
690689
::strncpy(saddr_un.sun_path, unix_socket_name, sizeof(saddr_un.sun_path) - 1);
691690
saddr_un.sun_path[sizeof(saddr_un.sun_path) - 1] = '\0';
692691
saddr_un.sun_len = SUN_LEN (&saddr_un);
693-
692+
694693
if (::connect (s, (struct sockaddr *)&saddr_un, static_cast<socklen_t>(SUN_LEN (&saddr_un))) < 0)
695694
{
696695
perror("error: connect (socket, &saddr_un, saddr_un_len)");
697696
exit(1);
698697
}
699-
698+
700699
//::printf ("connect () sucess!!\n");
701-
702-
700+
701+
703702
// We were able to connect to the socket, now write our PID so whomever
704703
// launched us will know this process's ID
705704
RNBLogSTDOUT ("Listening to port %i...\n", port);
706-
705+
707706
char pid_str[64];
708707
const int pid_str_len = ::snprintf (pid_str, sizeof(pid_str), "%u", port);
709708
const ssize_t bytes_sent = ::send (s, pid_str, pid_str_len, 0);
710-
709+
711710
if (pid_str_len != bytes_sent)
712711
{
713712
perror("error: send (s, pid_str, pid_str_len, 0)");
714713
exit (1);
715714
}
716-
715+
717716
//::printf ("send () sucess!!\n");
718-
717+
719718
// We are done with the socket
720719
close (s);
721720
}
@@ -893,7 +892,7 @@ main (int argc, char *argv[])
893892
#if defined (__arm__) || defined (__arm64__) || defined (__aarch64__)
894893
struct sched_param thread_param;
895894
int thread_sched_policy;
896-
if (pthread_getschedparam(pthread_self(), &thread_sched_policy, &thread_param) == 0)
895+
if (pthread_getschedparam(pthread_self(), &thread_sched_policy, &thread_param) == 0)
897896
{
898897
thread_param.sched_priority = 47;
899898
pthread_setschedparam(pthread_self(), thread_sched_policy, &thread_param);
@@ -915,25 +914,25 @@ main (int argc, char *argv[])
915914
// signal (SIGINT, signal_handler);
916915
signal (SIGPIPE, signal_handler);
917916
signal (SIGHUP, signal_handler);
918-
917+
919918
// We're always sitting in waitpid or kevent waiting on our target process' death,
920919
// we don't need no stinking SIGCHLD's...
921-
920+
922921
sigset_t sigset;
923922
sigemptyset(&sigset);
924923
sigaddset(&sigset, SIGCHLD);
925924
sigprocmask(SIG_BLOCK, &sigset, NULL);
926925

927926
g_remoteSP.reset (new RNBRemote ());
928-
929-
927+
928+
930929
RNBRemote *remote = g_remoteSP.get();
931930
if (remote == NULL)
932931
{
933932
RNBLogSTDERR ("error: failed to create a remote connection class\n");
934933
return -1;
935934
}
936-
935+
937936
RNBContext& ctx = remote->Context();
938937

939938
int i;
@@ -965,11 +964,11 @@ main (int argc, char *argv[])
965964

966965
char short_options[512];
967966
uint32_t short_options_idx = 0;
968-
967+
969968
// Handle the two case that don't have short options in g_long_options
970969
short_options[short_options_idx++] = 'k';
971970
short_options[short_options_idx++] = 't';
972-
971+
973972
for (i=0; g_long_options[i].name != NULL; ++i)
974973
{
975974
if (isalpha(g_long_options[i].val))
@@ -978,7 +977,7 @@ main (int argc, char *argv[])
978977
switch (g_long_options[i].has_arg)
979978
{
980979
default:
981-
case no_argument:
980+
case no_argument:
982981
break;
983982

984983
case optional_argument:
@@ -992,7 +991,7 @@ main (int argc, char *argv[])
992991
}
993992
// NULL terminate the short option string.
994993
short_options[short_options_idx++] = '\0';
995-
994+
996995
#if __GLIBC__
997996
optind = 0;
998997
#else
@@ -1074,7 +1073,7 @@ main (int argc, char *argv[])
10741073
}
10751074
}
10761075
break;
1077-
1076+
10781077
case 'K':
10791078
g_detach_on_error = false;
10801079

@@ -1139,7 +1138,7 @@ main (int argc, char *argv[])
11391138
if (log_file != NULL)
11401139
setlinebuf(log_file);
11411140
}
1142-
1141+
11431142
if (log_file == NULL)
11441143
{
11451144
const char *errno_str = strerror(errno);
@@ -1190,15 +1189,15 @@ main (int argc, char *argv[])
11901189
case 'O':
11911190
ctx.GetSTDOUT().assign(optarg);
11921191
break;
1193-
1192+
11941193
case 'E':
11951194
ctx.GetSTDERR().assign(optarg);
11961195
break;
11971196

11981197
case 'n':
11991198
no_stdio = true;
12001199
break;
1201-
1200+
12021201
case 'S':
12031202
// Put debugserver into a new session. Terminals group processes
12041203
// into sessions and when a special terminal key sequences
@@ -1216,7 +1215,7 @@ main (int argc, char *argv[])
12161215
case 'D':
12171216
g_disable_aslr = 1;
12181217
break;
1219-
1218+
12201219
case 'p':
12211220
start_mode = eRNBRunLoopModePlatformMode;
12221221
break;
@@ -1228,12 +1227,12 @@ main (int argc, char *argv[])
12281227
case 'P':
12291228
named_pipe_path.assign (optarg);
12301229
break;
1231-
1230+
12321231
case 'e':
12331232
// Pass a single specified environment variable down to the process that gets launched
12341233
remote->Context().PushEnvironment(optarg);
12351234
break;
1236-
1235+
12371236
case 'F':
12381237
// Pass the current environment down to the process that gets launched
12391238
{
@@ -1246,10 +1245,10 @@ main (int argc, char *argv[])
12461245
break;
12471246
}
12481247
}
1249-
1248+
12501249
if (arch_name.empty())
12511250
{
1252-
#if defined (__arm__)
1251+
#if defined (__arm__)
12531252
arch_name.assign ("arm");
12541253
#endif
12551254
}
@@ -1278,7 +1277,7 @@ main (int argc, char *argv[])
12781277
}
12791278

12801279
remote->Context().SetDetachOnError(g_detach_on_error);
1281-
1280+
12821281
remote->Initialize();
12831282

12841283
// It is ok for us to set NULL as the logfile (this will disable any logging)
@@ -1603,7 +1602,7 @@ main (int argc, char *argv[])
16031602

16041603
case eRNBRunLoopModeInferiorLaunching:
16051604
{
1606-
mode = RNBRunLoopLaunchInferior (remote,
1605+
mode = RNBRunLoopLaunchInferior (remote,
16071606
ctx.GetSTDINPath(),
16081607
ctx.GetSTDOUTPath(),
16091608
ctx.GetSTDERRPath(),
@@ -1653,7 +1652,7 @@ main (int argc, char *argv[])
16531652
if (remote->Comm().OpenFile (str))
16541653
mode = eRNBRunLoopModeExit;
16551654
}
1656-
1655+
16571656
if (mode != eRNBRunLoopModeExit)
16581657
mode = RNBRunLoopPlatform (remote);
16591658
break;

0 commit comments

Comments
 (0)