Commit Graph

867 Commits

Author SHA1 Message Date
Jim Ingham f08f5c9926 Add an auto-continue flag to breakpoints & locations.
You can get a breakpoint to auto-continue by adding "continue"
as a command, but that has the disadvantage that if you hit two
breakpoints simultaneously, the continue will force the process
to continue, and maybe even forstalling the commands on the other.
The auto-continue flag means the breakpoints can negotiate about
whether to stop.

Writing tests, I wanted to supply some commands when I made the
breakpoints, so I also added that ability.

llvm-svn: 309969
2017-08-03 18:13:24 +00:00
Jim Ingham af26b22cd2 Fix a mis-feature with propagation of breakpoint options -> location options.
When an option was set at on a location, I was just copying the whole option set 
to the location, and letting it shadow the breakpoint options.  That was wrong since
it meant changes to unrelated options on the breakpoint would no longer take on this
location.  I added a mask of set options and use that for option propagation.

I also added a "location" property to breakpoints, and added SBBreakpointLocation.{G,S}etCommandLineCommands
since I wanted to use them to write some more test cases.

<rdar://problem/24397798>

llvm-svn: 309772
2017-08-02 00:16:10 +00:00
Vadim Macagon 141a6263da Expose process instance info via SB API
Summary:
Implement SBProcessInfo to wrap lldb_private::ProcessInstanceInfo,
and add SBProcess::GetProcessInfo() to retrieve info like parent ID,
group ID, user ID etc. from a live process.

Differential Revision: https://reviews.llvm.org/D35881

llvm-svn: 309664
2017-08-01 07:34:26 +00:00
Sean Callanan 558e52c108 [build-script] Bring in modernizations from downstream:
- Don't do any checks of the current SCM repository if the
  llvm repositories are already there.  Useful for bots.
- When symlinking, remove old symlinks.
- Support loading build-script as a library, not necessarily
  under Xcode.
- Stringify args before passing them to subprocess.

llvm-svn: 309631
2017-07-31 21:50:00 +00:00
Chris Bieneman 7f47b85c52 [CMake] Rework construction of framework bundle
This adds an explicit step for processing the headers and restructures how the framework bundles are constructed. This should make the frameworks more reliably constructed.

llvm-svn: 309024
2017-07-25 20:30:58 +00:00
Bruce Mitchener ccbf7987a3 Expose hit count via SBBreakpointLocation.
Summary:
SBBreakpointLocation exposed the ignore count, but didn't expose
the hit count. Both values were exposed by SBBreakpoint and
SBWatchpoint, so this makes things a bit more consistent.

Reviewers: lldb-commits

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D31283

llvm-svn: 308480
2017-07-19 14:31:19 +00:00
Bruce Mitchener e54a9a268d Fix typos in documentation.
Reviewers: lldb-commits

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D31282

llvm-svn: 308426
2017-07-19 09:35:58 +00:00
Pavel Labath 0e44cff13b Make scripts/analyze-project-deps.py executable
llvm-svn: 306669
2017-06-29 13:02:15 +00:00
Sean Callanan 5805d9e9ac [build system] If there's an OVERRIDE, don't guess the current SCM.
This makes automatic checkout work even in situations where the
current repository can't be determined, such as in the case of a 
Git tag.

llvm-svn: 306460
2017-06-27 20:35:53 +00:00
Zachary Turner 10a601adb2 Fix a python object leak in SWIG glue.
PyObject_CallFunction returns a PyObject which needs to be
decref'ed when it is no longer needed.

Patch by David Luyer
Differential Revision: https://reviews.llvm.org/D33740

llvm-svn: 305873
2017-06-21 01:52:37 +00:00
Pavel Labath 054243f75a [swig] Improve the native module import logic
The simple module import logic was not sufficient for our distribution
model of lldb, which is without the _lldb.pyd file (normally that would
be a symlink to the shared library, but symlinks are not really a thing
on windows).

With the older swigs it worked (loading of the python scripting
machinery from within lldb) because the normal swig import logic
contained a last-ditch import of a global module _lldb (which is defined
when you run python from lldb). Add back the last-ditch import to our
custom import logic as well.

