[Lldb-commits] [lldb] 2d8f8c4 - [lldb] Handle all Clang::Type::Builtin enums

2020-06-15 Thread Kirill Bobyrev via lldb-commits

Author: Kirill Bobyrev
Date: 2020-06-15T10:18:59+02:00
New Revision: 2d8f8c4de38e592eb4fcf6a4ed858763974f8b9f

URL: 
https://github.com/llvm/llvm-project/commit/2d8f8c4de38e592eb4fcf6a4ed858763974f8b9f
DIFF: 
https://github.com/llvm/llvm-project/commit/2d8f8c4de38e592eb4fcf6a4ed858763974f8b9f.diff

LOG: [lldb] Handle all Clang::Type::Builtin enums

Cleanup after https://reviews.llvm.org/D81459

Added: 


Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index b1db3ac3d455..4348d1817297 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -4820,16 +4820,49 @@ lldb::Encoding 
TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
 
 case clang::BuiltinType::SveBool:
 case clang::BuiltinType::SveInt8:
+case clang::BuiltinType::SveInt8x2:
+case clang::BuiltinType::SveInt8x3:
+case clang::BuiltinType::SveInt8x4:
 case clang::BuiltinType::SveInt16:
+case clang::BuiltinType::SveInt16x2:
+case clang::BuiltinType::SveInt16x3:
+case clang::BuiltinType::SveInt16x4:
 case clang::BuiltinType::SveInt32:
+case clang::BuiltinType::SveInt32x2:
+case clang::BuiltinType::SveInt32x3:
+case clang::BuiltinType::SveInt32x4:
 case clang::BuiltinType::SveInt64:
+case clang::BuiltinType::SveInt64x2:
+case clang::BuiltinType::SveInt64x3:
+case clang::BuiltinType::SveInt64x4:
 case clang::BuiltinType::SveUint8:
+case clang::BuiltinType::SveUint8x2:
+case clang::BuiltinType::SveUint8x3:
+case clang::BuiltinType::SveUint8x4:
 case clang::BuiltinType::SveUint16:
+case clang::BuiltinType::SveUint16x2:
+case clang::BuiltinType::SveUint16x3:
+case clang::BuiltinType::SveUint16x4:
 case clang::BuiltinType::SveUint32:
+case clang::BuiltinType::SveUint32x2:
+case clang::BuiltinType::SveUint32x3:
+case clang::BuiltinType::SveUint32x4:
 case clang::BuiltinType::SveUint64:
+case clang::BuiltinType::SveUint64x2:
+case clang::BuiltinType::SveUint64x3:
+case clang::BuiltinType::SveUint64x4:
 case clang::BuiltinType::SveFloat16:
+case clang::BuiltinType::SveFloat16x2:
+case clang::BuiltinType::SveFloat16x3:
+case clang::BuiltinType::SveFloat16x4:
 case clang::BuiltinType::SveFloat32:
+case clang::BuiltinType::SveFloat32x2:
+case clang::BuiltinType::SveFloat32x3:
+case clang::BuiltinType::SveFloat32x4:
 case clang::BuiltinType::SveFloat64:
+case clang::BuiltinType::SveFloat64x2:
+case clang::BuiltinType::SveFloat64x3:
+case clang::BuiltinType::SveFloat64x4:
   break;
 
 case clang::BuiltinType::IncompleteMatrixIdx:



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81838: [debugserver] wait for STDIO thread to finish before flushing output

2020-06-15 Thread Uldis Kalnins via Phabricator via lldb-commits
ukalnins created this revision.
ukalnins added a reviewer: jasonmolenda.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

When process, that debugserver is attached to, exits, there is a race condition
if the process STDIO will be consumed and appened to internal stdio buffer 
before
debugserver flushes the stdio buffer for the last time and sends process exit 
status to lldb.

This patch adds the ability to signal the stdio thread to stop and wait for it 
to finish and
uses this to wait for the thread to finish before flushing output for the last 
time.

This is a potential patch for https://bugs.llvm.org/show_bug.cgi?id=45454

To reliably reproduce the problem I added usleep(1000) in 
MachProcess::STDIOThread before calls to AppendSTDOUT.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81838

Files:
  lldb/tools/debugserver/source/DNB.cpp
  lldb/tools/debugserver/source/DNB.h
  lldb/tools/debugserver/source/MacOSX/MachProcess.h
  lldb/tools/debugserver/source/MacOSX/MachProcess.mm
  lldb/tools/debugserver/source/debugserver.cpp

Index: lldb/tools/debugserver/source/debugserver.cpp
===
--- lldb/tools/debugserver/source/debugserver.cpp
+++ lldb/tools/debugserver/source/debugserver.cpp
@@ -533,6 +533,13 @@
  ctx.EventsAsString(set_events, set_events_str));
 
 if (set_events) {
+
+  if (set_events & RNBContext::event_proc_thread_exiting &&
+  remote->Context().HasValidProcessID()) {
+// Make sure we have all the STDIO read from the process before
+// flushing.
+DNBStopSTDIOThread(remote->Context().ProcessID());
+  }
   if ((set_events & RNBContext::event_proc_thread_exiting) ||
   (set_events & RNBContext::event_proc_stdio_available)) {
 remote->FlushSTDIO();
Index: lldb/tools/debugserver/source/MacOSX/MachProcess.mm
===
--- lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+++ lldb/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -1298,15 +1298,29 @@
 pthread_join(m_profile_thread, NULL);
 m_profile_thread = NULL;
   }
+  StopSTDIOThread();
 }
 
 bool MachProcess::StartSTDIOThread() {
   DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s ( )", __FUNCTION__);
+  if (pipe(m_stdio_thread_interrupt) == -1) {
+return false;
+  }
   // Create the thread that watches for the child STDIO
   return ::pthread_create(&m_stdio_thread, NULL, MachProcess::STDIOThread,
   this) == 0;
 }
 
+void MachProcess::StopSTDIOThread() {
+  if (m_stdio_thread) {
+::write(m_stdio_thread_interrupt[1], "", 1);
+pthread_join(m_stdio_thread, nullptr);
+m_stdio_thread = 0;
+close(m_stdio_thread_interrupt[0]);
+close(m_stdio_thread_interrupt[1]);
+  }
+}
+
 void MachProcess::SetEnableAsyncProfiling(bool enable, uint64_t interval_usec,
   DNBProfileDataScanType scan_type) {
   m_profile_enabled = enable;
@@ -2362,6 +2376,8 @@
   DNBError err;
   int stdout_fd = proc->GetStdoutFileDescriptor();
   int stderr_fd = proc->GetStderrFileDescriptor();
+  int interrupt_fd = proc->GetStdoutThreadInterruptFileDescriptor();
+
   if (stdout_fd == stderr_fd)
 stderr_fd = -1;
 
@@ -2374,7 +2390,10 @@
   FD_SET(stdout_fd, &read_fds);
 if (stderr_fd >= 0)
   FD_SET(stderr_fd, &read_fds);
-int nfds = std::max(stdout_fd, stderr_fd) + 1;
+
+FD_SET(interrupt_fd, &read_fds);
+
+int nfds = std::max({stdout_fd, stderr_fd, interrupt_fd}) + 1;
 
 int num_set_fds = select(nfds, &read_fds, NULL, NULL, NULL);
 DNBLogThreadedIf(LOG_PROCESS,
@@ -2452,6 +2471,9 @@
 
 } while (bytes_read > 0);
   }
+  if (FD_ISSET(interrupt_fd, &read_fds)) {
+break;
+  }
 }
   }
   DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (%p): thread exiting...",
Index: lldb/tools/debugserver/source/MacOSX/MachProcess.h
===
--- lldb/tools/debugserver/source/MacOSX/MachProcess.h
+++ lldb/tools/debugserver/source/MacOSX/MachProcess.h
@@ -187,6 +187,7 @@
 
   // Exception thread functions
   bool StartSTDIOThread();
+  void StopSTDIOThread();
   static void *STDIOThread(void *arg);
   void ExceptionMessageReceived(const MachException::Message &exceptionMessage);
   task_t ExceptionMessageBundleComplete();
