Commit Graph

10808 Commits

Author SHA1 Message Date
Zachary Turner 5023257f23 Move some functions from source/lldb.cpp to Utility.
Specifically, there were some functions for converting enums
to strings and a function for matching a string using a specific
matching algorithm.  This moves those functions to more appropriate
headers in lldb/Utility and updates references to include the
new headers.

llvm-svn: 232673
2015-03-18 21:31:45 +00:00
Zachary Turner 71536d930d Try to fix the Makefile build.
I deleted lldb-log.cpp, but the Makefile build lists this file
explicitly, so it is removed in this patch.

llvm-svn: 232669
2015-03-18 20:58:39 +00:00
Greg Clayton 1adf3ac460 Don't load register data from memory.
llvm-svn: 232668
2015-03-18 20:45:28 +00:00
Enrico Granata c457132ede Fix the Xcode build after the MIPS64 changes
llvm-svn: 232655
2015-03-18 18:42:41 +00:00
Zachary Turner 3294de270e Move lldb-log.cpp to core/Logging.cpp
So that we don't have to update every single #include in the entire
codebase to #include this new header (which used to get included by
lldb-private-log.h, we automatically #include "Logging.h" from
within "Log.h".

llvm-svn: 232653
2015-03-18 18:20:42 +00:00
Greg Clayton 833d798b0e Always add some fake threads with x86_64 registers no matter what the architecture since this is just for testing that we can add new threads with completely different registers contexts to a process.
llvm-svn: 232649
2015-03-18 17:03:13 +00:00
Zachary Turner 799770c03a Fix linking of unit tests via CMake on Windows.
A previous attempt to make the unit tests link properly on
Linux broke it for Windows.  This patch fixes it for both platforms.

llvm-svn: 232648
2015-03-18 16:56:24 +00:00
Ed Maste 2001d1040f Skip intermittently failing test on FreeBSD
It is already skipped on the other platforms anyhow.

llvm.org/pr19246

llvm-svn: 232640
2015-03-18 15:23:53 +00:00
Robert Flack ebc5609087 Convert open options for POSIX open on target platform.
This moves the conversion of the open options to the target platform. On mac fcntl.h has different values for O_CREAT and O_TRUNC than on linux so by transmitting the standardized lldb open options we can correctly convert them on the target platform.

Test Plan:
On linux:
  lldb-server p --listen *:1234
On mac:
  lldb
  platform select remote-linux
  platform connect connect://ip-of-linux-box:1234
  target create ~/path/to/linux/binary
  b main
  process launch
Binary is successfully pushed to linux remote, process successfully launches and break in the main method.

Differential Revision: http://reviews.llvm.org/D8395

llvm-svn: 232634
2015-03-18 13:55:48 +00:00
Ilia K 5d8b145d70 Fix comment in tools/lldb-mi/MIDriver.cpp
llvm-svn: 232633
2015-03-18 13:08:52 +00:00
Tamas Berghammer db037d9c49 Parse .note.android.ident header from elf files
In android a .note.android.ident section header is added to the elf
files to provide information for the debuggers that it is an android
specific module. This CL add logic to parse it out from the elf files
and set the module specification based on it.

Differential revision: http://reviews.llvm.org/D8377

llvm-svn: 232625
2015-03-18 10:36:27 +00:00
Hafiz Abid Qadeer 4a7baeab14 Make lldb-mi handle only MI commands
Summary:
Previously lldb-mi can also act as a driver like normal lldb. It needed a lot
of redundant code in the lldb-mi for that. I think that if a user wants command
line lldb driver then he/she should use the lldb for it. This change will cleanup
the code a lot. When this change goes in, it will allow us to remove some more
redundant code too.

All tests pass on Linux. Did some sanity testing on command line and with eclipse.

Reviewers: ki.stfu

Reviewed By: ki.stfu

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8381

llvm-svn: 232621
2015-03-18 10:07:46 +00:00
Pavel Labath 61984d39d5 Fix a typo in EmulateInstructioinMIPS64
llvm-svn: 232620
2015-03-18 09:57:10 +00:00
Bhushan D. Attarde 29e5937cd9 Initial Assembly profiler for mips64
Summary:
This is initial implementation of assembly profiler which only scans prologue/epilogue assembly instructions to create CFI instructions.