llvm-svn: 305461
2017-06-15 11:23:22 +00:00
Abhishek Aggarwal 5bfee5f1c8 Added new API to SBStructuredData class
Summary:
 - Added API to access data types
    -- integer, double, array, string, boolean and dictionary data types
    -- Earlier user had to parse through the string output to get these
       values

 - Added Test cases for API testing

 - Added new StructuredDataType enum in public include file
   -- Replaced locally-defined enum in StructuredData.h with this new
      one       
   -- Modified other internal files using this locally-defined enum

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>

Reviewers: clayborg, lldb-commits

Reviewed By: clayborg

Subscribers: labath

Differential Revision: https://reviews.llvm.org/D33434

llvm-svn: 304138
2017-05-29 08:25:46 +00:00
Pavel Labath b8372cfa33 Add support for new (3.0.11+) swigs
Summary:
A change in swig 3.0.9 has caused it to generate modules incompatible
with us using them as __init__.py (bug #769). Swig 3.0.11 adds a setting to help
fix this problem, so use that. Support for older versions of swig remains
unaffected.

Reviewers: zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D33409

llvm-svn: 303627
2017-05-23 10:55:17 +00:00
Lang Hames a088f2fbcc Import sys in repo.py.
The find function in repo.py calls sys.exit on error. Without this import that
call to exit will fail, masking the actual error message. This patch fixes that.

llvm-svn: 302584
2017-05-09 20:37:01 +00:00
Nitesh Jain dd12594345 [LLDB][MIPS] Fix TestStepOverBreakpoint.py failure.
Reviewers: jingham, labath

Subscribers: jaydeep, bhushan, lldb-commits, slthakur

Differential Revision: https://reviews.llvm.org/D32168

llvm-svn: 302139
2017-05-04 11:34:42 +00:00
Ravitheja Addepally d5d8d91c1d Initial implementation of SB APIs for Tracing support.
Summary:
This patch introduces new SB APIs for tracing support
inside LLDB. The idea is to gather trace data from
LLDB and provide it through this APIs to external
tools integrating with LLDB. These tools will be
responsible for interpreting and presenting the
trace data to their users.

The patch implements the following new SB APIs ->
-> StartTrace - starts tracing with given parameters
-> StopTrace - stops tracing.
-> GetTraceData - read the trace data .
-> GetMetaData - read the meta data assosciated with the trace.
-> GetTraceConfig - read the trace configuration

Tracing is associated with a user_id that is returned
by the StartTrace API and this id needs to be used
for accessing the trace data and also Stopping
the trace. The user_id itself may map to tracing
the complete process or just an individual thread.
The APIs require an additional thread parameter
when the user of these APIs wishes to perform
thread specific manipulations on the tracing instances.
The patch also includes the corresponding
python wrappers for the C++ based APIs.

Reviewers: k8stone, lldb-commits, clayborg

Reviewed By: clayborg

Subscribers: jingham, mgorny

Differential Revision: https://reviews.llvm.org/D29581

llvm-svn: 301389
2017-04-26 08:48:50 +00:00
Jim Ingham bdbdd22937 Teach SBFrame how to guess its language.
<rdar://problem/31411646>

llvm-svn: 300012
2017-04-12 00:19:54 +00:00
Zachary Turner bbd17224d8 [analyze deps] Show incoming and outgoing counts on island members.
llvm-svn: 298535
2017-03-22 18:23:14 +00:00
Zachary Turner 84a6218fbe [analyze deps] Also show cycle islands.
We currently display a list of all minimal cycles, but it's
useful to be able to see the big picture impact of these cycles
by merging them all together into groups of interconnected
components.

Because the cycle discovery algorithm only considers "minimal"
cycles, it discards all information for dependencies which are
not considered part of the minimal cycle.  So all we know is that
the components of each island definitely all depend on each other
but it's still possible that there are hidden dependencies due
to transitive includes.

The cycle list should still be the authoritative reference for
deciding where the easiest places to break cycles are, though.

llvm-svn: 298530
2017-03-22 18:04:20 +00:00
Zachary Turner 4dbf9fa0d4 [deps script] Sort cycles by the difficulty of breaking.
When passing --discover-cycles and --show-counts, it displays
the number of dependencies between each hop of the cycle,
and sorts by the sum.  Dependencies at the top of the list
should be the easiest to break.

llvm-svn: 298455
2017-03-21 22:46:46 +00:00
Zachary Turner 7e3050ca1a [analyze-project-deps.py] Add the ability to list all cycles.
This analyzes the dependency graph and computes all minimal
cycles.  Equivalent cycles that differ only by rotation are
excluded, as are cycles that are "super-cycles" of other
smaller cycles.  For example, if we discover the cycle
A -> C -> A, and then later A -> B -> C -> D -> A, this latter
cycle is not considered.  Thus, it is possible that after
eliminating some cycles, new ones will appear.  However,
this is the only way to make the algorithm terminate in
a reasonable amount of time.

llvm-svn: 298324
2017-03-20 23:54:26 +00:00
Zachary Turner 1d752974c1 A few improvements to deps analysis scripts.
1) Looks in Plugins and clang
2) Adds a mode to display the deps sorted by the number of times
   the deps occurs in a particular project