@@ -299,6 +300,9 @@
   int GetStdinFileDescriptor() const { return m_child_stdin; }
   int GetStdoutFileDescriptor() const { return m_child_stdout; }
   int GetStderrFileDescriptor() const { return m_child_stderr; }
+  int GetStdoutThreadInterruptFileDescriptor() const {
+return m_stdio_thread_interrupt[0];
+  }
   void AppendSTDOUT(char *s, size_t len);
   size_t GetAvailableSTDOUT(char *buf, size_t buf_size);
   size_t GetAvailableSTDERR(char *buf, size_t buf_size);
@@ -361,6 +365,9 @@
   uint32_t m_stop_count; // A count 

[Lldb-commits] [PATCH] D81783: [lldb] Remove indentation before help output.

2020-06-15 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

LGTM


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81783/new/

https://reviews.llvm.org/D81783



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81838: [debugserver] wait for STDIO thread to finish before flushing output

2020-06-15 Thread Uldis Kalnins via Phabricator via lldb-commits
ukalnins updated this revision to Diff 270732.
ukalnins added a comment.

Fixed merge conflict.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81838/new/

https://reviews.llvm.org/D81838

Files:
  lldb/tools/debugserver/source/DNB.cpp
  lldb/tools/debugserver/source/DNB.h
  lldb/tools/debugserver/source/MacOSX/MachProcess.h
  lldb/tools/debugserver/source/MacOSX/MachProcess.mm
  lldb/tools/debugserver/source/debugserver.cpp

Index: lldb/tools/debugserver/source/debugserver.cpp
===
--- lldb/tools/debugserver/source/debugserver.cpp
+++ lldb/tools/debugserver/source/debugserver.cpp
@@ -533,6 +533,13 @@
  ctx.EventsAsString(set_events, set_events_str));
 
 if (set_events) {
+
+  if (set_events & RNBContext::event_proc_thread_exiting &&
+  remote->Context().HasValidProcessID()) {
+// Make sure we have all the STDIO read from the process before
+// flushing.
+DNBStopSTDIOThread(remote->Context().ProcessID());
+  }
   if ((set_events & RNBContext::event_proc_thread_exiting) ||
   (set_events & RNBContext::event_proc_stdio_available)) {
 remote->FlushSTDIO();
Index: lldb/tools/debugserver/source/MacOSX/MachProcess.mm
===
--- lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+++ lldb/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -1316,15 +1316,29 @@
   }
   m_activities.Clear();
   StopProfileThread();
+  StopSTDIOThread();
 }
 
 bool MachProcess::StartSTDIOThread() {
   DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s ( )", __FUNCTION__);
+  if (pipe(m_stdio_thread_interrupt) == -1) {
+return false;
+  }
   // Create the thread that watches for the child STDIO
   return ::pthread_create(&m_stdio_thread, NULL, MachProcess::STDIOThread,
   this) == 0;
 }
 
+void MachProcess::StopSTDIOThread() {
+  if (m_stdio_thread) {
+::write(m_stdio_thread_interrupt[1], "", 1);
+pthread_join(m_stdio_thread, nullptr);
+m_stdio_thread = 0;
+close(m_stdio_thread_interrupt[0]);
+close(m_stdio_thread_interrupt[1]);
+  }
+}
+
 void MachProcess::SetEnableAsyncProfiling(bool enable, uint64_t interval_usec,
   DNBProfileDataScanType scan_type) {
   m_profile_enabled = enable;
@@ -2388,6 +2402,8 @@
   DNBError err;
   int stdout_fd = proc->GetStdoutFileDescriptor();
   int stderr_fd = proc->GetStderrFileDescriptor();
+  int interrupt_fd = proc->GetStdoutThreadInterruptFileDescriptor();
+
   if (stdout_fd == stderr_fd)
 stderr_fd = -1;
 
@@ -2400,7 +2416,10 @@
   FD_SET(stdout_fd, &read_fds);
 if (stderr_fd >= 0)
   FD_SET(stderr_fd, &read_fds);
-int nfds = std::max(stdout_fd, stderr_fd) + 1;
+
+FD_SET(interrupt_fd, &read_fds);
+
+int nfds = std::max({stdout_fd, stderr_fd, interrupt_fd}) + 1;
 
 int num_set_fds = select(nfds, &read_fds, NULL, NULL, NULL);
 DNBLogThreadedIf(LOG_PROCESS,
@@ -2478,6 +2497,9 @@
 
 } while (bytes_read > 0);
   }
+  if (FD_ISSET(interrupt_fd, &read_fds)) {
+break;
+  }
 }
   }
   DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (%p): thread exiting...",
Index: lldb/tools/debugserver/source/MacOSX/MachProcess.h
===
--- lldb/tools/debugserver/source/MacOSX/MachProcess.h
+++ lldb/tools/debugserver/source/MacOSX/MachProcess.h
@@ -187,6 +187,7 @@
 
   // Exception thread functions
   bool StartSTDIOThread();
+  void StopSTDIOThread();
   static void *STDIOThread(void *arg);
   void ExceptionMessageReceived(const MachException::Message &exceptionMessage);
   task_t ExceptionMessageBundleComplete();
@@ -299,6 +300,9 @@
   int GetStdinFileDescriptor() const { return m_child_stdin; }
   int GetStdoutFileDescriptor() const { return m_child_stdout; }
   int GetStderrFileDescriptor() const { return m_child_stderr; }
+  int GetStdoutThreadInterruptFileDescriptor() const {
+return m_stdio_thread_interrupt[0];
+  }
   void AppendSTDOUT(char *s, size_t len);
   size_t GetAvailableSTDOUT(char *buf, size_t buf_size);
   size_t GetAvailableSTDERR(char *buf, size_t buf_size);
@@ -368,6 +372,9 @@
   uint32_t m_stop_count; // A count of many times have we stopped
   pthread_t m_stdio_thread;   // Thread ID for the thread that watches for child
   // process stdio
+  int m_stdio_thread_interrupt[2]; // File descriptor pair to notify STDIO
+   // thread that it should stop waiting for
+   // input and finish.
   PThreadMutex m_stdio_mutex; // Multithreaded protection for stdio
   std::string m_stdout_data;
 
Index: lldb/tools/debugserver/source/DNB.h
===
--- lldb/tools/debugserver/source/DNB.h
+++ lldb/tools/debugserver/source/DNB.h
@@ -235,4 +2

[Lldb-commits] [PATCH] D74136: [LLDB] WIP: Follow DW_AT_decl_file when setting breakpoint

2020-06-15 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk marked an inline comment as done.
kwk added inline comments.