Reviewers: clayborg, jasonmolenda

Differential Revision: http://reviews.llvm.org/D7696

llvm-svn: 232619
2015-03-18 09:21:29 +00:00
Ilia K 41c56755be Clean up CommandObjectBreakpointNameList: remove duplicated 'protected' access modifier
llvm-svn: 232618
2015-03-18 09:14:49 +00:00
Jason Molenda 1bffc64a46 Build fix for building debugserver for ios.
llvm-svn: 232563
2015-03-17 23:16:42 +00:00
Zachary Turner 85bc48ca74 Convert CRLF to LF.
I accidentally let some Windows line endings slip in.  This is a
good reminder for me to use core.eol=lf.

llvm-svn: 232560
2015-03-17 22:51:21 +00:00
Siva Chandra 7523ec4f47 Enable TestDataFormatterStdIterator with GCC.
Summary:
This test now passes for Clang and GCC. I do not know why it was
disabled for GCC with link to a bug which should not have had an
effect on this test.

Test Plan: dotest.py -C gcc -p TestDataFormatterStdIterator

Reviewers: vharron

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8396

llvm-svn: 232552
2015-03-17 21:43:01 +00:00
Siva Chandra 8d88d08197 Implement formatter for std::vector<bool, ...> of libstdc++ in Python.
Summary:
The existing formatter in C++ has been removed as it was not being used. 
The associated test TestDataFormatterStdVBool.py has been enabled for
both Clang and GCC on Linux.

Test Plan: dotest.py -p TestDataFormatterStdVBool

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8390

llvm-svn: 232548
2015-03-17 21:23:17 +00:00
Zachary Turner 0641ca1a2d Remove ScriptInterpreterObject.
This removes ScriptInterpreterObject from the codebase completely.
Places that used to rely on ScriptInterpreterObject now use
StructuredData::Object and its derived classes.  To support this,
a new type of StructuredData object is introduced, called
StructuredData::Generic, which stores a void*.  Internally within
the python library, StructuredPythonObject subclasses this
StructuredData::Generic class so that it can addref and decref
the python object on construction and destruction.

Additionally, all of the classes in PythonDataObjects.h such
as PythonList, PythonDictionary, etc now provide a method to
create an instance of the corresponding StructuredData type.  For
example, there is PythonDictionary::CreateStructuredDictionary.
To eliminate dependencies on PythonDataObjects for external
callers, all ScriptInterpreter methods now return only
StructuredData classes

The rest of the changes in this CL are focused on fixing up
users of PythonDataObjects classes to use the new StructuredData
classes.

llvm-svn: 232534
2015-03-17 20:04:04 +00:00
David Blaikie 5121c9aa92 Fix the clang -Werror build by suppressing -Wextended-offsetof
llvm-svn: 232507
2015-03-17 17:37:17 +00:00
David Blaikie 7d3cf0062a Add missing overrides to fix the clang -Werror build (-Winconsistent-missing-override)
llvm-svn: 232504
2015-03-17 17:26:41 +00:00
Ilia K 8a00a562c5 Fix broadcasters for interpreter and process:
# Fix CommandInterpreter.Broadcaster name (it should be the same as CommandInterpreter::GetStaticBroadcasterClass())
# Prevent the same error in Process.Broadcaster
# Fix SBCommandInterpreter::GetBroadcasterClass (it should call CommandInterpreter::GetStaticBroadcasterClass(), was Communication::GetStaticBroadcasterClass())

llvm-svn: 232500
2015-03-17 16:54:52 +00:00
Tamas Berghammer cb84eebb52 Change reinterpret_casts to static_casts in NativeProcessLinux
llvm-svn: 232491
2015-03-17 15:05:31 +00:00
Tamas Berghammer c7e6680637 Remove obsolate rdar comment from TestSetValues.py
llvm-svn: 232490
2015-03-17 15:05:28 +00:00
Tamas Berghammer 9f3658d211 Fix signature of ProcessInfo::SetArchitecture
llvm-svn: 232489
2015-03-17 15:05:25 +00:00
Tamas Berghammer 655b87f99d Remove unused handler registreation from GDBRemoteCommunicationServerLLGS
llvm-svn: 232488
2015-03-17 15:05:23 +00:00
Tamas Berghammer eadb2a9ed0 Report stopped by trace if none of the watchpoint was hit
Some linux kernel reports a watchpoint hit after single stepping even
when no watchpoint was hit. This CL looks for a watchpoint which was hit
and reports a stop by trace if it haven't found any.