llvm-svn: 297036
2017-03-06 17:41:00 +00:00
Zachary Turner e030d10b62 Fix line endings of deps analysis script.
llvm-svn: 297035
2017-03-06 17:40:36 +00:00
Zachary Turner 8cb0a4901d Fix a bug in the dep analysis script.
It wasn't always normalizing slashes correctly, so you'd end
up with the same thing in the map twice.

llvm-svn: 296947
2017-03-04 01:31:29 +00:00
Sean Callanan 56435c91c9 Fixed repo.py to not send git errors to stderr.
Some repos are not git repos, so git is expected 
to fail.  These errors should not go to stderr,
because Xcode interprets them as failures.

llvm-svn: 296924
2017-03-03 23:13:30 +00:00
Zachary Turner 5013eb9e1a Add a script to dump out all project inter-dependencies.
llvm-svn: 296920
2017-03-03 22:40:46 +00:00
Sean Callanan efe5d5fe9d Changed builld-llvm.py to use .json files
LLDB has many branches in a variety of repositories.
The build-script.py file is subtly different for each set.
This is unnecessary and causes merge headaches.

This patch makes build-llvm.py consult a directory full 
of .json files, each one of which matches a particular
branch using a regular expression.

This update to the patch introduces a FALLBACK file
whose contents take precedence if the current branch
could not be identified.  If the current branch could be
identified, FALLBACK is updated, allowing the user to
e.g. cut branches off of known branches and still have
the automatic checkout mechanism work.

It also documents all of this.

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

llvm-svn: 295922
2017-02-23 02:21:34 +00:00
Sean Callanan 3b7c7e1d64 Reverted 295897 pending refinements and fixes for green-dragon.
llvm-svn: 295915
2017-02-23 00:46:30 +00:00
Sean Callanan ff1fb7f846 Changed builld-llvm.py to use .json files
LLDB has many branches in a variety of repositories.
The build-script.py file is subtly different for each set.
This is unnecessary and causes merge headaches.

This patch makes build-llvm.py consult a directory full 
of .json files, each one of which matches a particular
branch using a regular expression.

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

llvm-svn: 295897
2017-02-22 22:57:59 +00:00
Kamil Rytarowski 4791532830 Install six.py conditionally
Summary:
The current version of LLDB installs six.py into global python library directory. This approach produces conflicts downstream with distribution's py-six copy.

Introduce new configure option LLDB_USE_SYSTEM_SIX (disabled by default). Once specified as TRUE, six.py won't be installed to Python's directory.

Add new option in finishSwigWrapperClasses.py, namely --useSystemSix.

Sponsored by <The NetBSD Foundation>

Reviewers: mgorny, emaste, clayborg, joerg, labath

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29405

llvm-svn: 294071
2017-02-04 00:20:24 +00:00
Jason Molenda 753e13c0eb Add logging to SBThread::GetInfoItemByPathAsString to
print the path being requested.

Change the GetInfoItemByPathAsString docuemtnation in 
the .i file to use docstring instead of autodoc so
the function signature is included in the python
help.
<rdar://problem/29999567> 

llvm-svn: 293858
2017-02-02 03:02:51 +00:00
Zachary Turner 5a4167fbd3 Install lldb Python module on Windows.
Patch by Vadim Chugunov
Differential Revision: https://reviews.llvm.org/D27476

llvm-svn: 291291
2017-01-06 22:05:35 +00:00
Sylvestre Ledru 521d7b45ba Fix the cmake declaration syntax
llvm-svn: 290045
2016-12-17 13:04:35 +00:00
Sylvestre Ledru 47b071deff Support of lldb on Kfreebsd
Summary: Patch by Pino Toscano. Reported in http://bugs.debian.org/835665

Reviewers: tfiala, emaste

Subscribers: beanz, mgorny, emaste, krytarowski, brucem, tberghammer, danalbert, srhines, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D23977

