various types and numbers of arguments rather than trying to keep a
constant number of arguments for all the types.
- Also create a Register type within the instructions, to hold
register type and number.
- Modify EmulateInstructionArm.cpp to use the new register and context
types in all the instruction emulation functions.
- Add code to emulate the STM Arm instruction.
llvm-svn: 125528
table. Modify EmulateInstructionARM::EvaluateInstruction() so that if the cpsr has changed
during evaluate instruction, we flush out the change into m_inst_cpsr in preparation for the next
instruction.
llvm-svn: 125524
the context of eContextImmediate type, since the immediate value is known from the
argument value to WriteRegisterUnsigned() callback already.
llvm-svn: 125518
an imm12 into imm32 for ARM or Thumb so that they now handle carry_in/carry_out.
Funnel ARMExpandImm()/ThumbExpandImm() to the enhanced ARMExpandImm_C()/ThumbExpandImm_C()
functions.
llvm-svn: 125508
are supported by the remote GDB target. We can also now deal with the lack of
vCont support and send packets that the remote GDB stub can use. We also error
out of the continue if LLDB tries to do something too complex when vCont isn't
supported.
llvm-svn: 125433
eContextAdjustBaseRegister, eContextRegisterStore and
eContextWriteMemoryRandomBits.
- Implement a version of WriteBits32UnknownToMemory for writing to memory.
- Modify EmulateLDM, EmulateLDMDA, EmulateLDMDB and EmulateLDMIB to use the
eContextAdjustBaseRegister context when appropriate.
- Add code to emulate the STM/STMIA/STMEA Arm instruction.
llvm-svn: 125414
Change the method name from *LDRRdPCRelative to *LDRRtPCRelative to be compliant
with the ARM Arch Manual which uses Rt for the destination register.
llvm-svn: 125390
Add new utility function, WriteBits32Unknown
Modify the LDM* instruction emulation functions to call WriteBits32Unknown.
Add missing overview comments to the LDM* instruction emulation functions.
Add code to emulate LDMDA Arm instruction.
llvm-svn: 125377
- Objective-C constant strings were being
NULL-terminated erroneously.
- Empty Objective-C constant strings were not
being generated correctly.
Also added the template for a test of these
fixes.
llvm-svn: 125314
of the CPSR during the course of executing an opcode, and modified SelectInstrSet()
to update this variable instead of the original m_inst_cpsr, which should be
the cached copy of the CPSR at the beginning of executing the opcode.
llvm-svn: 125244
module's AST context. Prior to this fix, with gcc binaries, we end up with
a full class definition for any used classes in each compile unit due to the
one definition rule. This would result in us making N copies of class T, where
N is the number of compile units that use class T, in the module AST. When
an expression would then try and use any types that were duplicated, it would
quickly confuse clang and make expression evaluation fail due to all of the
duplicate types that got copied over. This is now fixed by making a map of
types in the DWARF that maps type names to a collection of types + declaration
(file + line number) + DIE. Then later when we find a type we look in this
module map and find any already cached types that we can just use.
8935777
llvm-svn: 125207
the lldb/source/Host/*.cpp and lldb/source/Host/*/*.cpp directories. The only
offenders are the command completion and the StreamFile.cpp.
I will soon modify StreamFile.cpp to use a lldb/source/Host/File.cpp so that
all file open, close, read, write, seek, are abstracted into the host layer
as well, then this will be gone.
llvm-svn: 125082
in the DWARF + debug map symbol file parser.
Also cleaned up the "image lookup --address ADDR" output when we it results
in something that is in an inlined function. Now we correctly dump out the
full inlined call stack.
llvm-svn: 125072
flags such that symbols can be searched for within a shared library if desired.
Platforms that support the RTLD_FIRST flag can still take advantage of their
quicker lookups, and other platforms can still get the same fucntionality
with a little extra work.
Also changed LLDB_CONFIG flags over to either being defined, or not being
defined to stay in line with current open source practices and to prepare for
using autoconf or cmake to configure LLDB builds.
llvm-svn: 125064
as pointed out By Caroline. Refactored a little bit by adding two new helper methods to the
EmulateInstructionARM class:
o BranchWritePC()
o BXWritePC()
llvm-svn: 125059
where the implementation is hidden in the host layer. This avoids
a slew of "#if LLDB_CONFIG_TERMIOS_SUPPORTED" statements in the
code and keeps things cleaner.
llvm-svn: 125057
#include "lldb/Host/Config.h"
Or the LLDB_CONFIG_TERMIOS_SUPPORTED defined won't be set. I will fix all
of this Termios stuff later today by moving lldb/Core/TTYState.* into the
host layer and then we conditionalize all of this inside TTYState.cpp and
then we get rid of LLDB_CONFIG_TERMIOS_SUPPORTED all together.
Typically, when we start to see too many "#if LLDB_CONFIG_XXXX" preprocessor
directives, this is a good indicator that something needs to be moved over to
the host layer. TTYState can be modified to do all of the things that many
areas of the code are currently doing, and it will avoid all of the
preprocessor noise.
llvm-svn: 125027
to represent the the 'If Then' instruction which makes up to four following
instructions (the IT block)conditional.
Hook up ITSession utility class as a member variable of EmulateInstructionARM.
llvm-svn: 124915
Internal use means for compiling the LLDB debug engine and plug-ins, but it
should never make it into the public API.
Since we don't currently have a configuration script that detects avaiable
functionality in the LLDB build system, we are hard coding #define values
in the host specific "Config.h" files.
#define values in these Config.h header files should set the value to zero or
one:
#define LLDB_CONFIG_TERMIOS_SUPPORTED 1
#define LLDB_CONFIG_OTHER 0
Then any code in the LLDB engine should check the availability using:
#if LLDB_CONFIG_TERMIOS_SUPPORTED
....
#endif
Eventually the contents of the host specific Config.h files will be auto
generated, but for now they will be hard coded. Any LLDB_CONFIG_XXXX items
that are added should be added to all Config.h files and set to either zero
or one.
llvm-svn: 124892
One (stepout.patch) to fix a problem in ThreadPlanStepOut.cpp. There is an erroneous semi colon at end of an if statement that make the condition useless (if body is empty).
And the second patch is to remove to useless typedef on enum, and so avoid a lot of warnings with clang++.
llvm-svn: 124874
(lldb) process connect <remote-url>
Currently when you specify a file with the file command it helps us to find
a process plug-in that is suitable for debugging. If you specify a file you
can rely upon this to find the correct debugger plug-in:
% lldb a.out
Current executable set to 'a.out' (x86_64).
(lldb) process connect connect://localhost:2345
...
If you don't specify a file, you will need to specify the plug-in name that
you wish to use:
% lldb
(lldb) process connect --plugin process.gdb-remote connect://localhost:2345
Other connection URL examples:
(lldb) process connect connect://localhost:2345
(lldb) process connect tcp://127.0.0.1
(lldb) process connect file:///dev/ttyS1
We are currently treating the "connect://host:port" as a way to do raw socket
connections. If there is a URL for this already, please let me know and we
will adopt it.
So now you can connect to a remote debug server with the ProcessGDBRemote
plug-in. After connection, it will ask for the pid info using the "qC" packet
and if it responds with a valid process ID, it will be equivalent to attaching.
If it response with an error or invalid process ID, the LLDB process will be
in a new state: eStateConnected. This allows us to then download a program or
specify the program to run (using the 'A' packet), or specify a process to
attach to (using the "vAttach" packets), or query info about the processes
that might be available.
llvm-svn: 124846
condition that could occur when launching or attaching. What could happen is
you would launch/attach to a process, then you would need to tell a listener
to watch for process state changed events. In this case, if you waited too
long to listen for events, you could miss the initial stop event, requiring
clients to listen, then check the process state.
llvm-svn: 124818
substitutions in order to achieve file mappings.
Modify CommandObjectTarget.cpp to properly set the status of the return object to make
scripting like this:
self.runCmd("target image-search-paths add %s %s" % (os.getcwd(), new_dir))
works.
llvm-svn: 124762
LLDB plugin directory and a user LLDB plugin directory. We currently still
need to work out at what layer the plug-ins will be, but at least we are
prepared for plug-ins. Plug-ins will attempt to be loaded from the
"/Developer/Library/PrivateFrameworks/LLDB.framework/Resources/Plugins"
folder, and from the "~/Library/Application Support/LLDB/Plugins" folder on
MacOSX. Each plugin will be scanned for:
extern "C" bool LLDBPluginInitialize(void);
extern "C" void LLDBPluginTerminate(void);
If at least LLDBPluginInitialize is found, the plug-in will be loaded. The
LLDBPluginInitialize function returns a bool that indicates if the plug-in
should stay loaded or not (plug-ins might check the current OS, current
hardware, or anything else and determine they don't want to run on the current
host). The plug-in is uniqued by path and added to a static loaded plug-in
map. The plug-in scanning happens during "lldb_private::Initialize()" which
calls to the PluginManager::Initialize() function. Likewise with termination
lldb_private::Terminate() calls PluginManager::Terminate(). The paths for the
plug-in directories is fetched through new Host calls:
bool Host::GetLLDBPath (ePathTypeLLDBSystemPlugins, dir_spec);
bool Host::GetLLDBPath (ePathTypeLLDBUserPlugins, dir_spec);
This way linux and other systems can define their own appropriate locations
for plug-ins to be loaded.
To allow dynamic shared library loading, the Host layer has also been modified
to include shared library open, close and get symbol:
static void *
Host::DynamicLibraryOpen (const FileSpec &file_spec,
Error &error);
static Error
Host::DynamicLibraryClose (void *dynamic_library_handle);
static void *
Host::DynamicLibraryGetSymbol (void *dynamic_library_handle,
const char *symbol_name,
Error &error);
lldb_private::FileSpec also has been modified to support directory enumeration
in an attempt to abstract the directory enumeration into one spot in the code.
The directory enumertion function is static and takes a callback:
typedef enum EnumerateDirectoryResult
{
eEnumerateDirectoryResultNext, // Enumerate next entry in the current directory
eEnumerateDirectoryResultEnter, // Recurse into the current entry if it is a directory or symlink, or next if not
eEnumerateDirectoryResultExit, // Exit from the current directory at the current level.
eEnumerateDirectoryResultQuit // Stop directory enumerations at any level
};
typedef FileSpec::EnumerateDirectoryResult (*EnumerateDirectoryCallbackType) (void *baton,
FileSpec::FileType file_type,
const FileSpec &spec);
static FileSpec::EnumerateDirectoryResult
FileSpec::EnumerateDirectory (const char *dir_path,
bool find_directories,
bool find_files,
bool find_other,
EnumerateDirectoryCallbackType callback,
void *callback_baton);
This allow clients to specify the directory to search, and specifies if only
files, directories or other (pipe, symlink, fifo, etc) files will cause the
callback to be called. The callback also gets to return with the action that
should be performed after this directory entry. eEnumerateDirectoryResultNext
specifies to continue enumerating through a directory with the next entry.
eEnumerateDirectoryResultEnter specifies to recurse down into a directory
entry, or if the file is not a directory or symlink/alias to a directory, then
just iterate to the next entry. eEnumerateDirectoryResultExit specifies to
exit the current directory and skip any entries that might be remaining, yet
continue enumerating to the next entry in the parent directory. And finally
eEnumerateDirectoryResultQuit means to abort all directory enumerations at
all levels.
Modified the Declaration class to not include column information currently
since we don't have any compilers that currently support column based
declaration information. Columns support can be re-enabled with the
additions of a #define.
Added the ability to find an EmulateInstruction plug-in given a target triple
and optional plug-in name in the plug-in manager.
Fixed a few cases where opendir/readdir was being used, but yet not closedir
was being used. Soon these will be deprecated in favor of the new directory
enumeration call that was added to the FileSpec class.
llvm-svn: 124716
diagnostics of Clang AST classes for the purpose of
debugging the types LLDB produces for DWARF objects.
The ASTDumper is currently only used in log output
if you enable verbose mode in the expression log:
log enable -v lldb expr
Its output then appears in the log for external
variables used by the expr command.
llvm-svn: 124703
Currently this test case works fine run by itself, but fails when
run in the entire test suite; Johnny requested that I check it in
so that he can look at it.
llvm-svn: 124510
sessions: When continue packet has been sent and an interrupt packet was
quickly sent, it would get read at the same time:
$c#00\x03
There was an error where the packet end index was always being computed
incorrectly by debugserver, but it wouldn't matter if there weren't extra
bytes on the end (the hex \x03 interrupt byte in this case). The first
'$' last 3 bytes of the data in the packet buffer were being trimmed
(trying to trim the '#' + checksum (#XX)) which made:
c#
And this would then be passed to the handle routine for the 'c' packet which
would see an extra character at the end and assume it was going to be in the
form c[addr] where "[addr]" was a hex address to resume at and this would
result in a malformed packet response. This is now fixed and everything works
great.
Another issue was issuing async packets correctly by doing correct handshakes
between the thread that wants to send the async packet, and the thread that
is tracking the current run.
Added a write lock to the communication class as well to make sure you never
get two threads trying to write data at the same time. This wasn't happening,
but it is a good idea to make sure it doesn't.
llvm-svn: 124369
lldb_private::Function objects. Previously the SymbolFileSymtab subclass
would return lldb_private::Symbol objects when it was asked to find functions.
The Module::FindFunctions (...) now take a boolean "bool include_symbols" so
that the module can track down functions and symbols, yet functions are found
by the SymbolFile plug-ins (through the SymbolVendor class), and symbols are
gotten through the ObjectFile plug-ins.
Fixed and issue where the DWARF parser might run into incomplete class member
function defintions which would make clang mad when we tried to make certain
member functions with invalid number of parameters (such as an operator=
operator that had no parameters). Now we just avoid and don't complete these
incomplete functions.
llvm-svn: 124359
extra launch options:
LLDB_LAUNCH_FLAG_DISABLE_ASLR disables ASLR for all launched processes
LLDB_LAUNCH_FLAG_DISABLE_STDIO will disable STDIO (reroute to "/dev/null")
for all launched processes
LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY will force all launched processes to be
launched in new terminal windows.
Also, don't init python if we never create a script interpreter.
llvm-svn: 124341
With the current target revision of Clang libclangChecker no longer exists and
is not needed. Update the include path so we can get at ARM_DWARF_Registers.h
and friends.
llvm-svn: 124240
rdar://problem/8435794
settings set target.process.output-path does not seem to work
Also change the test case from test_set_output_path to test_set_error_output_path
as it now exercises both setting target.process.error-path and target.process.output-path.
llvm-svn: 124198
types. What was happening was the DWARF parser was almost ignoring definitions
(DIEs with the DW_AT_declaration set to 1). It wasn't ignoring declarations
that had _some_ children. When this happened, we would treat the declaration
as a complete type. Often we would have a declaration of a type with just
some enum definitions inside and nothing else. Now we correctly ignore these
definitions, and also I added some changes to allow us to figure out what
decl context these special declarations actually point to.
llvm-svn: 124179
with my last commit.
The change should be correct but it's not fixing anything important
and right now unneeded changes are not a good idea.
llvm-svn: 124173
it to interpret a "this" variable that was merely
a pointer -- that is, not a class pointer -- as
meaning that the current context was inside a C++
method. This bug would prevent expressions from
evaluating correctly in regular C code if there
was a pointer variable named "this" in scope.
llvm-svn: 124117
they may be in sensitive areas and we set breakpoints on the thread creation routines
if we are running expressions, so the threads should quickly get to a safe spot.
llvm-svn: 124115
provision for specifying a working directory with the name LaunchWithCWD in our
target language (Python) for now. This fixes the test suite failures due to the
overloading.
llvm-svn: 124069