Differential revision: http://reviews.llvm.org/D8081

llvm-svn: 232482
2015-03-17 14:40:57 +00:00
Hafiz Abid Qadeer 7658b2be16 Cleanup the MIReadMe.txt after the recent changes in lldb-mi.
This commit removed the redundant and out of date stuff from the file.

llvm-svn: 232477
2015-03-17 14:12:03 +00:00
Mohit K. Bhakkad 3df471c32d [MIPS] - Register Context for MIPS64
Patch by Jaydeep Patil

Summery:
1. Add MIPS variants by parsing e_flags of the ELF
2. Create RegisterInfoInterface and RegisterContext for MIPS64 and MIPS64EL

Reviewers: clayborg

Subscribers: tberghammer, bhushan, mohit.bhakkad, sagar

Differential Revision: http://reviews.llvm.org/D8166

llvm-svn: 232467
2015-03-17 11:43:56 +00:00
David Blaikie 3dfb86b641 Fix the clang -Werror build & make the unit tests link under Linux
The order of libraries passed to the linker didn't work under linux (you
need the llvm libraries first, then the lldb libraries). I modelled this
after clang's setup here. Seemed simple enough to just be consistent.

llvm-svn: 232461
2015-03-17 03:32:21 +00:00
Vince Harron de0a0f3100 XFAIL flaky tests
llvm-svn: 232441
2015-03-17 00:10:51 +00:00
Oleksiy Vyalov 933f853030 Make ModuleList::GetSharedModule to use module_search_paths parameter.
http://reviews.llvm.org/D8365

llvm-svn: 232437
2015-03-16 23:44:30 +00:00
Siva Chandra 3b36038f45 Cleanup implementation of formatter for std::vector from libstdc++.
Summary: Removed unused variables and methods.

Test Plan: dotest.py -p TestDataFormatterStdVector

Reviewers: vharron

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8368

llvm-svn: 232434
2015-03-16 23:02:03 +00:00
Jim Ingham 6312991cdb Report an error for line number values that don't convert to integers during argument
parsing so that we can give a more accurate error message.

<rdar://problem/20145563>

llvm-svn: 232433
2015-03-16 22:47:38 +00:00
Siva Chandra 588ec02f19 Enable TestDataFormatterStdMap on linux (libstdc++) with clang.
Summary:
This test should have been enabled along with
7181dae1248cc1b03505cca1b7c6e3dfeffefc0a, but since the test was
actually crashing, I thought it was a much deeper problem. Turns out,
all I had to do was to add "-fno-limit-debug-info" when compiling
the test case.

The test is still skipped when the testcase is compiled with GCC.

Test Plan: dotest.py -p TestDataFormatterStdMap

Reviewers: vharron

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8364

llvm-svn: 232432
2015-03-16 22:45:05 +00:00
Siva Chandra 4da7a29a11 Skip TestDataFormatterStdMap on linux instead of xfailing.
Summary:
After 7181dae1248cc1b03505cca1b7c6e3dfeffefc0a, this test progresses
much further but crashes. Will skip this test while I fix this properly.

Test Plan: dotest.py -p TestDataFormatterStdMap

Reviewers: vharron

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8361

llvm-svn: 232403
2015-03-16 19:56:36 +00:00
Greg Clayton 75a19344ad Added an Python operating system plug-in test to verify that python can be used to add threads to an existing process.
The test does the following:
1 - runs a program to main without the OS plug-in and verifies no OS threads are in the process
2 - loads the OS plug-in and verifies the 3 OS plug-in threads are now in the current process
3 - verify the register contents of each thread that shows up
4 - unload the python OS plug-in and verify that the OS threads are gone.

llvm-svn: 232401
2015-03-16 19:54:22 +00:00
Siva Chandra 870602dd3c Handle PyLong return values in LLDBSwigPython_CalculateNumChildren.
Summary:
Also, change its return type to size_t to match the return types of
its callers.

With this change, std::vector and std::list data formatter tests
pass on Linux (when using libstdc++) with clang as well as with gcc.
These tests have also been enabled in this patch.