llvm-svn: 290044
2016-12-17 12:48:06 +00:00
Luke Drummond c3d0165c49 Fix broken escaping of commands in the build
A combination of broken escaping in CMake and in the python swig
generation scripts meant that the swig generation step would fail
whenever there were spaces or special characters in parameters passed to
swig.

The fix for this in CMakeLists is to use the VERBATIM option on all
COMMAND-based custom builders relying on CMake to properly escape each
argument in the generated file.

Within the python swig scripts, the fix is to call subprocess.Popen with
a list of raw argument strings rather than ones that are incorrectly
manually escaped, then passed to a shell subprocess via
subprocess.Popen(' '.join(params)). This also prevents nasty things
happening such as accidental command-injection.

This allows us to have the swig / python executables in paths containing
special chars and spaces, (or on shared storage on Win32, e.g
\\some\path or C:\Program Files\swig\swig.exe).

Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D26757

llvm-svn: 289956
2016-12-16 16:38:25 +00:00
Sean Callanan 237c3ed95e Adopt PrettyStackTrace in LLDB
LLDB needs some minor changes to adopt PrettyStackTrace after https://reviews.llvm.org/D27683.
We remove our own SetCrashDescription() function and use LLVM-provided RAII objects instead.
We also make sure LLDB doesn't define __crashtracer_info__ which would collide with LLVM's definition.

Differential Revision: https://reviews.llvm.org/D27735

llvm-svn: 289711
2016-12-14 21:31:31 +00:00
Pavel Labath 7a6252158e Clean up some use of __ANDROID_NDK__ in the cmake files
Rationale:
scripts/Python/modules: android is excluded at a higher level, so no point in
  checking here
tools/lldb-mi: lldb-mi builds fine (with some cosmetic tweaks) on android, and
  there is no reason it shouldn't.
tools/lldb-server: LLDB_DISABLE_LIBEDIT/CURSES already take the platform into
  account, so there is no point in checking again.

I am reasonably confident this should not break the build on any platform, but
I'll keep an eye out on the bots.

llvm-svn: 288661
2016-12-05 11:15:36 +00:00
Jim Ingham 6a9767c7e6 Clean up the stop printing header lines.
I added a "thread-stop-format" to distinguish between the form
that is just the thread info (since the stop printing immediately prints
the frame info) and one with more frame 0 info - which is useful for
"thread list" and the like.

I also added a frame.no-debug boolean to the format entities so you can
print frame information differently between frames with source info and those
without.

This closes https://reviews.llvm.org/D26383.
<rdar://problem/28273697>

llvm-svn: 286288
2016-11-08 20:36:40 +00:00
Chris Bieneman 91967bd301 [CMake] Rename lldb-launcher to darwin-debug
Summary: This tool is only built on Darwin, and the name darwin-debug matches the Xcode project. We should have this in sync unless there is a good reason not to.

Reviewers: zturner, tfiala, labath

Subscribers: labath, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D25745

llvm-svn: 285356
2016-10-27 22:51:41 +00:00
Vadim Macagon bdff2dc8d7 Fix Python binding generation build step on Windows
Summary:
If Python is installed to a location that contains spaces
(e.g. "C:\Program Files\Python3") then the build fails while attempting
to run the modify-python-lldb.py script because the path to the Python
executable is not double-quoted before being passed to the shell. The
fix consists of letting Python handle the formatting of the command
line, since subprocess.Popen() is perfectly capable of handling paths
containing spaces if it's given the command and arguments as a list
instead of a single pre-formatted string.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D25396

llvm-svn: 284100
2016-10-13 04:07:22 +00:00
Enrico Granata f8802502f2 Add an accessor to get the value of RC_PLATFORM_NAME at build time
llvm-svn: 282310
2016-09-23 22:30:08 +00:00
Jim Ingham 2d3628e1f0 Add the ability to append breakpoints to the save file.
llvm-svn: 282212
2016-09-22 23:42:42 +00:00
Jim Ingham 3acdf38519 Add the ability to deserialize only breakpoints matching a given name.
Also tests for this and the ThreadSpec serialization.

