Commit Graph

229 Commits

Author SHA1 Message Date
Sean Callanan 579e70c9b0 Add a DiagnosticManager replace error streams in the expression parser.
We want to do a better job presenting errors that occur when evaluating
expressions. Key to this effort is getting away from a model where all
errors are spat out onto a stream where the client has to take or leave
all of them.

To this end, this patch adds a new class, DiagnosticManager, which
contains errors produced by the compiler or by LLDB as an expression
is created. The DiagnosticManager can dump itself to a log as well as
to a string. Clients will (in the future) be able to filter out the
errors they're interested in by ID or present subsets of these errors
to the user.

This patch is not intended to change the *users* of errors - only to
thread DiagnosticManagers to all the places where streams are used. I
also attempt to standardize our use of errors a bit, removing trailing
newlines and making clients omit 'error:', 'warning:' etc. and instead
pass the Severity flag.

The patch is testsuite-neutral, with modifications to one part of the
MI tests because it relied on "error: error:" being erroneously
printed. This patch fixes the MI variable handling and the testcase.

<rdar://problem/22864976>

llvm-svn: 263859
2016-03-19 00:03:59 +00:00
Jim Ingham 2411167fb5 Add an "offset" option to "break set -n" and "break set -f -l".
That way you can set offset breakpoints that will move as the function they are 
contained in moves (which address breakpoints can't do...)

I don't align the new address to instruction boundaries yet, so you have to get
this right yourself for now.

<rdar://problem/13365575>

llvm-svn: 263049
2016-03-09 18:59:13 +00:00
Eugene Zelenko c33088f41e Remove autoconf support from source directories.
Differential revision: http://reviews.llvm.org/D16662

llvm-svn: 259098
2016-01-28 22:05:24 +00:00
Jim Ingham a202357197 Make the Language print the description of the Exception Breakpoint resolver. Also
have the breakpoint description print the precondition description if one exists.
No behavior change.

<rdar://problem/22885189>

llvm-svn: 255972
2015-12-18 02:14:04 +00:00
Dawn Perchik bfd96183ef Rework breakpoint language filtering to use the symbol context's language.
This patch reworks the breakpoint filter-by-language patch to use the
symbol context instead of trying to guess the language solely from the
symbol's name. This has the advantage that symbols compiled with debug
info will have their actual language known. Symbols without debug info
will still do the same "guess"ing because Symbol::GetLanguage() is
implemented using Mangled::GuessLanguage(). The recognition of ObjC
names was merged into Mangled::GuessLanguage.

Reviewed by: jingham, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15326

llvm-svn: 255808
2015-12-16 19:40:00 +00:00
Ted Woodward 65a47b31b3 Fix watchpoint check to use watchpoint ranges
Summary: Watchpoints, unlike breakpoints, have an address range. This patch changes WatchpointList::FindByAddress() to match on any address in the watchpoint range, instead of only matching on the watchpoint's base address.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 254931
2015-12-07 19:38:58 +00:00
Dawn Perchik f268357514 Fix breakpoint language filtering for other C variants (like C99) and Pascal.
This patch fixes setting breakpoints on symbol for variants of C and
Pascal where the language is "unknown" within the filter-by-language
process added in r252356. It also renames GetLanguageForSymbolByName to
GuessLanguageForSymbolByName and adds comments explaining the pitfalls
of the flawed assumption that the language can be determined solely from
the name and target.

Reviewed by: jingham
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15175

llvm-svn: 254753
2015-12-04 19:34:00 +00:00
Jim Ingham 055a08a488 Add the ability (through the SB API & command line) to specify an address
breakpoint as "file address" so that the address breakpoint will track that
module even if it gets loaded in a different place.  Also fixed the Address
breakpoint resolver so that it handles this tracking correctly.

llvm-svn: 253308
2015-11-17 03:39:13 +00:00
Jim Ingham 0fcdac363c Make the language specifier to "break set" actually filter the names by their language. So for
instance:

break set -l c++ -r Name

will only break on C++ symbols that match Name, not ObjC or plain C symbols.  This also works
for "break set -n" and there are SB API's to pass this as well.

llvm-svn: 252356
2015-11-06 22:48:59 +00:00
Mohit K. Bhakkad 13763c3046 [LLDB][Watchpoint] Change ignore_count condition location to fix watchpoint ignore feature for architectures with watchpoint_exceptions_received=before
Reviewers: jingham.
Subscribers: clayborg, jaydeep, bhushan, sagar, nitesh.jain, lldb-commits.
Differential Revision: http://reviews.llvm.org/D13296

llvm-svn: 251905
2015-11-03 09:04:33 +00:00
Jim Ingham 19a63fc6fa Add the ability to pass an EvaluateExpressionOptions when you make a UserExpression. This
isn't used in this commit but will be in a future commit.

llvm-svn: 251887
2015-11-03 02:11:24 +00:00
Jim Ingham 98e6daf1fb Abstract the notion of the truth value of an expression result, for use
in breakpoint conditions.

llvm-svn: 251727
2015-10-31 00:02:18 +00:00
Eugene Zelenko 16fd7511b2 Fix Clang-tidy modernize-use-nullptr warnings in source/Breakpoint; other minor fixes.
llvm-svn: 251716
2015-10-30 18:50:12 +00:00
Mohit K. Bhakkad 18af8a20c5 [LLDB] Fix display of value of a vector variables in watchpoint operations
Reviewers: clayborg, zturner.
Subscribers: jaydeep, bhushan, sagar, nitesh.jain, brucem,lldb-commits.
Differential Revision: http://reviews.llvm.org/D13202

llvm-svn: 249838
2015-10-09 15:13:20 +00:00
Bruce Mitchener 937e3964e2 Further reduction of Clang-related header inclusion.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 248176
2015-09-21 16:56:08 +00:00
Jim Ingham 151c032c86 This patch makes Clang-independent base classes for all the expression types that lldb currently vends.
Before we had:

ClangFunction
ClangUtilityFunction
ClangUserExpression

and code all over in lldb that explicitly made Clang-based expressions. This patch adds an Expression 
base class, and three pure virtual implementations for the Expression kinds:

FunctionCaller
UtilityFunction
UserExpression

You can request one of these expression types from the Target using the Get<ExpressionType>ForLanguage. 
The Target will then consult all the registered TypeSystem plugins, and if the type system that matches 
the language can make an expression of that kind, it will do so and return it.

Because all of the real expression types need to communicate with their ExpressionParser in a uniform way, 
I also added a ExpressionTypeSystemHelper class that expressions generically can vend, and a ClangExpressionHelper 
that encapsulates the operations that the ClangExpressionParser needs to perform on the ClangExpression types. 
Then each of the Clang* expression kinds constructs the appropriate helper to do what it needs.

The patch also fixes a wart in the UtilityFunction that to use it you had to create a parallel FunctionCaller 
to actually call the function made by the UtilityFunction. Now the UtilityFunction can be asked to vend a 
FunctionCaller that will run its function. This cleaned up a lot of boiler plate code using UtilityFunctions.

Note, in this patch all the expression types explicitly depend on the LLVM JIT and IR, and all the common 
JIT running code is in the FunctionCaller etc base classes. At some point we could also abstract that dependency 
but I don't see us adding another back end in the near term, so I'll leave that exercise till it is actually necessary.

llvm-svn: 247720
2015-09-15 21:13:50 +00:00
Sean Callanan bc8ac34e61 This patch separates the generic portion of ClangExpressionVariable, which
stores information about a variable that different parts of LLDB use, from the
compiler-specific portion that only the expression parser cares about.

http://reviews.llvm.org/D12602

llvm-svn: 246871
2015-09-04 20:49:51 +00:00
Bruce Mitchener db25a7a245 [cmake] Remove LLVM_NO_RTTI.
Summary:
This doesn't exist in other LLVM projects any longer and doesn't
do anything.

Reviewers: chaoren, labath

Subscribers: emaste, tberghammer, lldb-commits, danalbert

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

llvm-svn: 246749
2015-09-03 08:46:55 +00:00
Jim Ingham aa816b8f3b Move more functionality from the LanguageRuntimes to the Languages.
llvm-svn: 246616
2015-09-02 01:59:14 +00:00
Greg Clayton 99558cc424 Final bit of type system cleanup that abstracts declaration contexts into lldb_private::CompilerDeclContext and renames ClangType to CompilerType in many accessors and functions.
Create a new "lldb_private::CompilerDeclContext" class that will replace all direct uses of "clang::DeclContext" when used in compiler agnostic code, yet still allow for conversion to clang::DeclContext subclasses by clang specific code. This completes the abstraction of type parsing by removing all "clang::" references from the SymbolFileDWARF. The new "lldb_private::CompilerDeclContext" class abstracts decl contexts found in compiler type systems so they can be used in internal API calls. The TypeSystem is required to support CompilerDeclContexts with new pure virtual functions that start with "DeclContext" in the member function names. Converted all code that used lldb_private::ClangNamespaceDecl over to use the new CompilerDeclContext class and removed the ClangNamespaceDecl.cpp and ClangNamespaceDecl.h files.

Removed direct use of clang APIs from SBType and now use the abstract type systems to correctly explore types.

Bulk renames for things that used to return a ClangASTType which is now CompilerType:

    "Type::GetClangFullType()" to "Type::GetFullCompilerType()"
    "Type::GetClangLayoutType()" to "Type::GetLayoutCompilerType()"
    "Type::GetClangForwardType()" to "Type::GetForwardCompilerType()"
    "Value::GetClangType()" to "Value::GetCompilerType()"
    "Value::SetClangType (const CompilerType &)" to "Value::SetCompilerType (const CompilerType &)"
    "ValueObject::GetClangType ()" to "ValueObject::GetCompilerType()"
    many more renames that are similar.

llvm-svn: 245905
2015-08-24 23:46:31 +00:00
Greg Clayton a1e5dc86a6 ClangASTType is now CompilerType.
This is more preparation for multiple different kinds of types from different compilers (clang, Pascal, Go, RenderScript, Swift, etc).

llvm-svn: 244689
2015-08-11 22:53:00 +00:00
Jim Ingham 9d1ccdaf7e Add a function to make a mutex-protected copy of a breakpoint site's
owners list, so the StopInfo machinery can get the list of owners without
some other thread being able to mess up the list by deleting/disabline one of its
locations in the process of doing so.

<rdar://problem/18685197>

llvm-svn: 243541
2015-07-29 17:51:36 +00:00
Jim Ingham ff244c1d97 Lock the owners mutex in the BreakpointSite before updating the hit
counts.  If you delete a breakpoint belonging to a site just as you are
processing a hit on that site, you could cause the BreakpointSite loop to
access a now deleted location.

<rdar://problem/19310323>

llvm-svn: 243507
2015-07-29 00:40:36 +00:00
Dawn Perchik 23b1decbe7 Add support for specifying a language to use when parsing breakpoints.
Target and breakpoints options were added:
    breakpoint set --language lang --name func
    settings set target.language pascal
These specify the Language to use when interpreting the breakpoint's
expression (note: currently only implemented for breakpoints on
identifiers).  If the breakpoint language is not set, the target.language
setting is used.
This support is required by Pascal, for example, to set breakpoint at 'ns.foo'
for function 'foo' in namespace 'ns'.
Tests on the language were also added to Module::PrepareForFunctionNameLookup
for efficiency.

Reviewed by: clayborg
Subscribers: jingham, lldb-commits
Differential Revision: http://reviews.llvm.org/D11119

llvm-svn: 242844
2015-07-21 22:05:07 +00:00
Greg Clayton ddaf6a7259 Make many mangled functions that might demangle a name be allowed to specify a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so.
llvm-svn: 241751
2015-07-08 22:32:23 +00:00
Zachary Turner 1124045ac7 Don't #include "lldb-python.h" from anywhere.
Since interaction with the python interpreter is moving towards
being more isolated, we won't be able to include this header from
normal files anymore, all includes of it should be localized to
the python library which will live under source/bindings/API/Python
after a future patch.

None of the files that were including this header actually depended
on it anyway, so it was just a dead include in every single instance.

llvm-svn: 238581
2015-05-29 17:41:47 +00:00
Tamas Berghammer 729dcfb7ee Fix BreakpointLocationCollection::ShouldStop to handle breakpoint removal
Differential revision: http://reviews.llvm.org/D9886

llvm-svn: 238308
2015-05-27 09:46:47 +00:00
Ilia K 055ad9beba Add --move-to-nearest-code / target.move-to-nearest-code options (attempt 2)
This patch initially was committed in r237460 but later it was reverted (r237479) due to 4 new failures:
* TestExitDuringStep.py
* TestNumThreads.py
* TestThreadExit.py
* TestThreadStates.py

This patch also fixes these tests.

llvm-svn: 237566
2015-05-18 13:41:01 +00:00
Vince Harron a66c695340 Reverting r237460 to fix test failures introduced on OSX & Linux
TestExitDuringStep.py
TestNumThreads.py
TestThreadExit.py
TestThreadStates.py

llvm-svn: 237479
2015-05-15 21:43:26 +00:00
Ilia K d9f1a78aa0 Add --move-to-nearest-code / target.move-to-nearest-code options
Summary:
This option forces to only set a source line breakpoint when there is an exact-match

This patch includes the following commits:
# Add the -m/--exact-match option in "breakpoint set" command
## Add exact_match arg in BreakpointResolverFileLine ctor
## Add m_exact_match field in BreakpointResolverFileLine
## Add exact_match arg in BreakpointResolverFileRegex ctor
## Add m_exact_match field in BreakpointResolverFileRegex
## Add exact_match arg in Target::CreateSourceRegexBreakpoint
## Add exact_match arg in Target::CreateBreakpoint
## Add -m/--exact-match option in "breakpoint set" command
# Add target.exact-match option to skip BP if source line doesn't match
## Add target.exact-match global option
## Add Target::GetExactMatch
## Refactor Target::CreateSourceRegexBreakpoint to accept LazyBool exact_match (was bool)
## Refactor Target::CreateBreakpoint to accept LazyBool exact_match (was bool)
# Add target.exact-match test in SettingsCommandTestCase
# Add BreakpointOptionsTestCase tests to test --skip-prologue/--exact-match options
# Fix a few typos in lldbutil.check_breakpoint_result func
# Rename --exact-match/m_exact_match/exact_match/GetExactMatch to --move-to-nearest-code/m_move_to_nearest_code/move_to_nearest_code/GetMoveToNearestCode
# Add exact_match field in BreakpointResolverFileLine::GetDescription and BreakpointResolverFileRegex::GetDescription, for example:
was:
```
1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, locations = 1, resolved = 1, hit count = 2
  1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2
```
now:
```
1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, exact_match = 0, locations = 1, resolved = 1, hit count = 2
  1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2
```

Test Plan:
./dotest.py -v --executable $BUILDDIR/bin/lldb functionalities/breakpoint/
./dotest.py -v --executable $BUILDDIR/bin/lldb settings/
./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/breakpoint/

Reviewers: jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, jingham

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

llvm-svn: 237460
2015-05-15 18:16:15 +00:00
Jim Ingham a72b31c79e This is some groundwork for filtering the language Exception
breakpoints, for instance on the class of the thrown object.

This change doesn't actually make that work, the part where we
extract the thrown object type from the throw site isn't done yet.

This provides a general programmatic "precondition" that you can add
to breakpoints to give them the ability to do filtering on the LLDB
side before we pass the stop on to the user-provided conditions & 
callbacks.

llvm-svn: 235538
2015-04-22 19:42:18 +00:00
Ilia K 9b618d25ca Generate an event when a pending breakpoint binds
Summary:
This checkin sends an MI event when a module is loaded that causes a pending breakpoint to bind to it's real address in the target. This allows breakpoints to be set before the process is launched, and the target address of the BP to be discovered when the module loads, prior to the breakpoint being hit. 

Patch from chuckr@microsoft.com

Test Plan:
I ran the check-lldb target with and without this patch and saw no change. I am unsure of how to write an MI specific test for this because the new event is buried in module load events. Here is an example (the new event is in bold):


```
(gdb)
-file-exec-and-symbols a.out
^done
(gdb)
=shlibs-added,shlib-info=[num="1",name="a.out",dyld-addr="-",reason="dyld",path="/Users/chuckr/llama/llvm/tools/lldb/test/tools/lldb-mi/a.out",loaded_addr="-",dsym-objpath="/Users/chuckr/llama/llvm/tools/lldb/test/tools/lldb-mi/a.out.dSYM/Contents/Resources/DWARF/a.out"]
-break-insert -f main.cpp:15
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffffffffffff",func="main",file="main.cpp",fullname="/Users/chuckr/llama/llvm/tools/lldb/test/tools/lldb-mi/main.cpp",line="15",pending=["main.cpp:15"],times="0",original-location="main.cpp:15"}
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0xffffffffffffffff",func="main",file="main.cpp",fullname="/Users/chuckr/llama/llvm/tools/lldb/test/tools/lldb-mi/main.cpp",line="15",pending=["main.cpp:15"],times="0",original-location="main.cpp:15"}
-exec-run
^running
=thread-group-started,id="i1",pid="75620"
(gdb)
=thread-created,id="1",group-id="i1"
=thread-selected,id="1"
(gdb)
=shlibs-added,shlib-info=[num="2",name="dyld",dyld-addr="0x7fff5fc00000",reason="dyld",path="/usr/lib/dyld",loaded_addr="0x7fff5fc00000"]
(gdb)
=shlibs-added,shlib-info=[num="3",name="dyld",dyld-addr="0x7fff5fc00000",reason="dyld",path="/usr/lib/dyld",loaded_addr="0x7fff5fc00000"]
(gdb)
*running,thread-id="all"
(gdb)
(gdb)
=shlibs-added,shlib-info=[num="4",name="libc++.1.dylib",dyld-addr="0x7fff85dd0000",reason="dyld",path="/usr/lib/libc++.1.dylib",loaded_addr="0x7fff85dd0000"]
(gdb)
=shlibs-added,shlib-info=[num="5",name="libSystem.B.dylib",dyld-addr="0x7fff851ab000",reason="dyld",path="/usr/lib/libSystem.B.dylib",loaded_addr="0x7fff851ab000"]
(gdb)
=shlibs-added,shlib-info=[num="6",name="libc++abi.dylib",dyld-addr="0x7fff81be8000",reason="dyld",path="/usr/lib/libc++abi.dylib",loaded_addr="0x7fff81be8000"]
(gdb)
=shlibs-added,shlib-info=[num="7",name="libcache.dylib",dyld-addr="0x7fff8b975000",reason="dyld",path="/usr/lib/system/libcache.dylib",loaded_addr="0x7fff8b975000"]
(gdb)
=shlibs-added,shlib-info=[num="8",name="libcommonCrypto.dylib",dyld-addr="0x7fff85d14000",reason="dyld",path="/usr/lib/system/libcommonCrypto.dylib",loaded_addr="0x7fff85d14000"]
(gdb)
=shlibs-added,shlib-info=[num="9",name="libcompiler_rt.dylib",dyld-addr="0x7fff86154000",reason="dyld",path="/usr/lib/system/libcompiler_rt.dylib",loaded_addr="0x7fff86154000"]
(gdb)
=shlibs-added,shlib-info=[num="10",name="libcopyfile.dylib",dyld-addr="0x7fff81ac7000",reason="dyld",path="/usr/lib/system/libcopyfile.dylib",loaded_addr="0x7fff81ac7000"]
(gdb)
=shlibs-added,shlib-info=[num="11",name="libcorecrypto.dylib",dyld-addr="0x7fff87d5d000",reason="dyld",path="/usr/lib/system/libcorecrypto.dylib",loaded_addr="0x7fff87d5d000"]
(gdb)
=shlibs-added,shlib-info=[num="12",name="libdispatch.dylib",dyld-addr="0x7fff8ea8c000",reason="dyld",path="/usr/lib/system/libdispatch.dylib",loaded_addr="0x7fff8ea8c000"]
(gdb)
=shlibs-added,shlib-info=[num="13",name="libdyld.dylib",dyld-addr="0x7fff89087000",reason="dyld",path="/usr/lib/system/libdyld.dylib",loaded_addr="0x7fff89087000"]
(gdb)
=shlibs-added,shlib-info=[num="14",name="libkeymgr.dylib",dyld-addr="0x7fff8e818000",reason="dyld",path="/usr/lib/system/libkeymgr.dylib",loaded_addr="0x7fff8e818000"]
(gdb)
=shlibs-added,shlib-info=[num="15",name="liblaunch.dylib",dyld-addr="0x7fff84936000",reason="dyld",path="/usr/lib/system/liblaunch.dylib",loaded_addr="0x7fff84936000"]
(gdb)
=shlibs-added,shlib-info=[num="16",name="libmacho.dylib",dyld-addr="0x7fff8534e000",reason="dyld",path="/usr/lib/system/libmacho.dylib",loaded_addr="0x7fff8534e000"]
(gdb)
=shlibs-added,shlib-info=[num="17",name="libquarantine.dylib",dyld-addr="0x7fff90f97000",reason="dyld",path="/usr/lib/system/libquarantine.dylib",loaded_addr="0x7fff90f97000"]
(gdb)
=shlibs-added,shlib-info=[num="18",name="libremovefile.dylib",dyld-addr="0x7fff8ccb5000",reason="dyld",path="/usr/lib/system/libremovefile.dylib",loaded_addr="0x7fff8ccb5000"]
(gdb)
=shlibs-added,shlib-info=[num="19",name="libsystem_asl.dylib",dyld-addr="0x7fff8df67000",reason="dyld",path="/usr/lib/system/libsystem_asl.dylib",loaded_addr="0x7fff8df67000"]
(gdb)
=shlibs-added,shlib-info=[num="20",name="libsystem_blocks.dylib",dyld-addr="0x7fff8621c000",reason="dyld",path="/usr/lib/system/libsystem_blocks.dylib",loaded_addr="0x7fff8621c000"]
(gdb)
=shlibs-added,shlib-info=[num="21",name="libsystem_c.dylib",dyld-addr="0x7fff83c0f000",reason="dyld",path="/usr/lib/system/libsystem_c.dylib",loaded_addr="0x7fff83c0f000"]
(gdb)
=shlibs-added,shlib-info=[num="22",name="libsystem_configuration.dylib",dyld-addr="0x7fff8fd71000",reason="dyld",path="/usr/lib/system/libsystem_configuration.dylib",loaded_addr="0x7fff8fd71000"]
(gdb)
=shlibs-added,shlib-info=[num="23",name="libsystem_coreservices.dylib",dyld-addr="0x7fff8a028000",reason="dyld",path="/usr/lib/system/libsystem_coreservices.dylib",loaded_addr="0x7fff8a028000"]
(gdb)
=shlibs-added,shlib-info=[num="24",name="libsystem_coretls.dylib",dyld-addr="0x7fff90996000",reason="dyld",path="/usr/lib/system/libsystem_coretls.dylib",loaded_addr="0x7fff90996000"]
(gdb)
=shlibs-added,shlib-info=[num="25",name="libsystem_dnssd.dylib",dyld-addr="0x7fff8b71f000",reason="dyld",path="/usr/lib/system/libsystem_dnssd.dylib",loaded_addr="0x7fff8b71f000"]
(gdb)
=shlibs-added,shlib-info=[num="26",name="libsystem_info.dylib",dyld-addr="0x7fff8b9f2000",reason="dyld",path="/usr/lib/system/libsystem_info.dylib",loaded_addr="0x7fff8b9f2000"]
(gdb)
=shlibs-added,shlib-info=[num="27",name="libsystem_kernel.dylib",dyld-addr="0x7fff81ad0000",reason="dyld",path="/usr/lib/system/libsystem_kernel.dylib",loaded_addr="0x7fff81ad0000"]
(gdb)
=shlibs-added,shlib-info=[num="28",name="libsystem_m.dylib",dyld-addr="0x7fff84953000",reason="dyld",path="/usr/lib/system/libsystem_m.dylib",loaded_addr="0x7fff84953000"]
(gdb)
=shlibs-added,shlib-info=[num="29",name="libsystem_malloc.dylib",dyld-addr="0x7fff887bd000",reason="dyld",path="/usr/lib/system/libsystem_malloc.dylib",loaded_addr="0x7fff887bd000"]
(gdb)
=shlibs-added,shlib-info=[num="30",name="libsystem_network.dylib",dyld-addr="0x7fff88304000",reason="dyld",path="/usr/lib/system/libsystem_network.dylib",loaded_addr="0x7fff88304000"]
(gdb)
=shlibs-added,shlib-info=[num="31",name="libsystem_networkextension.dylib",dyld-addr="0x7fff82085000",reason="dyld",path="/usr/lib/system/libsystem_networkextension.dylib",loaded_addr="0x7fff82085000"]
(gdb)
=shlibs-added,shlib-info=[num="32",name="libsystem_notify.dylib",dyld-addr="0x7fff8eb69000",reason="dyld",path="/usr/lib/system/libsystem_notify.dylib",loaded_addr="0x7fff8eb69000"]
(gdb)
=shlibs-added,shlib-info=[num="33",name="libsystem_platform.dylib",dyld-addr="0x7fff89ac7000",reason="dyld",path="/usr/lib/system/libsystem_platform.dylib",loaded_addr="0x7fff89ac7000"]
(gdb)
=shlibs-added,shlib-info=[num="34",name="libsystem_pthread.dylib",dyld-addr="0x7fff83ff8000",reason="dyld",path="/usr/lib/system/libsystem_pthread.dylib",loaded_addr="0x7fff83ff8000"]
(gdb)
=shlibs-added,shlib-info=[num="35",name="libsystem_sandbox.dylib",dyld-addr="0x7fff89084000",reason="dyld",path="/usr/lib/system/libsystem_sandbox.dylib",loaded_addr="0x7fff89084000"]
(gdb)
=shlibs-added,shlib-info=[num="36",name="libsystem_secinit.dylib",dyld-addr="0x7fff8e816000",reason="dyld",path="/usr/lib/system/libsystem_secinit.dylib",loaded_addr="0x7fff8e816000"]
(gdb)
=shlibs-added,shlib-info=[num="37",name="libsystem_stats.dylib",dyld-addr="0x7fff89eaf000",reason="dyld",path="/usr/lib/system/libsystem_stats.dylib",loaded_addr="0x7fff89eaf000"]
(gdb)
=shlibs-added,shlib-info=[num="38",name="libsystem_trace.dylib",dyld-addr="0x7fff8ead4000",reason="dyld",path="/usr/lib/system/libsystem_trace.dylib",loaded_addr="0x7fff8ead4000"]
(gdb)
=shlibs-added,shlib-info=[num="39",name="libunc.dylib",dyld-addr="0x7fff8ab27000",reason="dyld",path="/usr/lib/system/libunc.dylib",loaded_addr="0x7fff8ab27000"]
(gdb)
=shlibs-added,shlib-info=[num="40",name="libunwind.dylib",dyld-addr="0x7fff85cf3000",reason="dyld",path="/usr/lib/system/libunwind.dylib",loaded_addr="0x7fff85cf3000"]
(gdb)
=shlibs-added,shlib-info=[num="41",name="libxpc.dylib",dyld-addr="0x7fff88896000",reason="dyld",path="/usr/lib/system/libxpc.dylib",loaded_addr="0x7fff88896000"]
(gdb)
=shlibs-added,shlib-info=[num="42",name="libobjc.A.dylib",dyld-addr="0x7fff84f13000",reason="dyld",path="/usr/lib/libobjc.A.dylib",loaded_addr="0x7fff84f13000"]
(gdb)
=shlibs-added,shlib-info=[num="43",name="libauto.dylib",dyld-addr="0x7fff85d89000",reason="dyld",path="/usr/lib/libauto.dylib",loaded_addr="0x7fff85d89000"]
(gdb)
=shlibs-added,shlib-info=[num="44",name="libDiagnosticMessagesClient.dylib",dyld-addr="0x7fff822e1000",reason="dyld",path="/usr/lib/libDiagnosticMessagesClient.dylib",loaded_addr="0x7fff822e1000"]
```
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100000f4d",func="main",file="main.cpp",fullname="/Users/chuckr/llama/llvm/tools/lldb/test/tools/lldb-mi/main.cpp",line="15",pending=["main.cpp:15"],times="0",original-location="main.cpp:15"}
```
(gdb)
=shlibs-added,shlib-info=[num="45",name="a.out",dyld-addr="0x100000000",reason="dyld",path="/Users/chuckr/llama/llvm/tools/lldb/test/tools/lldb-mi/a.out",loaded_addr="0x100000000",dsym-objpath="/Users/chuckr/llama/llvm/tools/lldb/test/tools/lldb-mi/a.out.dSYM/Contents/Resources/DWARF/a.out"]
=shlibs-added,shlib-info=[num="46",name="libc++.1.dylib",dyld-addr="0x7fff85dd0000",reason="dyld",path="/usr/lib/libc++.1.dylib",loaded_addr="0x7fff85dd0000"]
=shlibs-added,shlib-info=[num="47",name="libSystem.B.dylib",dyld-addr="0x7fff851ab000",reason="dyld",path="/usr/lib/libSystem.B.dylib",loaded_addr="0x7fff851ab000"]
=shlibs-added,shlib-info=[num="48",name="libc++abi.dylib",dyld-addr="0x7fff81be8000",reason="dyld",path="/usr/lib/libc++abi.dylib",loaded_addr="0x7fff81be8000"]
=shlibs-added,shlib-info=[num="49",name="libcache.dylib",dyld-addr="0x7fff8b975000",reason="dyld",path="/usr/lib/system/libcache.dylib",loaded_addr="0x7fff8b975000"]
=shlibs-added,shlib-info=[num="50",name="libcommonCrypto.dylib",dyld-addr="0x7fff85d14000",reason="dyld",path="/usr/lib/system/libcommonCrypto.dylib",loaded_addr="0x7fff85d14000"]
=shlibs-added,shlib-info=[num="51",name="libcompiler_rt.dylib",dyld-addr="0x7fff86154000",reason="dyld",path="/usr/lib/system/libcompiler_rt.dylib",loaded_addr="0x7fff86154000"]
=shlibs-added,shlib-info=[num="52",name="libcopyfile.dylib",dyld-addr="0x7fff81ac7000",reason="dyld",path="/usr/lib/system/libcopyfile.dylib",loaded_addr="0x7fff81ac7000"]
=shlibs-added,shlib-info=[num="53",name="libcorecrypto.dylib",dyld-addr="0x7fff87d5d000",reason="dyld",path="/usr/lib/system/libcorecrypto.dylib",loaded_addr="0x7fff87d5d000"]
=shlibs-added,shlib-info=[num="54",name="libdispatch.dylib",dyld-addr="0x7fff8ea8c000",reason="dyld",path="/usr/lib/system/libdispatch.dylib",loaded_addr="0x7fff8ea8c000"]
=shlibs-added,shlib-info=[num="55",name="libdyld.dylib",dyld-addr="0x7fff89087000",reason="dyld",path="/usr/lib/system/libdyld.dylib",loaded_addr="0x7fff89087000"]
=shlibs-added,shlib-info=[num="56",name="libkeymgr.dylib",dyld-addr="0x7fff8e818000",reason="dyld",path="/usr/lib/system/libkeymgr.dylib",loaded_addr="0x7fff8e818000"]
=shlibs-added,shlib-info=[num="57",name="liblaunch.dylib",dyld-addr="0x7fff84936000",reason="dyld",path="/usr/lib/system/liblaunch.dylib",loaded_addr="0x7fff84936000"]
=shlibs-added,shlib-info=[num="58",name="libmacho.dylib",dyld-addr="0x7fff8534e000",reason="dyld",path="/usr/lib/system/libmacho.dylib",loaded_addr="0x7fff8534e000"]
=shlibs-added,shlib-info=[num="59",name="libquarantine.dylib",dyld-addr="0x7fff90f97000",reason="dyld",path="/usr/lib/system/libquarantine.dylib",loaded_addr="0x7fff90f97000"]
=shlibs-added,shlib-info=[num="60",name="libremovefile.dylib",dyld-addr="0x7fff8ccb5000",reason="dyld",path="/usr/lib/system/libremovefile.dylib",loaded_addr="0x7fff8ccb5000"]
=shlibs-added,shlib-info=[num="61",name="libsystem_asl.dylib",dyld-addr="0x7fff8df67000",reason="dyld",path="/usr/lib/system/libsystem_asl.dylib",loaded_addr="0x7fff8df67000"]
=shlibs-added,shlib-info=[num="62",name="libsystem_blocks.dylib",dyld-addr="0x7fff8621c000",reason="dyld",path="/usr/lib/system/libsystem_blocks.dylib",loaded_addr="0x7fff8621c000"]
=shlibs-added,shlib-info=[num="63",name="libsystem_c.dylib",dyld-addr="0x7fff83c0f000",reason="dyld",path="/usr/lib/system/libsystem_c.dylib",loaded_addr="0x7fff83c0f000"]
=shlibs-added,shlib-info=[num="64",name="libsystem_configuration.dylib",dyld-addr="0x7fff8fd71000",reason="dyld",path="/usr/lib/system/libsystem_configuration.dylib",loaded_addr="0x7fff8fd71000"]
=shlibs-added,shlib-info=[num="65",name="libsystem_coreservices.dylib",dyld-addr="0x7fff8a028000",reason="dyld",path="/usr/lib/system/libsystem_coreservices.dylib",loaded_addr="0x7fff8a028000"]
=shlibs-added,shlib-info=[num="66",name="libsystem_coretls.dylib",dyld-addr="0x7fff90996000",reason="dyld",path="/usr/lib/system/libsystem_coretls.dylib",loaded_addr="0x7fff90996000"]
=shlibs-added,shlib-info=[num="67",name="libsystem_dnssd.dylib",dyld-addr="0x7fff8b71f000",reason="dyld",path="/usr/lib/system/libsystem_dnssd.dylib",loaded_addr="0x7fff8b71f000"]
=shlibs-added,shlib-info=[num="68",name="libsystem_info.dylib",dyld-addr="0x7fff8b9f2000",reason="dyld",path="/usr/lib/system/libsystem_info.dylib",loaded_addr="0x7fff8b9f2000"]
=shlibs-added,shlib-info=[num="69",name="libsystem_kernel.dylib",dyld-addr="0x7fff81ad0000",reason="dyld",path="/usr/lib/system/libsystem_kernel.dylib",loaded_addr="0x7fff81ad0000"]
=shlibs-added,shlib-info=[num="70",name="libsystem_m.dylib",dyld-addr="0x7fff84953000",reason="dyld",path="/usr/lib/system/libsystem_m.dylib",loaded_addr="0x7fff84953000"]
=shlibs-added,shlib-info=[num="71",name="libsystem_malloc.dylib",dyld-addr="0x7fff887bd000",reason="dyld",path="/usr/lib/system/libsystem_malloc.dylib",loaded_addr="0x7fff887bd000"]
=shlibs-added,shlib-info=[num="72",name="libsystem_network.dylib",dyld-addr="0x7fff88304000",reason="dyld",path="/usr/lib/system/libsystem_network.dylib",loaded_addr="0x7fff88304000"]
=shlibs-added,shlib-info=[num="73",name="libsystem_networkextension.dylib",dyld-addr="0x7fff82085000",reason="dyld",path="/usr/lib/system/libsystem_networkextension.dylib",loaded_addr="0x7fff82085000"]
=shlibs-added,shlib-info=[num="74",name="libsystem_notify.dylib",dyld-addr="0x7fff8eb69000",reason="dyld",path="/usr/lib/system/libsystem_notify.dylib",loaded_addr="0x7fff8eb69000"]
=shlibs-added,shlib-info=[num="75",name="libsystem_platform.dylib",dyld-addr="0x7fff89ac7000",reason="dyld",path="/usr/lib/system/libsystem_platform.dylib",loaded_addr="0x7fff89ac7000"]
=shlibs-added,shlib-info=[num="76",name="libsystem_pthread.dylib",dyld-addr="0x7fff83ff8000",reason="dyld",path="/usr/lib/system/libsystem_pthread.dylib",loaded_addr="0x7fff83ff8000"]
=shlibs-added,shlib-info=[num="77",name="libsystem_sandbox.dylib",dyld-addr="0x7fff89084000",reason="dyld",path="/usr/lib/system/libsystem_sandbox.dylib",loaded_addr="0x7fff89084000"]
=shlibs-added,shlib-info=[num="78",name="libsystem_secinit.dylib",dyld-addr="0x7fff8e816000",reason="dyld",path="/usr/lib/system/libsystem_secinit.dylib",loaded_addr="0x7fff8e816000"]
=shlibs-added,shlib-info=[num="79",name="libsystem_stats.dylib",dyld-addr="0x7fff89eaf000",reason="dyld",path="/usr/lib/system/libsystem_stats.dylib",loaded_addr="0x7fff89eaf000"]
=shlibs-added,shlib-info=[num="80",name="libsystem_trace.dylib",dyld-addr="0x7fff8ead4000",reason="dyld",path="/usr/lib/system/libsystem_trace.dylib",loaded_addr="0x7fff8ead4000"]
=shlibs-added,shlib-info=[num="81",name="libunc.dylib",dyld-addr="0x7fff8ab27000",reason="dyld",path="/usr/lib/system/libunc.dylib",loaded_addr="0x7fff8ab27000"]
=shlibs-added,shlib-info=[num="82",name="libunwind.dylib",dyld-addr="0x7fff85cf3000",reason="dyld",path="/usr/lib/system/libunwind.dylib",loaded_addr="0x7fff85cf3000"]
=shlibs-added,shlib-info=[num="83",name="libxpc.dylib",dyld-addr="0x7fff88896000",reason="dyld",path="/usr/lib/system/libxpc.dylib",loaded_addr="0x7fff88896000"]
=shlibs-added,shlib-info=[num="84",name="libobjc.A.dylib",dyld-addr="0x7fff84f13000",reason="dyld",path="/usr/lib/libobjc.A.dylib",loaded_addr="0x7fff84f13000"]
=shlibs-added,shlib-info=[num="85",name="libauto.dylib",dyld-addr="0x7fff85d89000",reason="dyld",path="/usr/lib/libauto.dylib",loaded_addr="0x7fff85d89000"]
=shlibs-added,shlib-info=[num="86",name="libDiagnosticMessagesClient.dylib",dyld-addr="0x7fff822e1000",reason="dyld",path="/usr/lib/libDiagnosticMessagesClient.dylib",loaded_addr="0x7fff822e1000"]
(gdb)
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x0000000100000f4d",func="main",args=[{name="argc",value="1"},{name="argv",value="0x00007fff5fbffed8"}],file="main.cpp",fullname="/Users/chuckr/llama/llvm/tools/lldb/test/tools/lldb-mi/main.cpp",line="15"},thread-id="1",stopped-threads="all"
(gdb)
```

Reviewers: abidh, clayborg, ChuckR, jingham

Subscribers: ki.stfu, paulmaybee, lldb-commits

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

llvm-svn: 234483
2015-04-09 12:55:13 +00:00
Adrian McCarthy e704c4ffd9 Work around lack of %zd printf format specifier in MSVC libs.
llvm-svn: 233569
2015-03-30 17:46:36 +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
Zachary Turner fc8588136c Don't #include clang headers from BreakpointLocation.h
llvm-svn: 231263
2015-03-04 17:43:00 +00:00
Zachary Turner a78bd7ffc1 Don't #include FormatManager.h from Debugger.h
Debugger.h is a huge file that gets included everywhere, and
FormatManager.h brings in a ton of unnecessary stuff and doesn't
even use anything from it in the header.

llvm-svn: 231161
2015-03-03 23:11:11 +00:00
Jason Molenda c980fa92eb Change the default disassembly format again. First attempt at
changing it was in r219544 - after living on that for a few 
months, I wanted to take another crack at this.

The disassembly-format setting still exists and the old format
can be user specified with a setting like

${current-pc-arrow}${addr-file-or-load}{ <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}: 

This patch was discussed in http://reviews.llvm.org/D7578

<rdar://problem/19726421>

llvm-svn: 229186
2015-02-13 23:24:21 +00:00
Jim Ingham d762df8c24 Make sure that when a breakpoint is hit but its condition is not met,
the hit count is not updated.
Also, keep the hit count for the breakpoint in the breakpoint.  We were
using just the sum of the location's hit counts, but that was wrong since if a shared library is
unloaded, and the location goes away, the breakpoint hit count should not suddenly drop
by the number of hits there were on that location.

llvm-svn: 226074
2015-01-15 01:41:04 +00:00
Eric Christopher f70824428e Fix initialization order to match that of the source.
llvm-svn: 224467
2014-12-17 22:25:37 +00:00
Jim Ingham 5e09c8c32c Add the ability to tag one or more breakpoints with a name. These
names can then be used in place of breakpoint id's or breakpoint id 
ranges in all the commands that operate on breakpoints.

<rdar://problem/10103959>

llvm-svn: 224392
2014-12-16 23:40:14 +00:00
Jim Ingham 33df7cd345 Add the ability to set breakpoints with conditions, commands, etc,
in the "dummy-target".  The dummy target breakpoints prime all future
targets.  Breakpoints set before any target is created (e.g. breakpoints
in ~/.lldbinit) automatically get set in the dummy target.  You can also
list, add & delete breakpoints from the dummy target using the "-D" flag,
which is supported by most of the breakpoint commands.

This removes a long-standing wart in lldb...

<rdar://problem/10881487>

llvm-svn: 223565
2014-12-06 01:28:03 +00:00
Jim Ingham a672ecefef The breakpoint location hit counts were getting incremented in
BreakpointLocation::ShouldStop.  That worked but wasn't really right,
since there's nothing to guarantee that won't get called more than
once.  So this change moves that responsibility to the StopInfoBreakpoint
directly, and then it uses the BreakpointSite to actually do the bumping.

Also fix a test case that was assuming if you had many threads running some 
code with a breakpoint in it, the hit count when you stopped would always be
1.  Many of the threads could have hit it at the same time...

<rdar://problem/18577603>

llvm-svn: 220358
2014-10-22 01:54:17 +00:00
Jason Molenda aff1b357b0 Add a new disassembly-format specification so that the disassembler
output style can be customized.  Change the built-in default to be
more similar to gdb's disassembly formatting.

The disassembly-format for a gdb-like output is

${addr-file-or-load} <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>: 

The disassembly-format for the lldb style output is

{${function.initial-function}{${module.file.basename}`}{${function.name-without-args}}:\n}{${function.changed}\n{${module.file.basename}`}{${function.name-without-args}}:\n}{${current-pc-arrow} }{${addr-file-or-load}}: 

The two backticks in the lldb style formatter triggers the sub-expression evaluation in
CommandInterpreter::PreprocessCommand() so you can't use that one as-is ... changing to
use ' characters instead of ` would work around that.

<rdar://problem/9885398> 

llvm-svn: 219544
2014-10-10 23:07:36 +00:00
Jim Ingham 77fd738f58 Rework how resetting breakpoints in changed modules works. Try to match up old
locations with new ones if possible.

Next up some test cases...

llvm-svn: 217551
2014-09-10 21:40:47 +00:00
Bruce Mitchener d93c4a3339 Fix typos.
llvm-svn: 212132
2014-07-01 21:22:11 +00:00
Jim Ingham 2dfa00f6f2 Actually make a real scoped locker rather than constructing one that gets immediately thrown away...
llvm-svn: 211242
2014-06-18 23:40:13 +00:00
Jim Ingham 5799e291e1 Add locking around the m_owners collection in the breakpoint site. If we are in the middle of "BreakpointLocation::ShouldStop" we don't
want other commands (like "break disable") to mutate the owners of this breakpoint out from under us.

<rdar://problem/17255589>

llvm-svn: 211136
2014-06-18 01:04:40 +00:00
Jim Ingham 8646d3c164 Rename eExecution*** to eExpression*** to be consistent with the result type.
llvm-svn: 207945
2014-05-05 02:47:44 +00:00
Jim Ingham 1624a2d3c8 Make the Expression Execution result enum available to the SB API layer.
Add a callback that will allow an expression to be cancelled between the
expression evaluation stages (for the ClangUserExpressions.)

<rdar://problem/16790467>, <rdar://problem/16573440>

llvm-svn: 207944
2014-05-05 02:26:40 +00:00
Jim Ingham 7e9eff664c This function should be const.
llvm-svn: 205790
2014-04-08 20:24:45 +00:00