Test Plan: dotest.py -p <TestDataFormatterStdVector|TestDataFormatterStdList>

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: zturner, lldb-commits

Differential Revision: http://reviews.llvm.org/D8337

llvm-svn: 232399
2015-03-16 19:01:33 +00:00
Hafiz Abid Qadeer a40780e36c Remove redundant comments from lldb-mi source files.
Most of lldb-mi files have comments about environement, copyright etc which were neither needed nor uptodate.
This commit removes those comments.

llvm-svn: 232396
2015-03-16 18:18:18 +00:00
Hafiz Abid Qadeer 10fa53d26e Enabling the lldb-mi tests on Linux.
I think the issue that caused the random failure has been fixed. So I am enabling the tests again on Linux.
There are still some tests that are skipped on Linux due to different output. Those will be handled separately.

Tested with dotest.py and with "make check-lldb" and there was no MI related failure.

llvm-svn: 232380
2015-03-16 14:28:18 +00:00
Hafiz Abid Qadeer ace93f3a90 Fix the test for gcc.
Following 3 changes were made.
1. Test was assuming that function name will have () in the end. I dont know why lldb is generating function name like this but it looks like a bug. For this test, I have removed it.
2. Step instruction test was assuming that function call will not be the first instruction in the range of the line. This assumption failed with gcc. So I had fixed this.
3. Some minor adjustments with the line number.

Test with bot gcc and clang and all tests pass.

This test is still very fragile. We should be removing hardcoded line number.

llvm-svn: 232372
2015-03-16 12:16:19 +00:00
Hafiz Abid Qadeer 943483f451 Check that RestartedFromEvent flag before processing the state changed event.
Not checking for this flags caused lldb-mi to issue stop notification when target
has started running again. It also tried to get stack when target was running and
this caused randon failure.

Approved in http://lists.cs.uiuc.edu/pipermail/lldb-dev/2015-March/006953.html

llvm-svn: 232370
2015-03-16 11:47:24 +00:00
Vince Harron 0fc6c6762f Added nullptr to fix build
llvm-svn: 232345
2015-03-16 03:54:22 +00:00
Vince Harron b63c1880f2 Use -fno-limit-debug-info instead of -fstandalone-debug in tests
This fixes tests on clang-3.4

AFAICT, these flags have the same affect and -fstandalone-debug wasn't
added until after clang-3.4

Committed to try to fix buildbot

Differential Revision: http://reviews.llvm.org/D8347

llvm-svn: 232326
2015-03-15 18:05:53 +00:00
Zachary Turner 073951f28b Fix a bug related to arg escaping, and add unit tests.
A recent refactor had introduced a bug where if you escaped a
character, the rest of the string would get processed incorrectly.

This patch fixes that bug and adds some unit tests for Args.

llvm-svn: 232288
2015-03-14 23:39:42 +00:00
Zachary Turner eeba1a896a [CMake] Make the unittests link against everything...
Sigh.  There's really not a good alternative until we decouple
python from lldb better.  The only way the build works right now
is by having every executable link against every LLDB library.
This causes implicit transitive link dependencies on the union
of everything that LLDB brings in.  Which means that if all we
want is one header file from interpreter, we have to bring in
everything, including everything that everything depends on,
which means python.

There's outstanding efforts to address this, but it's not yet
complete.  So until then, this is all we can do.

llvm-svn: 232287
2015-03-14 23:39:28 +00:00
Ed Maste 1cd6c667eb Strip trailing whitespace from python-wrapper.swig
(To test the dependency added in r232256.)

llvm-svn: 232257
2015-03-14 08:06:56 +00:00
Ed Maste c3948b4af1 Make LLDBWrapPython.cpp depend on the .swig files (configure+make build)
This is equivalent to r232175 for the CMake build.

llvm-svn: 232256
2015-03-14 07:58:06 +00:00
Zachary Turner 2c04f79b01 [gtest] Fix gtest failures on Windows.
On Windows, you need to call WSAStartup() before making any socket
calls, and WSACleanup() before you shutdown.  This wasn't being
done, so all of the socket tests were failing.  This fixes
that, which brings the unit test suite to a fully working state
on Windows.

llvm-svn: 232247
2015-03-14 04:19:32 +00:00