Comment at: lldb/source/Core/SearchFilter.cpp:732
+FileSpec cu_spec;
+if (sym_ctx.comp_unit) {
+  cu_spec = sym_ctx.comp_unit->GetPrimaryFile();

jankratochvil wrote:
> This condition is always `true` as there is already above:
> ```
> if (!sym_ctx.comp_unit)
> ```
> 
That' incorrect. Only if the nested `if (m_support_file_list.GetSize() != 0)` 
is `false`, then `sym_ctx.comp_unit` is potentially `true`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74136/new/

https://reviews.llvm.org/D74136



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D74136: [LLDB] WIP: Follow DW_AT_decl_file when setting breakpoint

2020-06-15 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil marked an inline comment as done.
jankratochvil added inline comments.



Comment at: lldb/source/Core/SearchFilter.cpp:732
+FileSpec cu_spec;
+if (sym_ctx.comp_unit) {
+  cu_spec = sym_ctx.comp_unit->GetPrimaryFile();

kwk wrote:
> jankratochvil wrote:
> > This condition is always `true` as there is already above:
> > ```
> > if (!sym_ctx.comp_unit)
> > ```
> > 
> That' incorrect. Only if the nested `if (m_support_file_list.GetSize() != 0)` 
> is `false`, then `sym_ctx.comp_unit` is potentially `true`.
OK, I agree, my comment was a mistake.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74136/new/

https://reviews.llvm.org/D74136



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] d743236 - [lldb] Remove indentation before help output.

2020-06-15 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-06-15T09:27:17-07:00
New Revision: d74323606d9c618a2a7c269b9ba3ffefa660cdc2

URL: 
https://github.com/llvm/llvm-project/commit/d74323606d9c618a2a7c269b9ba3ffefa660cdc2
DIFF: 
https://github.com/llvm/llvm-project/commit/d74323606d9c618a2a7c269b9ba3ffefa660cdc2.diff

LOG: [lldb] Remove indentation before help output.

This patch remove the indentation before the command help output.
Supposedly it was meant to be aligned with the different subcommands.

Differential revision: https://reviews.llvm.org/D81783

Added: 


Modified: 
lldb/source/Interpreter/CommandObject.cpp

Removed: 




diff  --git a/lldb/source/Interpreter/CommandObject.cpp 
b/lldb/source/Interpreter/CommandObject.cpp
index 64a46e3f14f0..538f7a1ba693 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -849,12 +849,11 @@ void CommandObject::GenerateHelpText(CommandReturnObject 
&result) {
 
 void CommandObject::GenerateHelpText(Stream &output_strm) {
   CommandInterpreter &interpreter = GetCommandInterpreter();
+  std::string help_text(GetHelp());
   if (WantsRawCommandString()) {
-std::string help_text(GetHelp());
 help_text.append("  Expects 'raw' input (see 'help raw-input'.)");
-interpreter.OutputFormattedHelpText(output_strm, "", "", help_text, 1);
-  } else
-interpreter.OutputFormattedHelpText(output_strm, "", "", GetHelp(), 1);
+  }
+  interpreter.OutputFormattedHelpText(output_strm, "", help_text);
   output_strm << "\nSyntax: " << GetSyntax() << "\n";
   Options *options = GetOptions();
   if (options != nullptr) {



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81783: [lldb] Remove indentation before help output.

2020-06-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd74323606d9c: [lldb] Remove indentation before help output. 
(authored by JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81783/new/

https://reviews.llvm.org/D81783

Files:
  lldb/source/Interpreter/CommandObject.cpp


Index: lldb/source/Interpreter/CommandObject.cpp
===
--- lldb/source/Interpreter/CommandObject.cpp
+++ lldb/source/Interpreter/CommandObject.cpp
@@ -849,12 +849,11 @@
 
 void CommandObject::GenerateHelpText(Stream &output_strm) {
   CommandInterpreter &interpreter = GetCommandInterpreter();
+  std::string help_text(GetHelp());
   if (WantsRawCommandString()) {
-std::string help_text(GetHelp());
 help_text.append("  Expects 'raw' input (see 'help raw-input'.)");
-interpreter.OutputFormattedHelpText(output_strm, "", "", help_text, 1);
-  } else
-interpreter.OutputFormattedHelpText(output_strm, "", "", GetHelp(), 1);
+  }
+  interpreter.OutputFormattedHelpText(output_strm, "", help_text);
   output_strm << "\nSyntax: " << GetSyntax() << "\n";
   Options *options = GetOptions();
   if (options != nullptr) {


Index: lldb/source/Interpreter/CommandObject.cpp
===
--- lldb/source/Interpreter/CommandObject.cpp
+++ lldb/source/Interpreter/CommandObject.cpp
@@ -849,12 +849,11 @@
 
 void CommandObject::GenerateHelpText(Stream &output_strm) {
   CommandInterpreter &interpreter = GetCommandInterpreter();
+  std::string help_text(GetHelp());
   if (WantsRawCommandString()) {
-std::string help_text(GetHelp());
 help_text.append("  Expects 'raw' input (see 'help raw-input'.)");
-interpreter.OutputFormattedHelpText(output_strm, "", "", help_text, 1);
-  } else
-interpreter.OutputFormattedHelpText(output_strm, "", "", GetHelp(), 1);
+  }
+  interpreter.OutputFormattedHelpText(output_strm, "", help_text);
   output_strm << "\nSyntax: " << GetSyntax() << "\n";
   Options *options = GetOptions();
   if (options != nullptr) {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81200: [vscode] set default values for terminateDebuggee for the disconnect request

2020-06-15 Thread walter erquinigo via Phabricator via lldb-commits
wallace updated this revision to Diff 270804.
wallace edited the summary of this revision.
wallace removed a reviewer: kusmour.
wallace added a comment.

The tests were weird indeed, I think I had to revisit them after making some 
changes.
Anyway, I've updated the tests and they do make sense now. They test if the 
inferior performs some side effect after
it's disconnected.

Besides, I added the stopOnEntry attribute in the package.json and in the 
python attach code, as it should have been there since the beginning. The c++ 
code
was expecting it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81200/new/

https://reviews.llvm.org/D81200

Files:
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
  lldb/test/API/tools/lldb-vscode/disconnect/Makefile
  lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
  lldb/test/API/tools/lldb-vscode/disconnect/main.cpp
  lldb/tools/lldb-vscode/VSCode.cpp
  lldb/tools/lldb-vscode/VSCode.h
  lldb/tools/lldb-vscode/lldb-vscode.cpp
  lldb/tools/lldb-vscode/package.json

Index: lldb/tools/lldb-vscode/package.json
===
--- lldb/tools/lldb-vscode/package.json
+++ lldb/tools/lldb-vscode/package.json
@@ -162,6 +162,11 @@
 	},
 	"attach": {
 		"properties": {
+			"stopOnEntry": {
+"type": "boolean",
+"description": "Automatically stop upon attach.",
+"default": true
+			},
 			"program": {
 "type": "string",
 "description": "Path to the program to attach to."
Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -514,6 +514,7 @@
 //   }]
 // }
 void request_attach(const llvm::json::Object &request) {
+  g_vsc.is_attach = true;
   llvm::json::Object response;
   lldb::SBError error;
   FillResponse(request, response);
@@ -769,7 +770,9 @@
   FillResponse(request, response);
   auto arguments = request.getObject("arguments");
 
-  bool terminateDebuggee = GetBoolean(arguments, "terminateDebuggee", false);
+  bool defaultTerminateDebuggee = g_vsc.is_attach ? false : true;
+  bool terminateDebuggee =
+  GetBoolean(arguments, "terminateDebuggee", defaultTerminateDebuggee);
   lldb::SBProcess process = g_vsc.target.GetProcess();
   auto state = process.GetState();
 
@@ -788,10 +791,9 @@
   case lldb::eStateStopped:
   case lldb::eStateRunning:
 g_vsc.debugger.SetAsync(false);
-if (terminateDebuggee)
-  process.Kill();
-else
-  process.Detach();
+lldb::SBError error = terminateDebuggee ? process.Kill() : process.Detach();
+if (!error.Success())
+  response.try_emplace("error", error.GetCString());
 g_vsc.debugger.SetAsync(true);
 break;
   }
@@ -1357,6 +1359,7 @@
 //   }]
 // }
 void request_launch(const llvm::json::Object &request) {
+  g_vsc.is_attach = false;
   llvm::json::Object response;
   lldb::SBError error;
   FillResponse(request, response);
Index: lldb/tools/lldb-vscode/VSCode.h
===
--- lldb/tools/lldb-vscode/VSCode.h
+++ lldb/tools/lldb-vscode/VSCode.h
@@ -89,6 +89,7 @@
   lldb::tid_t focus_tid;
   bool sent_terminated_event;
   bool stop_at_entry;
+  bool is_attach;
   // Keep track of the last stop thread index IDs as threads won't go away
   // unless we send a "thread" event to indicate the thread exited.
   llvm::DenseSet thread_ids;
Index: lldb/tools/lldb-vscode/VSCode.cpp
===
--- lldb/tools/lldb-vscode/VSCode.cpp
+++ lldb/tools/lldb-vscode/VSCode.cpp
@@ -38,7 +38,7 @@
{"swift_catch", "Swift Catch", lldb::eLanguageTypeSwift},
{"swift_throw", "Swift Throw", lldb::eLanguageTypeSwift}}),
   focus_tid(LLDB_INVALID_THREAD_ID), sent_terminated_event(false),
-  stop_at_entry(false) {
+  stop_at_entry(false), is_attach(false) {
   const char *log_file_path = getenv("LLDBVSCODE_LOG");
 #if defined(_WIN32)
 // Windows opens stdout and stdin in text mode which converts \n to 13,10
Index: lldb/test/API/tools/lldb-vscode/disconnect/main.cpp
===
--- /dev/null
+++ lldb/test/API/tools/lldb-vscode/disconnect/main.cpp
@@ -0,0 +1,33 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+
+volatile bool wait_for_attach = true;
+
+void handle_attach(char *sync_file_path) {
+  lldb_enable_attach();
+
+  {
+// Create a file to signal that this process has started up.
+std::ofstream sync_file;
+sync_file.open(sync_file_path);
+  }
+
+  while (wait_for_attach)
+std::this_thread::sleep_for(std::chrono::milliseconds(10));
+}
+
+int main(int argc, char **args) {
+  if (argc == 2)
+   

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-15 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added inline comments.



Comment at: lldb/source/Core/Debugger.cpp:349
 
+bool Debugger::GetUseAutosuggestion() const {
+  const uint32_t idx = ePropertyShowAutosuggestion;

gedatsu217 wrote:
> teemperor wrote:
> > You declared the function, but you don't use it anywhere. You should move 
> > all the code you added behind `if (GetShowAutosuggestion())` so that it is 
> > only active if the user activated the setting (by doing `settings set 
> > show-autosuggestion true`).
> Sorry, would you tell me more about it?
> I understood that I did not use this function, but I do not know how to 
> validate it.
This function just returns the current setting that the user has set for the 
`show-autosuggestion` setting. So, you want to take that variable and pass it 
to the Editline code and then only activate all the autosuggestion code when 
this setting is on (the bool you get here is true if the setting is active).

The IOHandlerEditline takes a `debugger` variable in the constructor. There you 
can do `debugger.GetUseAutosuggestion()` to get the bool if we should use 
autosuggestions. You need to pass that to the `Editline` constructor  and then 
put all the code in `Editline` behind some `if (m_use_autosuggestions)` or 
something like that.

You can test it by just doing `settings set show-autosuggestion true` (which 
should activate this) and `settings set show-autosuggestion true` (which should 
deactivate this). It's fine if LLDB requires a restart to do activate this 
setting (that's to my knowledge a limitation of the current way the IOHandlers 
work).



Comment at: lldb/source/Host/common/Editline.cpp:1244
+llvm::StringRef indent_chars =
+"abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY1234567890 ";
+for (char c : indent_chars) {

gedatsu217 wrote:
> teemperor wrote:
> > `.-/()[]{};\"'\\!@#$%^&*_` are missing here. Maybe we should just iterate 
> > over all ASCII characters and add all printables except newline or 
> > something like that to the alphabet.
> If I add -, \, and ^, an error occurs because these characters  are probably 
> used in other forms like -a (ll. 1283), \n (ll.1253), and  ^p (ll.1257). Do 
> you know good ways to avoid it?
Actually that's a good point. This feature should never be active in the 
multiline editor (that's used for LLDB's multiline editor, e.g. when you just 
type `expr` and then press enter). So in that case we should never show 
autosuggestions, so you can just disable all of this if `multiline` is true. 
But this also means that the error is not coming from those characters (I guess 
you tested it in the normal LLDB console and not when you are in the multiline 
editor).

I think the actual problem is that some of the characters in that string need 
to be escape (such as `-`). Not sure how to escape them though, but I assume a 
backslash or so should do the trick? I would just try adding them one by one 
and see which one actually breaks editline (and then try adding it with a `\\` 
before).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81001/new/

https://reviews.llvm.org/D81001



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

I tried out the patch and I have a few observations:

- For me the faint modifier doesn't do anything. Of course it might just be my 
shell/theme, but we should check whether this modifier is widely supported. 
Additionally, this modified should be configurable.
- There's no way to confirm the autosuggestion. In fish you can use right-arrow 
or a key to move to the end of the line (END, CTRL-E).
- The interaction between the autocompletion and autosuggestion is rather 
confusing. Fish solves this by showing the autocompletion under the current 
line. I don't we need to take it that far, but at least the the situation 
described below should work.

Text between square brackets is the autosuggestion:

  (lldb) set[tings set show-autosuggestion true] # Press TAB
  (lldb) settings 

I would expect the suggestion to still show up after.

From a performance perspective, would it be possible to not register the 
callback at all when the functionality is disabled? I don't actually know if 
it's worth it, but I imagine that having a callback on every keystroke could be 
costly. The trade-off is dealing with the user changing the setting from the 
existing IOHandler, similar to we have to broadcast an event when the user 
changes the prompt. I'm not saying that's what we should do, just putting the 
idea out there.




Comment at: lldb/source/Core/IOHandler.cpp:444
+   std::string &result, void *baton) {
+  IOHandlerEditline *editline_reader = (IOHandlerEditline *)baton;
+  if (editline_reader)

`static_cast(baton)`



Comment at: lldb/source/Host/common/Editline.cpp:1239
 
+  if (true) {
+char bind_key[2] = {0, 0};

You can just use a lexical block:
```
{ 
  ...
}
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81001/new/

https://reviews.llvm.org/D81001



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81810: LLDB step-instruction gets stuck on jump to self

2020-06-15 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

Just to be clear, the lldb -> gdb command map doesn't prescribe behavior for 
lldb commands.  It just suggests the analogous command in gdb.  We are still 
free to implement lldb behavior however seems best to us.

The logic in lldb doesn't change the logic of the program's execution.  This is 
just about when we return control to the user.

I can't 100% remember why I checked that the pc changed originally - it has 
been this way forever...  But I think I was worried that you would do a stepi 
and another thread would make progress but this thread wouldn't and then we'd 
call the stepi completed.  That would be confusing, since you would look to see 
the effects of the instruction we told you got to run, and they wouldn't be 
there...

However, the code that queries for stop reasons is pretty careful to avoid 
asking questions of threads that didn't stop "for a reason".  So, what actually 
happens nowadays is that we would note that we hadn't gotten the "trace" stop 
state for this thread, not consult the thread's plan stack at all, and so we 
wouldn't end up misreporting the stop reason.  So I don't think that's a real 
concern.

On the grounds that it is always better, when in doubt, to return control to 
the user & let them figure out what to do that to keep going on, I'm fine with 
the changed behavior.

If you want to keep this behavior from changing over time, however, you 
probably want to write a test for it.  I don't think you can count on `while 
{}` always having a jump back to itself.  But you could write an inline asm 
test that inserts this instruction and make sure that stops after the stepi.  
That would be architecture specific, but I don't see another way to get this 
behavior in a way that you can test for it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81810/new/

https://reviews.llvm.org/D81810



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81589: [lldb/SymbolFile] Don't parse the whole line table for the support files

2020-06-15 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

Hey Jonas, any idea if this could be cherry picked into a 11.5.1 update at any 
point? The performance is hindering 11.4.1 and 11.5 clients at Facebook.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81589/new/

https://reviews.llvm.org/D81589



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 64ec505 - [lldb] Rename Master/Slave to Primary/Secondary (NFC)

2020-06-15 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-06-15T15:38:28-07:00
New Revision: 64ec505dd46832880350e8b45316eaed30b458dc

URL: 
https://github.com/llvm/llvm-project/commit/64ec505dd46832880350e8b45316eaed30b458dc
DIFF: 
https://github.com/llvm/llvm-project/commit/64ec505dd46832880350e8b45316eaed30b458dc.diff

LOG: [lldb] Rename Master/Slave to Primary/Secondary (NFC)

Added: 


Modified: 
lldb/include/lldb/Host/PseudoTerminal.h
lldb/include/lldb/Interpreter/ScriptInterpreter.h
lldb/source/Host/common/ProcessLaunchInfo.cpp
lldb/source/Host/common/PseudoTerminal.cpp
lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp

lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm
lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
lldb/source/Target/Platform.cpp
lldb/unittests/Editline/EditlineTest.cpp
lldb/unittests/Host/MainLoopTest.cpp

Removed: 




diff  --git a/lldb/include/lldb/Host/PseudoTerminal.h 
b/lldb/include/lldb/Host/PseudoTerminal.h
index f3cdf53ab815..8a5a233e7748 100644
--- a/lldb/include/lldb/Host/PseudoTerminal.h
+++ b/lldb/include/lldb/Host/PseudoTerminal.h
@@ -29,36 +29,37 @@ class PseudoTerminal {
 
   /// Default constructor
   ///
-  /// Constructs this object with invalid master and slave file descriptors.
+  /// Constructs this object with invalid primary and secondary file
+  /// descriptors.
   PseudoTerminal();
 
   /// Destructor
   ///
-  /// The destructor will close the master and slave file descriptors if they
-  /// are valid and ownership has not been released using one of: @li
-  /// PseudoTerminal::ReleaseMasterFileDescriptor() @li
+  /// The destructor will close the primary and secondary file descriptors if
+  /// they are valid and ownership has not been released using one of: @li
+  /// PseudoTerminal::ReleasePrimaryFileDescriptor() @li
   /// PseudoTerminal::ReleaseSaveFileDescriptor()
   ~PseudoTerminal();
 
-  /// Close the master file descriptor if it is valid.
-  void CloseMasterFileDescriptor();
+  /// Close the primary file descriptor if it is valid.
+  void ClosePrimaryFileDescriptor();
 
-  /// Close the slave file descriptor if it is valid.
-  void CloseSlaveFileDescriptor();
+  /// Close the secondary file descriptor if it is valid.
+  void CloseSecondaryFileDescriptor();
 
   /// Fork a child process that uses pseudo terminals for its stdio.
   ///
   /// In the parent process, a call to this function results in a pid being
-  /// returned. If the pid is valid, the master file descriptor can be used
+  /// returned. If the pid is valid, the primary file descriptor can be used
   /// for read/write access to stdio of the child process.
   ///
   /// In the child process the stdin/stdout/stderr will already be routed to
-  /// the slave pseudo terminal and the master file descriptor will be closed
-  /// as it is no longer needed by the child process.
+  /// the secondary pseudo terminal and the primary file descriptor will be
+  /// closed as it is no longer needed by the child process.
   ///
-  /// This class will close the file descriptors for the master/slave when the
-  /// destructor is called. The file handles can be released using either: @li
-  /// PseudoTerminal::ReleaseMasterFileDescriptor() @li
+  /// This class will close the file descriptors for the primary/secondary when
+  /// the destructor is called. The file handles can be released using either:
+  /// @li PseudoTerminal::ReleasePrimaryFileDescriptor() @li
   /// PseudoTerminal::ReleaseSaveFileDescriptor()
   ///
   /// \param[out] error_str
@@ -71,37 +72,37 @@ class PseudoTerminal {
   /// \b Child process: zero.
   lldb::pid_t Fork(char *error_str, size_t error_len);
 
-  /// The master file descriptor accessor.
+  /// The primary file descriptor accessor.
   ///
-  /// This object retains ownership of the master file descriptor when this
+  /// This object retains ownership of the primary file descriptor when this
   /// accessor is used. Users can call the member function
-  /// PseudoTerminal::ReleaseMasterFileDescriptor() if this object should
-  /// release ownership of the slave file descriptor.
+  /// PseudoTerminal::ReleasePrimaryFileDescriptor() if this object should
+  /

[Lldb-commits] [lldb] 480a383 - Upstream two performance monitor collectors to MachTask

2020-06-15 Thread Jason Molenda via lldb-commits

Author: Jason Molenda
Date: 2020-06-15T16:37:56-07:00
New Revision: 480a383551e96d9f6fb0ddcdcc9d893faf37e5b3

URL: 
https://github.com/llvm/llvm-project/commit/480a383551e96d9f6fb0ddcdcc9d893faf37e5b3
DIFF: 
https://github.com/llvm/llvm-project/commit/480a383551e96d9f6fb0ddcdcc9d893faf37e5b3.diff

LOG: Upstream two performance monitor collectors to MachTask

Add two more perf monitors to MachTask::GetProfileData.



Added: 


Modified: 
lldb/tools/debugserver/source/MacOSX/MachTask.mm

Removed: 




diff  --git a/lldb/tools/debugserver/source/MacOSX/MachTask.mm 
b/lldb/tools/debugserver/source/MacOSX/MachTask.mm
index 5d18c5628c63..fcbe6e71389e 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachTask.mm
+++ b/lldb/tools/debugserver/source/MacOSX/MachTask.mm
@@ -64,6 +64,10 @@
 #include 
 #endif
 
+extern "C" int
+proc_get_cpumon_params(pid_t pid, int *percentage,
+   int *interval); //  SPI
+
 //--
 // MachTask constructor
 //--
@@ -470,6 +474,16 @@ static void 
get_threads_profile_data(DNBProfileDataScanType scanType,
 }
 #endif
 
+if (scanType & eProfileEnergyCPUCap) {
+  int percentage = -1;
+  int interval = -1;
+  int result = proc_get_cpumon_params(pid, &percentage, &interval);
+  if ((result == 0) && (percentage >= 0) && (interval >= 0)) {
+profile_data_stream << "cpu_cap_p:" << percentage << ';';
+profile_data_stream << "cpu_cap_t:" << interval << ';';
+  }
+}
+
 profile_data_stream << "--end--;";
 
 result = profile_data_stream.str();



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81898: [lldb/Python] Fix the infinitely looping prompt bug

2020-06-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: labath, teemperor.
JDevlieghere updated this revision to Diff 270924.
JDevlieghere added a comment.

Add test


This bug has been bothering me for a while. When you do something like the 
commands below, you'd get bombarded by a wall of Python command prompts (`>>> 
`).

  $ echo 'foo' | ./bin/lldb -o script



  $ cat /tmp/script
  script
  print("foo")
  $ lldb --source /tmp/script

The issue is that our custom input reader doesn't handle EOF. According to the 
Python documentation, `file.readline` always includes a trailing newline 
character unless the file ends with an incomplete line. Therefore, checking for 
the empty string before stripping it tells us if we've read EOF.

[1] https://docs.python.org/2/library/stdtypes.html#file.readline


https://reviews.llvm.org/D81898

Files:
  lldb/source/Interpreter/embedded_interpreter.py
  lldb/test/Shell/ScriptInterpreter/Python/eof.test


Index: lldb/test/Shell/ScriptInterpreter/Python/eof.test
===
--- /dev/null
+++ lldb/test/Shell/ScriptInterpreter/Python/eof.test
@@ -0,0 +1,4 @@
+RUN: echo 'foo' | %lldb -o script | FileCheck %s
+
+CHECK: >>>
+CHECK-NOT: >>>
Index: lldb/source/Interpreter/embedded_interpreter.py
===
--- lldb/source/Interpreter/embedded_interpreter.py
+++ lldb/source/Interpreter/embedded_interpreter.py
@@ -73,7 +73,10 @@
 def readfunc_stdio(prompt):
 sys.stdout.write(prompt)
 sys.stdout.flush()
-return sys.stdin.readline().rstrip()
+line = sys.stdin.readline()
+if not line:
+raise EOFError
+return line.rstrip()
 
 
 def run_python_interpreter(local_dict):


Index: lldb/test/Shell/ScriptInterpreter/Python/eof.test
===
--- /dev/null
+++ lldb/test/Shell/ScriptInterpreter/Python/eof.test
@@ -0,0 +1,4 @@
+RUN: echo 'foo' | %lldb -o script | FileCheck %s
+
+CHECK: >>>
+CHECK-NOT: >>>
Index: lldb/source/Interpreter/embedded_interpreter.py
===
--- lldb/source/Interpreter/embedded_interpreter.py
+++ lldb/source/Interpreter/embedded_interpreter.py
@@ -73,7 +73,10 @@
 def readfunc_stdio(prompt):
 sys.stdout.write(prompt)
 sys.stdout.flush()
-return sys.stdin.readline().rstrip()
+line = sys.stdin.readline()
+if not line:
+raise EOFError
+return line.rstrip()
 
 
 def run_python_interpreter(local_dict):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D81898: [lldb/Python] Fix the infinitely looping prompt bug

2020-06-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 270924.
JDevlieghere added a comment.

Add test


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81898/new/

https://reviews.llvm.org/D81898

Files:
  lldb/source/Interpreter/embedded_interpreter.py
  lldb/test/Shell/ScriptInterpreter/Python/eof.test


Index: lldb/test/Shell/ScriptInterpreter/Python/eof.test
===
--- /dev/null
+++ lldb/test/Shell/ScriptInterpreter/Python/eof.test
@@ -0,0 +1,4 @@
+RUN: echo 'foo' | %lldb -o script | FileCheck %s
+
+CHECK: >>>
+CHECK-NOT: >>>
Index: lldb/source/Interpreter/embedded_interpreter.py
===
--- lldb/source/Interpreter/embedded_interpreter.py
+++ lldb/source/Interpreter/embedded_interpreter.py
@@ -73,7 +73,10 @@
 def readfunc_stdio(prompt):
 sys.stdout.write(prompt)
 sys.stdout.flush()
-return sys.stdin.readline().rstrip()
+line = sys.stdin.readline()
+if not line:
+raise EOFError
+return line.rstrip()
 
 
 def run_python_interpreter(local_dict):


Index: lldb/test/Shell/ScriptInterpreter/Python/eof.test
===
--- /dev/null
+++ lldb/test/Shell/ScriptInterpreter/Python/eof.test
@@ -0,0 +1,4 @@
+RUN: echo 'foo' | %lldb -o script | FileCheck %s
+
+CHECK: >>>
+CHECK-NOT: >>>
Index: lldb/source/Interpreter/embedded_interpreter.py
===
--- lldb/source/Interpreter/embedded_interpreter.py
+++ lldb/source/Interpreter/embedded_interpreter.py
@@ -73,7 +73,10 @@
 def readfunc_stdio(prompt):
 sys.stdout.write(prompt)
 sys.stdout.flush()
-return sys.stdin.readline().rstrip()
+line = sys.stdin.readline()
+if not line:
+raise EOFError
+return line.rstrip()
 
 
 def run_python_interpreter(local_dict):
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 0965b59 - [lldb/debugserver] Rename Master/Slave to Primary/Secondary (NFC)

2020-06-15 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-06-15T18:22:22-07:00
New Revision: 0965b59bf429630e6eafe725cc3444095ba0c222

URL: 
https://github.com/llvm/llvm-project/commit/0965b59bf429630e6eafe725cc3444095ba0c222
DIFF: 
https://github.com/llvm/llvm-project/commit/0965b59bf429630e6eafe725cc3444095ba0c222.diff

LOG: [lldb/debugserver] Rename Master/Slave to Primary/Secondary (NFC)

Added: 


Modified: 
lldb/tools/debugserver/source/ChangeLog
lldb/tools/debugserver/source/MacOSX/MachProcess.mm
lldb/tools/debugserver/source/PseudoTerminal.cpp
lldb/tools/debugserver/source/PseudoTerminal.h

Removed: 




diff  --git a/lldb/tools/debugserver/source/ChangeLog 
b/lldb/tools/debugserver/source/ChangeLog
index 06da01849e21..a969e3e24296 100644
--- a/lldb/tools/debugserver/source/ChangeLog
+++ b/lldb/tools/debugserver/source/ChangeLog
@@ -1154,7 +1154,7 @@
 2008-02-14  Jason Molenda  (jmole...@apple.com)
 
* MachProcess.cpp: (MachProcess::SBForkChildForPTraceDebugging):
-   Set mode bits on slave side of pty.
+   Set mode bits on secondary side of pty.
 
 2008-02-12  Greg Clayton  
 

diff  --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm 
b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
index 95060c552f25..74d20be42e31 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -3255,9 +3255,9 @@ static bool IsMacOSHost() {
   if (file_actions_valid) {
 if (stdin_path == NULL && stdout_path == NULL && stderr_path == NULL &&
 !no_stdio) {
-  pty_error = pty.OpenFirstAvailableMaster(O_RDWR | O_NOCTTY);
+  pty_error = pty.OpenFirstAvailablePrimary(O_RDWR | O_NOCTTY);
   if (pty_error == PseudoTerminal::success) {
-stdin_path = stdout_path = stderr_path = pty.SlaveName();
+stdin_path = stdout_path = stderr_path = pty.SecondaryName();
   }
 }
 
@@ -3332,8 +3332,8 @@ static bool IsMacOSHost() {
 
   if (pty_error == 0) {
 if (process != NULL) {
-  int master_fd = pty.ReleaseMasterFD();
-  process->SetChildFileDescriptors(master_fd, master_fd, master_fd);
+  int primary_fd = pty.ReleasePrimaryFD();
+  process->SetChildFileDescriptors(primary_fd, primary_fd, primary_fd);
 }
   }
   ::posix_spawnattr_destroy(&attr);
@@ -3430,10 +3430,10 @@ static bool IsMacOSHost() {
 ::setpgid(pid, pid); // Set the child process group to match its pid
 
 if (process != NULL) {
-  // Release our master pty file descriptor so the pty class doesn't
+  // Release our primary pty file descriptor so the pty class doesn't
   // close it and so we can continue to use it in our STDIO thread
-  int master_fd = pty.ReleaseMasterFD();
-  process->SetChildFileDescriptors(master_fd, master_fd, master_fd);
+  int primary_fd = pty.ReleasePrimaryFD();
+  process->SetChildFileDescriptors(primary_fd, primary_fd, primary_fd);
 }
   }
   return pid;
@@ -3606,15 +3606,15 @@ static CFStringRef CopyBundleIDForPath(const char 
*app_bundle_path,
   PseudoTerminal pty;
   if (!no_stdio) {
 PseudoTerminal::Status pty_err =
-pty.OpenFirstAvailableMaster(O_RDWR | O_NOCTTY);
+pty.OpenFirstAvailablePrimary(O_RDWR | O_NOCTTY);
 if (pty_err == PseudoTerminal::success) {
-  const char *slave_name = pty.SlaveName();
+  const char *secondary_name = pty.SecondaryName();
   DNBLogThreadedIf(LOG_PROCESS,
-   "%s() successfully opened master pty, slave is %s",
-   __FUNCTION__, slave_name);
-  if (slave_name && slave_name[0]) {
-::chmod(slave_name, S_IRWXU | S_IRWXG | S_IRWXO);
-stdio_path.SetFileSystemRepresentation(slave_name);
+   "%s() successfully opened primary pty, secondary is %s",
+   __FUNCTION__, secondary_name);
+  if (secondary_name && secondary_name[0]) {
+::chmod(secondary_name, S_IRWXU | S_IRWXG | S_IRWXO);
+stdio_path.SetFileSystemRepresentation(secondary_name);
   }
 }
   }
@@ -3671,10 +3671,10 @@ static CFStringRef CopyBundleIDForPath(const char 
*app_bundle_path,
 CFRelease(bundleIDCFStr);
 if (pid_found) {
   if (process != NULL) {
-// Release our master pty file descriptor so the pty class doesn't
+// Release our primary pty file descriptor so the pty class doesn't
 // close it and so we can continue to use it in our STDIO thread
-int master_fd = pty.ReleaseMasterFD();
-process->SetChildFileDescriptors(master_fd, master_fd, master_fd);
+int primary_fd = pty.ReleasePrimaryFD();
+process->SetChildFileDescriptors(primary_fd, primary_fd, primary_fd);
   }
   DNBLogThreadedIf(LOG_PROCESS, "%s() => pid = %4.4x", __FUNCTION__, pid);
 } else {
@@ -3807,17 +3807,17 @@ static CFStringRef CopyBundleIDForPath(const char 
*app_bund

[Lldb-commits] [lldb] 18e356b - [lldb/Docs] Reword paragraph and omit 'build slave'

2020-06-15 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-06-15T18:25:57-07:00
New Revision: 18e356b75d039a23c805c40d1ee2dbb387e40128

URL: 
https://github.com/llvm/llvm-project/commit/18e356b75d039a23c805c40d1ee2dbb387e40128
DIFF: 
https://github.com/llvm/llvm-project/commit/18e356b75d039a23c805c40d1ee2dbb387e40128.diff

LOG: [lldb/Docs] Reword paragraph and omit 'build slave'

Added: 


Modified: 
lldb/docs/resources/bots.rst

Removed: 




diff  --git a/lldb/docs/resources/bots.rst b/lldb/docs/resources/bots.rst
index f8e7a4d8b9ba..efe8c7116b01 100644
--- a/lldb/docs/resources/bots.rst
+++ b/lldb/docs/resources/bots.rst
@@ -4,10 +4,8 @@ Continuous Integration
 Buildbot
 
 
-LLVM Buildbot is the place where Volunteers provide build machines to work as
-build slaves. Everyone can `add a buildbot for LLDB
-`_.
-
+LLVM Buildbot is the place where volunteers provide build machines. Everyone 
can
+`add a buildbot for LLDB `_.
 
 * `lldb-x64-windows-ninja 
`_
 * `lldb-x86_64-debian `_



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 8d2acfc - [lldb/Interpreter] Use std::make_shared (NFC)

2020-06-15 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-06-15T20:48:55-07:00
New Revision: 8d2acfc40e3bbfa1e58da21870c61bddc7c9523f

URL: 
https://github.com/llvm/llvm-project/commit/8d2acfc40e3bbfa1e58da21870c61bddc7c9523f
DIFF: 
https://github.com/llvm/llvm-project/commit/8d2acfc40e3bbfa1e58da21870c61bddc7c9523f.diff

LOG: [lldb/Interpreter] Use std::make_shared (NFC)

Added: 


Modified: 
lldb/include/lldb/Interpreter/CommandReturnObject.h

Removed: 




diff  --git a/lldb/include/lldb/Interpreter/CommandReturnObject.h 
b/lldb/include/lldb/Interpreter/CommandReturnObject.h
index 6a3ec83a765f..a7c2eea57663 100644
--- a/lldb/include/lldb/Interpreter/CommandReturnObject.h
+++ b/lldb/include/lldb/Interpreter/CommandReturnObject.h
@@ -46,7 +46,7 @@ class CommandReturnObject {
 // Make sure we at least have our normal string stream output stream
 lldb::StreamSP 
stream_sp(m_out_stream.GetStreamAtIndex(eStreamStringIndex));
 if (!stream_sp) {
-  stream_sp.reset(new StreamString());
+  stream_sp = std::make_shared();
   m_out_stream.SetStreamAtIndex(eStreamStringIndex, stream_sp);
 }
 return m_out_stream;
@@ -56,7 +56,7 @@ class CommandReturnObject {
 // Make sure we at least have our normal string stream output stream
 lldb::StreamSP 
stream_sp(m_err_stream.GetStreamAtIndex(eStreamStringIndex));
 if (!stream_sp) {
-  stream_sp.reset(new StreamString());
+  stream_sp = std::make_shared();
   m_err_stream.SetStreamAtIndex(eStreamStringIndex, stream_sp);
 }
 return m_err_stream;



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 93571c3 - [lldb/Python] Various cleanups in ScriptInterpreterPython (NFC)

2020-06-15 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-06-15T21:07:43-07:00
New Revision: 93571c3c3b2f67c8225861033239706ca950

URL: 
https://github.com/llvm/llvm-project/commit/93571c3c3b2f67c8225861033239706ca950
DIFF: 
https://github.com/llvm/llvm-project/commit/93571c3c3b2f67c8225861033239706ca950.diff

LOG: [lldb/Python] Various cleanups in ScriptInterpreterPython (NFC)

Added: 


Modified: 
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp 
b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 8d275864f495..39f76e7c5bb5 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -1361,8 +1361,8 @@ Status 
ScriptInterpreterPythonImpl::SetBreakpointCommandCallback(
 bp_options->SetCallback(
 ScriptInterpreterPythonImpl::BreakpointCallbackFunction, baton_sp);
 return error;
-  } else
-return error;
+  }
+  return error;
 }
 
 // Set a Python one-liner as the callback for the watchpoint.
@@ -1988,8 +1988,7 @@ lldb::StateType 
ScriptInterpreterPythonImpl::ScriptedThreadPlanGetRunState(
   }
   if (should_step)
 return lldb::eStateStepping;
-  else
-return lldb::eStateRunning;
+  return lldb::eStateRunning;
 }
 
 StructuredData::GenericSP
@@ -2061,8 +2060,7 @@ 
ScriptInterpreterPythonImpl::ScriptedBreakpointResolverSearchDepth(
 
   if (depth_as_int <= lldb::kLastSearchDepthKind)
 return (lldb::SearchDepth)depth_as_int;
-  else
-return lldb::eSearchDepthModule;
+  return lldb::eSearchDepthModule;
 }
 
 StructuredData::ObjectSP
@@ -3029,39 +3027,42 @@ bool ScriptInterpreterPythonImpl::RunScriptBasedCommand(
   return ret_val;
 }
 
-// in Python, a special attribute __doc__ contains the docstring for an object
-// (function, method, class, ...) if any is defined Otherwise, the attribute's
-// value is None
+/// In Python, a special attribute __doc__ contains the docstring for an object
+/// (function, method, class, ...) if any is defined Otherwise, the attribute's
+/// value is None.
 bool ScriptInterpreterPythonImpl::GetDocumentationForItem(const char *item,
   std::string &dest) {
   dest.clear();
+
   if (!item || !*item)
 return false;
+
   std::string command(item);
   command += ".__doc__";
 
-  char *result_ptr = nullptr; // Python is going to point this to valid data if
-  // ExecuteOneLineWithReturn returns successfully
+  // Python is going to point this to valid data if ExecuteOneLineWithReturn
+  // returns successfully.
+  char *result_ptr = nullptr;
 
   if (ExecuteOneLineWithReturn(
-  command.c_str(), ScriptInterpreter::eScriptReturnTypeCharStrOrNone,
+  command, ScriptInterpreter::eScriptReturnTypeCharStrOrNone,
   &result_ptr,
   ScriptInterpreter::ExecuteScriptOptions().SetEnableIO(false))) {
 if (result_ptr)
   dest.assign(result_ptr);
 return true;
-  } else {
-StreamString str_stream;
-str_stream.Printf(
-"Function %s was not found. Containing module might be missing.", 
item);
-dest = std::string(str_stream.GetString());
-return false;
   }
+
+  StreamString str_stream;
+  str_stream << "Function " << item
+ << " was not found. Containing module might be missing.";
+  dest = std::string(str_stream.GetString());
+
+  return false;
 }
 
 bool ScriptInterpreterPythonImpl::GetShortHelpForCommandObject(
 StructuredData::GenericSP cmd_obj_sp, std::string &dest) {
-  bool got_string = false;
   dest.clear();
 
   Locker py_lock(this, Locker::AcquireLock | Locker::NoSTDIN, 
Locker::FreeLock);
@@ -3095,12 +3096,12 @@ bool 
ScriptInterpreterPythonImpl::GetShortHelpForCommandObject(
   if (PyErr_Occurred())
 PyErr_Clear();
 
-  // right now we know this function exists and is callable..
+  // Right now we know this function exists and is callable.
   PythonObject py_return(
   PyRefType::Owned,
   PyObject_CallMethod(implementor.get(), callee_name, nullptr));
 
-  // if it fails, print the error but otherwise go on
+  // If it fails, print the error but otherwise go on.
   if (PyErr_Occurred()) {
 PyErr_Print();
 PyErr_Clear();
@@ -3110,9 +3111,10 @@ bool 
ScriptInterpreterPythonImpl::GetShortHelpForCommandObject(
 PythonString py_string(PyRefType::Borrowed, py_return.get());
 llvm::StringRef return_data(py_string.GetString());
 dest.assign(return_data.data(), return_data.size());
-got_string = true;
+return true;
   }
-  return got_string;
+
+  return false;
 }
 
 uint32_t ScriptInterpreterPythonImpl::GetFlagsForCommandObject(



___
lldb-commits mailing list

[Lldb-commits] [lldb] 5ddd4fc - [lldb/Lua] Fix override/virtual in ScriptInterpreterLua (NFC)

2020-06-15 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-06-15T21:15:35-07:00
New Revision: 5ddd4fc5a65a452dffa2d27ad6a5c04d148d6234

URL: 
https://github.com/llvm/llvm-project/commit/5ddd4fc5a65a452dffa2d27ad6a5c04d148d6234
DIFF: 
https://github.com/llvm/llvm-project/commit/5ddd4fc5a65a452dffa2d27ad6a5c04d148d6234.diff

LOG: [lldb/Lua] Fix override/virtual in ScriptInterpreterLua (NFC)

Added: 


Modified: 
lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h

Removed: 




diff  --git 
a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp 
b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
index f9b24ad83de5..bcb33ae8c376 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
@@ -33,7 +33,7 @@ class IOHandlerLuaInterpreter : public IOHandlerDelegate,
 llvm::cantFail(m_script_interpreter.EnterSession(debugger.GetID()));
   }
 
-  ~IOHandlerLuaInterpreter() {
+  ~IOHandlerLuaInterpreter() override {
 llvm::cantFail(m_script_interpreter.LeaveSession());
   }
 

diff  --git a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h 
b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
index 4e922151385b..bcc6ab24f6d0 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
@@ -25,7 +25,7 @@ class ScriptInterpreterLua : public ScriptInterpreter {
 
   void ExecuteInterpreterLoop() override;
 
-  virtual bool
+  bool
   LoadScriptingModule(const char *filename, bool init_session,
   lldb_private::Status &error,
   StructuredData::ObjectSP *module_sp = nullptr) override;



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 388afd8 - [lldb] Remove redundant access specifiers (NFC)

2020-06-15 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-06-15T21:34:13-07:00
New Revision: 388afd8406a07817b8663281bf3d06f87d46dfd7

URL: 
https://github.com/llvm/llvm-project/commit/388afd8406a07817b8663281bf3d06f87d46dfd7
DIFF: 
https://github.com/llvm/llvm-project/commit/388afd8406a07817b8663281bf3d06f87d46dfd7.diff

LOG: [lldb] Remove redundant access specifiers (NFC)

Added: 


Modified: 
lldb/include/lldb/Core/SearchFilter.h
lldb/include/lldb/Core/ValueObjectChild.h
lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
lldb/include/lldb/DataFormatters/FormatClasses.h
lldb/include/lldb/Host/Editline.h
lldb/include/lldb/Host/MainLoopBase.h
lldb/include/lldb/Symbol/DebugMacros.h
lldb/include/lldb/Symbol/UnwindPlan.h
lldb/include/lldb/Target/Process.h
lldb/include/lldb/Target/Thread.h
lldb/include/lldb/Target/ThreadPlan.h
lldb/include/lldb/Utility/DataEncoder.h
lldb/source/Commands/CommandObjectCommands.cpp
lldb/source/Commands/CommandObjectFrame.cpp
lldb/source/Commands/CommandObjectPlatform.cpp
lldb/source/Commands/CommandObjectProcess.cpp
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h
lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
lldb/source/Plugins/Language/ObjC/CFBasicHash.h

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h
lldb/source/Plugins/Process/minidump/MinidumpParser.h
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h

Removed: 




diff  --git a/lldb/include/lldb/Core/SearchFilter.h 
b/lldb/include/lldb/Core/SearchFilter.h
index 9f56bbe40324..54dc65e4410f 100644
--- a/lldb/include/lldb/Core/SearchFilter.h
+++ b/lldb/include/lldb/Core/SearchFilter.h
@@ -398,7 +398,6 @@ class SearchFilterByModuleList : public SearchFilter {
 protected:
   lldb::SearchFilterSP DoCreateCopy() override;
 
-protected:
   FileSpecList m_module_spec_list;
 };
 

diff  --git a/lldb/include/lldb/Core/ValueObjectChild.h 
b/lldb/include/lldb/Core/ValueObjectChild.h
index d8f395522443..c6f44a29b059 100644
--- a/lldb/include/lldb/Core/ValueObjectChild.h
+++ b/lldb/include/lldb/Core/ValueObjectChild.h
@@ -75,7 +75,6 @@ class ValueObjectChild : public ValueObject {
   //  void
   //  ReadValueFromMemory (ValueObject* parent, lldb::addr_t address);
 
-protected:
   friend class ValueObject;
   friend class ValueObjectConstResult;
   friend class ValueObjectConstResultImpl;

diff  --git a/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h 
b/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
index 8bb3d8613598..2f3bdf80a6f1 100644
--- a/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
+++ b/lldb/include/lldb/DataFormatters/DumpValueObjectOptions.h
@@ -127,7 +127,6 @@ class DumpValueObjectOptions {
   DumpValueObjectOptions &
   SetPointerAsArray(const PointerAsArraySettings &ptr_array);
 
-public:
   uint32_t m_max_depth = UINT32_MAX;
   lldb::DynamicValueType m_use_dynamic = lldb::eNoDynamicValues;
   uint32_t m_omit_summary_depth = 0;

diff  --git a/lldb/include/lldb/DataFormatters/FormatClasses.h 
b/lldb/include/lldb/DataFormatters/FormatClasses.h
index 05886e656cdb..e3989133a602 100644
--- a/lldb/include/lldb/DataFormatters/FormatClasses.h
+++ b/lldb/include/lldb/DataFormatters/FormatClasses.h
@@ -151,7 +151,6 @@ class TypeNameSpecifierImpl {
   };
   TypeOrName m_type;
 
-private:
   TypeNameSpecifierImpl(const TypeNameSpecifierImpl &) = delete;
   const TypeNameSpecifierImpl &
   operator=(const TypeNameSpecifierImpl &) = delete;

diff  --git a/lldb/include/lldb/Host/Editline.h 
b/lldb/include/lldb/Host/Editline.h
index 6e9daae42217..356e8f734732 100644
--- a/lldb/include/lldb/Host/Editline.h
+++ b/lldb/include/lldb/Host/Editline.h
@@ -326,7 +326,6 @@ class Editline {
 
   void ApplyTerminalSizeChange();
 
-private:
 #if LLDB_EDITLINE_USE_WCHAR
   std::wstring_convert> m_utf8conv;
 #endif

diff  --git a/lldb/include/lldb/Host/MainLoopBase.h 
b/lldb/include/lldb/Host/MainLoopBase.h
index cc816da4c25f..fa8cc77a94ba 100644
--- a/lldb/include/lldb/Host/MainLoopBase.h
+++ b/lldb/include/lldb/Host/MainLoopBase.h
@@ -79,7 +79,6 @@ class MainLoopBase {
 const ReadHandle &operator=(const ReadHandle &) = delete;
   };
 
-private:
   MainLoopBase(const MainLoopBase &) = delete;
   const MainLoopBase &operator=(const MainLoopBase &) = delete;
 };

diff  --git a/lldb/include/lldb/Symbol/DebugMacros.h 
b/lldb/include/lldb/Symbol/DebugMacros.h
index 0beb6b932637..0ea70f5deb84 100644
--- a/lldb/include/lldb/Symbol/DebugMacros.h
+++ b/lldb/include/lldb/Symbol/DebugMacros.h
@@ -27,7 +27,6 @@ class DebugMacroEntry {
   INVALID, DEFINE, UNDEF, START_FILE, END_FILE, INDIRECT
   };
 
-public:
   stat