summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/interface
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/scripts/Python/interface')
-rw-r--r--lldb/scripts/Python/interface/SBBroadcaster.i51
-rw-r--r--lldb/scripts/Python/interface/SBCommandInterpreter.i82
-rw-r--r--lldb/scripts/Python/interface/SBCommandReturnObject.i68
-rw-r--r--lldb/scripts/Python/interface/SBCommunication.i80
-rw-r--r--lldb/scripts/Python/interface/SBError.i60
-rw-r--r--lldb/scripts/Python/interface/SBFileSpec.i50
-rw-r--r--lldb/scripts/Python/interface/SBHostOS.i41
-rw-r--r--lldb/scripts/Python/interface/SBInputReader.i53
-rw-r--r--lldb/scripts/Python/interface/SBInstruction.i55
-rw-r--r--lldb/scripts/Python/interface/SBInstructionList.i49
-rw-r--r--lldb/scripts/Python/interface/SBSourceManager.i28
-rw-r--r--lldb/scripts/Python/interface/SBStream.i55
-rw-r--r--lldb/scripts/Python/interface/SBStringList.i44
-rw-r--r--lldb/scripts/Python/interface/SBType.i99
14 files changed, 815 insertions, 0 deletions
diff --git a/lldb/scripts/Python/interface/SBBroadcaster.i b/lldb/scripts/Python/interface/SBBroadcaster.i
new file mode 100644
index 00000000000..2e40d914b9f
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBBroadcaster.i
@@ -0,0 +1,51 @@
+//===-- SWIG Interface for SBBroadcaster ------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBBroadcaster
+{
+public:
+ SBBroadcaster ();
+
+ SBBroadcaster (const char *name);
+
+ SBBroadcaster (const SBBroadcaster &rhs);
+
+ ~SBBroadcaster();
+
+ bool
+ IsValid () const;
+
+ void
+ Clear ();
+
+ void
+ BroadcastEventByType (uint32_t event_type, bool unique = false);
+
+ void
+ BroadcastEvent (const lldb::SBEvent &event, bool unique = false);
+
+ void
+ AddInitialEventsToListener (const lldb::SBListener &listener, uint32_t requested_events);
+
+ uint32_t
+ AddListener (const lldb::SBListener &listener, uint32_t event_mask);
+
+ const char *
+ GetName () const;
+
+ bool
+ EventTypeHasListeners (uint32_t event_type);
+
+ bool
+ RemoveListener (const lldb::SBListener &listener, uint32_t event_mask = UINT32_MAX);
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBCommandInterpreter.i b/lldb/scripts/Python/interface/SBCommandInterpreter.i
new file mode 100644
index 00000000000..adcdd629c0b
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBCommandInterpreter.i
@@ -0,0 +1,82 @@
+//===-- SWIG Interface for SBCommandInterpreter -----------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBCommandInterpreter
+{
+public:
+ enum
+ {
+ eBroadcastBitThreadShouldExit = (1 << 0),
+ eBroadcastBitResetPrompt = (1 << 1),
+ eBroadcastBitQuitCommandReceived = (1 << 2), // User entered quit
+ eBroadcastBitAsynchronousOutputData = (1 << 3),
+ eBroadcastBitAsynchronousErrorData = (1 << 4)
+ };
+
+ SBCommandInterpreter (const lldb::SBCommandInterpreter &rhs);
+
+ ~SBCommandInterpreter ();
+
+ static const char *
+ GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type);
+
+ static const char *
+ GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type);
+
+ bool
+ IsValid() const;
+
+ bool
+ CommandExists (const char *cmd);
+
+ bool
+ AliasExists (const char *cmd);
+
+ lldb::SBBroadcaster
+ GetBroadcaster ();
+
+ bool
+ HasCommands ();
+
+ bool
+ HasAliases ();
+
+ bool
+ HasAliasOptions ();
+
+ lldb::SBProcess
+ GetProcess ();
+
+ ssize_t
+ WriteToScriptInterpreter (const char *src);
+
+ ssize_t
+ WriteToScriptInterpreter (const char *src, size_t src_len);
+
+ void
+ SourceInitFileInHomeDirectory (lldb::SBCommandReturnObject &result);
+
+ void
+ SourceInitFileInCurrentWorkingDirectory (lldb::SBCommandReturnObject &result);
+
+ lldb::ReturnStatus
+ HandleCommand (const char *command_line, lldb::SBCommandReturnObject &result, bool add_to_history = false);
+
+ int
+ HandleCompletion (const char *current_line,
+ const char *cursor,
+ const char *last_char,
+ int match_start_point,
+ int max_return_elements,
+ lldb::SBStringList &matches);
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBCommandReturnObject.i b/lldb/scripts/Python/interface/SBCommandReturnObject.i
new file mode 100644
index 00000000000..597cfb68216
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBCommandReturnObject.i
@@ -0,0 +1,68 @@
+//===-- SWIG Interface for SBCommandReturnObject ----------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBCommandReturnObject
+{
+public:
+
+ SBCommandReturnObject ();
+
+ SBCommandReturnObject (const lldb::SBCommandReturnObject &rhs);
+
+ ~SBCommandReturnObject ();
+
+ bool
+ IsValid() const;
+
+ const char *
+ GetOutput ();
+
+ const char *
+ GetError ();
+
+ size_t
+ PutOutput (FILE *fh);
+
+ size_t
+ GetOutputSize ();
+
+ size_t
+ GetErrorSize ();
+
+ size_t
+ PutError (FILE *fh);
+
+ void
+ Clear();
+
+ lldb::ReturnStatus
+ GetStatus();
+
+ bool
+ Succeeded ();
+
+ bool
+ HasResult ();
+
+ void
+ AppendMessage (const char *message);
+
+ bool
+ GetDescription (lldb::SBStream &description);
+
+ void
+ SetImmediateOutputFile (FILE *fh);
+
+ void
+ SetImmediateErrorFile (FILE *fh);
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBCommunication.i b/lldb/scripts/Python/interface/SBCommunication.i
new file mode 100644
index 00000000000..ca2bfa78944
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBCommunication.i
@@ -0,0 +1,80 @@
+//===-- SWIG Interface for SBCommunication ----------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBCommunication
+{
+public:
+ enum {
+ eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost.
+ eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available.
+ eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients.
+ eBroadcastBitReadThreadShouldExit = (1 << 3), ///< Sent by clients that need to cancel the read thread.
+ eBroadcastBitPacketAvailable = (1 << 4), ///< Sent when data received makes a complete packet.
+ eAllEventBits = 0xffffffff
+ };
+
+ typedef void (*ReadThreadBytesReceived) (void *baton, const void *src, size_t src_len);
+
+ SBCommunication ();
+ SBCommunication (const char * broadcaster_name);
+ ~SBCommunication ();
+
+
+ bool
+ IsValid () const;
+
+ lldb::SBBroadcaster
+ GetBroadcaster ();
+
+ lldb::ConnectionStatus
+ AdoptFileDesriptor (int fd, bool owns_fd);
+
+ lldb::ConnectionStatus
+ Connect (const char *url);
+
+ lldb::ConnectionStatus
+ Disconnect ();
+
+ bool
+ IsConnected () const;
+
+ bool
+ GetCloseOnEOF ();
+
+ void
+ SetCloseOnEOF (bool b);
+
+ size_t
+ Read (void *dst,
+ size_t dst_len,
+ uint32_t timeout_usec,
+ lldb::ConnectionStatus &status);
+
+ size_t
+ Write (const void *src,
+ size_t src_len,
+ lldb::ConnectionStatus &status);
+
+ bool
+ ReadThreadStart ();
+
+ bool
+ ReadThreadStop ();
+
+ bool
+ ReadThreadIsRunning ();
+
+ bool
+ SetReadThreadBytesReceivedCallback (ReadThreadBytesReceived callback,
+ void *callback_baton);
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBError.i b/lldb/scripts/Python/interface/SBError.i
new file mode 100644
index 00000000000..d3e3f756ab0
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBError.i
@@ -0,0 +1,60 @@
+//===-- SWIG Interface for SBError ------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBError {
+public:
+ SBError ();
+
+ SBError (const lldb::SBError &rhs);
+
+ ~SBError();
+
+ const char *
+ GetCString () const;
+
+ void
+ Clear ();
+
+ bool
+ Fail () const;
+
+ bool
+ Success () const;
+
+ uint32_t
+ GetError () const;
+
+ lldb::ErrorType
+ GetType () const;
+
+ void
+ SetError (uint32_t err, lldb::ErrorType type);
+
+ void
+ SetErrorToErrno ();
+
+ void
+ SetErrorToGenericError ();
+
+ void
+ SetErrorString (const char *err_str);
+
+ int
+ SetErrorStringWithFormat (const char *format, ...);
+
+ bool
+ IsValid () const;
+
+ bool
+ GetDescription (lldb::SBStream &description);
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBFileSpec.i b/lldb/scripts/Python/interface/SBFileSpec.i
new file mode 100644
index 00000000000..5897af44287
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBFileSpec.i
@@ -0,0 +1,50 @@
+//===-- SWIG Interface for SBFileSpec ---------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBFileSpec
+{
+public:
+ SBFileSpec ();
+
+ SBFileSpec (const lldb::SBFileSpec &rhs);
+
+ SBFileSpec (const char *path);// Deprected, use SBFileSpec (const char *path, bool resolve)
+
+ SBFileSpec (const char *path, bool resolve);
+
+ ~SBFileSpec ();
+
+ bool
+ IsValid() const;
+
+ bool
+ Exists () const;
+
+ bool
+ ResolveExecutableLocation ();
+
+ const char *
+ GetFilename() const;
+
+ const char *
+ GetDirectory() const;
+
+ uint32_t
+ GetPath (char *dst_path, size_t dst_len) const;
+
+ static int
+ ResolvePath (const char *src_path, char *dst_path, size_t dst_len);
+
+ bool
+ GetDescription (lldb::SBStream &description) const;
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBHostOS.i b/lldb/scripts/Python/interface/SBHostOS.i
new file mode 100644
index 00000000000..826548a8c5b
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBHostOS.i
@@ -0,0 +1,41 @@
+//===-- SWIG Interface for SBHostOS -----------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBHostOS
+{
+public:
+
+ static lldb::SBFileSpec
+ GetProgramFileSpec ();
+
+ static void
+ ThreadCreated (const char *name);
+
+ static lldb::thread_t
+ ThreadCreate (const char *name,
+ void *(*thread_function)(void *),
+ void *thread_arg,
+ lldb::SBError *err);
+
+ static bool
+ ThreadCancel (lldb::thread_t thread,
+ lldb::SBError *err);
+
+ static bool
+ ThreadDetach (lldb::thread_t thread,
+ lldb::SBError *err);
+ static bool
+ ThreadJoin (lldb::thread_t thread,
+ void **result,
+ lldb::SBError *err);
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBInputReader.i b/lldb/scripts/Python/interface/SBInputReader.i
new file mode 100644
index 00000000000..93986242357
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBInputReader.i
@@ -0,0 +1,53 @@
+//===-- SWIG Interface for SBInputREader ------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBInputReader
+{
+public:
+
+ typedef size_t (*Callback) (void *baton,
+ SBInputReader *reader,
+ InputReaderAction notification,
+ const char *bytes,
+ size_t bytes_len);
+
+ SBInputReader ();
+
+ SBInputReader (const lldb::SBInputReader &rhs);
+
+ ~SBInputReader ();
+
+ SBError
+ Initialize (SBDebugger &debugger,
+ Callback callback,
+ void *callback_baton,
+ lldb::InputReaderGranularity granularity,
+ const char *end_token,
+ const char *prompt,
+ bool echo);
+
+ bool
+ IsValid () const;
+
+ bool
+ IsActive () const;
+
+ bool
+ IsDone () const;
+
+ void
+ SetIsDone (bool value);
+
+ InputReaderGranularity
+ GetGranularity ();
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBInstruction.i b/lldb/scripts/Python/interface/SBInstruction.i
new file mode 100644
index 00000000000..1a9fc205258
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBInstruction.i
@@ -0,0 +1,55 @@
+//===-- SWIG Interface for SBInstruction ------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <stdio.h>
+
+// There's a lot to be fixed here, but need to wait for underlying insn implementation
+// to be revised & settle down first.
+
+namespace lldb {
+
+class SBInstruction
+{
+public:
+
+ SBInstruction ();
+
+ SBInstruction (const SBInstruction &rhs);
+
+ ~SBInstruction ();
+
+ bool
+ IsValid();
+
+ SBAddress
+ GetAddress();
+
+ size_t
+ GetByteSize ();
+
+ bool
+ DoesBranch ();
+
+ void
+ Print (FILE *out);
+
+ bool
+ GetDescription (lldb::SBStream &description);
+
+ bool
+ EmulateWithFrame (lldb::SBFrame &frame, uint32_t evaluate_options);
+
+ bool
+ DumpEmulation (const char * triple); // triple is to specify the architecture, e.g. 'armv6' or 'arm-apple-darwin'
+
+ bool
+ TestEmulation (lldb::SBStream &output_stream, const char *test_file);
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBInstructionList.i b/lldb/scripts/Python/interface/SBInstructionList.i
new file mode 100644
index 00000000000..a753d78a33d
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBInstructionList.i
@@ -0,0 +1,49 @@
+//===-- SWIG Interface for SBInstructionList --------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <stdio.h>
+
+namespace lldb {
+
+class SBInstructionList
+{
+public:
+
+ SBInstructionList ();
+
+ SBInstructionList (const SBInstructionList &rhs);
+
+ ~SBInstructionList ();
+
+ bool
+ IsValid () const;
+
+ size_t
+ GetSize ();
+
+ lldb::SBInstruction
+ GetInstructionAtIndex (uint32_t idx);
+
+ void
+ Clear ();
+
+ void
+ AppendInstruction (lldb::SBInstruction inst);
+
+ void
+ Print (FILE *out);
+
+ bool
+ GetDescription (lldb::SBStream &description);
+
+ bool
+ DumpEmulationForAllInstructions (const char *triple);
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBSourceManager.i b/lldb/scripts/Python/interface/SBSourceManager.i
new file mode 100644
index 00000000000..d4fd87a17ba
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBSourceManager.i
@@ -0,0 +1,28 @@
+//===-- SWIG Interface for SBSourceManager ----------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBSourceManager
+{
+public:
+ SBSourceManager (const lldb::SBSourceManager &rhs);
+
+ ~SBSourceManager();
+
+ size_t
+ DisplaySourceLinesWithLineNumbers (const lldb::SBFileSpec &file,
+ uint32_t line,
+ uint32_t context_before,
+ uint32_t context_after,
+ const char* current_line_cstr,
+ lldb::SBStream &s);
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBStream.i b/lldb/scripts/Python/interface/SBStream.i
new file mode 100644
index 00000000000..56543609ac9
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBStream.i
@@ -0,0 +1,55 @@
+//===-- SWIG Interface for SBStream -----------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <stdio.h>
+
+namespace lldb {
+
+class SBStream
+{
+public:
+
+ SBStream ();
+
+ ~SBStream ();
+
+ bool
+ IsValid() const;
+
+ // If this stream is not redirected to a file, it will maintain a local
+ // cache for the stream data which can be accessed using this accessor.
+ const char *
+ GetData ();
+
+ // If this stream is not redirected to a file, it will maintain a local
+ // cache for the stream output whose length can be accessed using this
+ // accessor.
+ size_t
+ GetSize();
+
+ void
+ Printf (const char *format, ...);
+
+ void
+ RedirectToFile (const char *path, bool append);
+
+ void
+ RedirectToFileHandle (FILE *fh, bool transfer_fh_ownership);
+
+ void
+ RedirectToFileDescriptor (int fd, bool transfer_fh_ownership);
+
+ // If the stream is redirected to a file, forget about the file and if
+ // ownership of the file was transfered to this object, close the file.
+ // If the stream is backed by a local cache, clear this cache.
+ void
+ Clear ();
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBStringList.i b/lldb/scripts/Python/interface/SBStringList.i
new file mode 100644
index 00000000000..901aa88b183
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBStringList.i
@@ -0,0 +1,44 @@
+//===-- SWIG Interface for SBStringList -------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBStringList
+{
+public:
+
+ SBStringList ();
+
+ SBStringList (const lldb::SBStringList &rhs);
+
+ ~SBStringList ();
+
+ bool
+ IsValid() const;
+
+ void
+ AppendString (const char *str);
+
+ void
+ AppendList (const char **strv, int strc);
+
+ void
+ AppendList (const lldb::SBStringList &strings);
+
+ uint32_t
+ GetSize () const;
+
+ const char *
+ GetStringAtIndex (size_t idx);
+
+ void
+ Clear ();
+};
+
+} // namespace lldb
diff --git a/lldb/scripts/Python/interface/SBType.i b/lldb/scripts/Python/interface/SBType.i
new file mode 100644
index 00000000000..e7d57b4fe76
--- /dev/null
+++ b/lldb/scripts/Python/interface/SBType.i
@@ -0,0 +1,99 @@
+//===-- SWIG Interface for SBType -------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+
+class SBTypeMember;
+
+class SBType
+{
+public:
+
+ SBType (void *ast = NULL, void *clang_type = NULL);
+
+ SBType (const SBType &rhs);
+
+ ~SBType ();
+
+ bool
+ IsValid();
+
+ const char *
+ GetName();
+
+ uint64_t
+ GetByteSize();
+
+ uint64_t
+ GetNumberChildren (bool omit_empty_base_classes);
+
+ bool
+ GetChildAtIndex (bool omit_empty_base_classes, uint32_t idx, SBTypeMember &member);
+
+ uint32_t
+ GetChildIndexForName (bool omit_empty_base_classes, const char *name);
+
+ bool
+ IsAPointerType ();
+
+ SBType
+ GetPointeeType ();
+
+ static bool
+ IsPointerType (void *opaque_type);
+
+ bool
+ GetDescription (lldb::SBStream &description);
+};
+
+class SBTypeMember
+{
+public:
+
+ SBTypeMember ();
+
+ SBTypeMember (const SBTypeMember &rhs);
+
+ ~SBTypeMember ();
+
+ bool
+ IsBaseClass ();
+
+ bool
+ IsValid ();
+
+ void
+ Clear();
+
+ bool
+ IsBitfield ();
+
+ size_t
+ GetBitfieldWidth ();
+
+ size_t
+ GetBitfieldOffset ();
+
+ size_t
+ GetOffset ();
+
+ const char *
+ GetName ();
+
+ SBType
+ GetType();
+
+ SBType
+ GetParentType();
+
+ void
+ SetName (const char *name);
+};
+
+} // namespace lldb
OpenPOWER on IntegriCloud