llvm-svn: 282207
2016-09-22 22:20:28 +00:00
Enrico Granata 5edef42e7f Actually, do it this way because I will want to know if I am in a host build elsewhere too
llvm-svn: 282179
2016-09-22 17:59:58 +00:00
Enrico Granata 9a4a6b260f The host version of lldb always builds for macosx
llvm-svn: 282178
2016-09-22 17:47:33 +00:00
Chris Bieneman d3199f5ed2 [CMake] Initial support for LLDB.framework
Summary:
This patch adds a CMake option LLDB_BUILD_FRAMEWORK, which builds libLLDB as a macOS framework instead of as a *nix shared library.

With this patch any LLDB executable that has the INCLUDE_IN_FRAMEWORK option set will be built into the Framework's resources directory, and a symlink to the exeuctable will be placed under the build directory's bin folder. Creating the symlinks allows users to run commands from the build directory without altering the workflow.

The framework generated by this patch passes the LLDB test suite, but has not been tested beyond that. It is not expected to be fully ready to ship, but it is a first step.

With this patch binaries that are placed inside the framework aren't being properly installed. Fixing that would increase the patch size significantly, so I'd like to do that in a follow-up.

Reviewers: zturner, tfiala

Subscribers: beanz, lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D24749

llvm-svn: 282110
2016-09-21 21:02:16 +00:00
Todd Fiala 9666ba7526 add stop column highlighting support
This change introduces optional marking of the column within a source
line where a thread is stopped.  This marking will show up when the
source code for a thread stop is displayed, when the debug info
knows the column information, and if the optional column marking is
enabled.

There are two separate methods for handling the marking of the stop
column:

* via ANSI terminal codes, which are added inline to the source line
  display.  The default ANSI mark-up is to underline the column.

* via a pure text-based caret that is added in the appropriate column
  in a newly-inserted blank line underneath the source line in
  question.

There are some new options that control how this all works.

* settings set stop-show-column

  This takes one of 4 values:

  * ansi-or-caret: use the ANSI terminal code mechanism if LLDB
    is running with color enabled; if not, use the caret-based,
    pure text method (see the "caret" mode below).

  * ansi: only use the ANSI terminal code mechanism to highlight
    the stop line.  If LLDB is running with color disabled, no
    stop column marking will occur.

  * caret: only use the pure text caret method, which introduces
    a newly-inserted line underneath the current line, where
    the only character in the new line is a caret that highlights
    the stop column in question.

  * none: no stop column marking will be attempted.

* settings set stop-show-column-ansi-prefix

  This is a text format that indicates the ANSI formatting
  code to insert into the stream immediately preceding the
  column where the stop column character will be marked up.
  It defaults to ${ansi.underline}; however, it can contain
  any valid LLDB format codes, e.g.

      ${ansi.fg.red}${ansi.bold}${ansi.underline}

* settings set stop-show-column-ansi-suffix

  This is the text format that specifies the ANSI terminal
  codes to end the markup that was started with the prefix
  described above.  It defaults to: ${ansi.normal}.  This
  should be sufficient for the common cases.

Significant leg-work was done by Adrian Prantl.  (Thanks, Adrian!)

differential review: https://reviews.llvm.org/D20835

reviewers: clayborg, jingham
llvm-svn: 282105
2016-09-21 20:13:14 +00:00
Jim Ingham ff9a91ea98 Adds tests for breakpoint names, and a FindBreakpointsByName.
Also if you set a breakpoint with an invalid name, we'll
refuse to set the breakpoint rather than silently ignoring
the name.

llvm-svn: 282043
2016-09-21 01:21:19 +00:00
Jim Ingham 92d1960e3b Add some more tests for breakpoint serialization.
Serialize breakpoint names & the hardware_requested attributes.
Also added a few missing affordances to SBBreakpoint whose absence
writing the tests pointed out.

<rdar://problem/12611863>

llvm-svn: 282036
2016-09-20 22:54:49 +00:00
Todd Fiala ba8a82dbe4 Xcode: support gtests that use the Inputs dir
This change adds support for the gtests that require input data
in the Inputs files.  This is done through a new Xcode script
phase that runs the scripts/Xcode/prepare-gtest-run-dir.sh script.
That script simply copies the contents of all unittests/**/Inputs
dirs into ${TARGET_BUILD_DIR}/Inputs before running the test.

This change also renames the Xcode 'gtest-for-debugging' to
'gtest-build', and makes the gtest "build and run" target
depend on gtest-build.  This reduces replication within the
targets.  gtest .c/.cpp files now should only be added to
the gtest-build target.

llvm-svn: 281913
2016-09-19 16:42:41 +00:00