Commit Graph

1042 Commits

Author SHA1 Message Date
Bruce Mitchener ee188ba20e [lldb-mi] Use find, not find_first_of, for "--".
Summary:
find_first_of will look for any of the characters, not the full
string passed in. When looking for "--" then, we must use find
and not find_first_of.

Reviewers: ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 246529
2015-09-01 04:36:54 +00:00
Dawn Perchik f71e8370d1 Fix lldb build on older OSX versions after svn commit r244716
Older OSX versions don't define NSOperatingSystemVersion, so building
lldb gets: error: unknown type name 'NSOperatingSystemVersion'
This patch fixes the build by having GetOSVersionNumbers return false if
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000, causing lldb to
behave the same as it did before the commit.

Reviewed by: jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12396

llvm-svn: 246138
2015-08-27 03:42:56 +00:00
Dawn Perchik a431f152df [lldb-mi] Add (gdb) prompt after =breakpoint-modified and =breakpoint-created.
Reviewed by: abidh, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12113

llvm-svn: 245488
2015-08-19 20:04:03 +00:00
Greg Clayton 2ad6ac5461 Quiet build warnings on MacOSX.
llvm-svn: 245373
2015-08-18 22:30:25 +00:00
Bruce Mitchener 023e3050c5 Add missing newline at EOF.
This fixes a warning on the Mac OS X build.

llvm-svn: 244863
2015-08-13 02:44:40 +00:00
Bruce Mitchener aab764965a Remove DNBConfig.h
Summary:
This was no longer needed and hasn't been needed since r143244
in 2011.  This removes everything associated with generating
or using it.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 244850
2015-08-13 00:32:01 +00:00
Jason Molenda 6acc86c3f5 Have debugserver send the OS version string plus
major, minor, and patchlevel in the qHostInfo reply.  
Document that qHostInfo may report major/minor/patch
separately / in addition to the version: combination.

<rdar://problem/22125465> 

llvm-svn: 244716
2015-08-12 03:27:33 +00:00
Ilia K d7f932a8c8 Add size field to library load event (MI)
Summary:
(This revision supersedes the abandon: http://reviews.llvm.org/D9716)
Size field is used to let the debugger attribute an address to a specific library when symbols are not available. 
For example:
	OpenGLESApp4.app!Cube_draw() Line 74	C
 	OpenGLESApp4.app!-[GameViewController glkView:drawInRect:](GameViewController * self, SEL _cmd, GLKView * view, CGRect rect) Line 89	C++
 	GLKit!<redacted>	
 	QuartzCore!<redacted>	
 	QuartzCore!<redacted>	
 	QuartzCore!<redacted>	
 	QuartzCore!<redacted>	
 	QuartzCore!<redacted>	
 	UIKit!<redacted>	
 	UIKit!<redacted>	
 	UIKit!<redacted>	
 	UIKit!<redacted>	
 	FrontBoardServices!<redacted>	
 	CoreFoundation!<redacted>	

Patch from paulmay@microsoft.com

Reviewers: ChuckR, abidh, ki.stfu

Subscribers: greggm, lldb-commits

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

llvm-svn: 244573
2015-08-11 06:07:14 +00:00
Bruce Mitchener 381b73c96b [lldb-mi] Fix non-OS X builds.
llvm-svn: 243978
2015-08-04 13:25:23 +00:00
Bruce Mitchener 2d6b2f2010 [lldb-mi] Simplify MICmnMIOutOfBandRecord implementation.
Summary:
* Remove extraneous members that were just storing temporary
  values.
* OutOfBand_e parameters don't need to be const as they are
  scalars.
* Switch from a map with CMIUtilString values to using a mapping
  function. This uses a switch statement which will generate
  a warning if a new result class is added.
* Make BuildAsyncRecord a static function rather than a private
  member function so that we can construct the result text
  correctly and avoid having extra stuff in the header.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 243975
2015-08-04 13:12:31 +00:00
Bruce Mitchener e2453afff6 [lldb-mi] Use empty arg lists instead of (void).
Summary: This brings the code more in line with the usual LLDB style. NFC.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 243967
2015-08-04 10:24:20 +00:00
Bruce Mitchener bfcb6c870a [debugserver] Fix "control may reach end of non-void function" warnings.
Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 243953
2015-08-04 04:01:16 +00:00
Jason Molenda 3874ee6869 Bump the version # in the xcode proj file from major number 340 to 350.
The SB API for major version 340 won't be changing any more.

llvm-svn: 243943
2015-08-04 03:14:49 +00:00
Dawn Perchik c18daf29ae [lldb-mi] Fix evaluation for children of created variable object.
Move code in CMICmdCmdVarListChildren::Execute() up so that the child
object will always be added when the MI command -var-list-children is
entered (instead of only when the print-value was all or simple).  This
patch fixes evaluation of expressions like varobj.member for a created
varobj with children.

Reviewed by: abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11659

llvm-svn: 243782
2015-07-31 21:00:00 +00:00
Hafiz Abid Qadeer 311d08f8de Escape new line and tabs in the result of variable evaluation.
Expression evaluation error messages may have embedded new lines
and tabs. These should be escaped in the result string.

Patch by paulmaybee. Reviewed in http://reviews.llvm.org/D11570.

llvm-svn: 243741
2015-07-31 09:24:39 +00:00
Dawn Perchik 3cb6dd6e94 Fix build of lldb on Mavericks after svn rev.243511.
This patch adds a test for ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED
around the code which requires 10.10 support to link. Without this, lldb
gets unresolved references to _csr_check and _rootless_allows_task_for_pid.

Reviewed by: jasonmolenda
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11668

llvm-svn: 243715
2015-07-31 00:26:46 +00:00
Ilia K 6940581e45 Fix bug in expression display when determining if a pointer should be treated as a string
Summary:
Currently if the "first child" of the pointer is a char type then the pointer is displayed as a string. This test succeeds incorrectly when the pointer is to a structured type with a char type as its first field. Fix this by switching the test to retrieve the pointee type and checking that it is a char type.


Reviewers: abidh, ChuckR, ki.stfu

Subscribers: greggm, lldb-commits

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

llvm-svn: 243619
2015-07-30 05:32:41 +00:00
Jason Molenda 752e1e833b When debugserver fails to attach to a process on a Darwin
system, make a couple of additional checks to see if the
attach was denied via the System Integrity Protection that
is new in Mac OS X 10.11.  If so, return a special E87
error code to indicate this to lldb.

Up in lldb, if we receive the E87 error code, be specific
about why the attach failed.

Also detect the more common case of general attach failure
and print a better error message than "lost connection".

I believe this code will all build on Mac OS X 10.10 systems.
It may not compile or run on earlier versions of the OS.
None of this should build on other non-darwin systems.

llvm-svn: 243511
2015-07-29 01:42:16 +00:00
Dawn Perchik c69780d797 [lldb-mi] Fix setting of breakpoints using file:func syntax.
Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11499

llvm-svn: 243484
2015-07-28 21:40:57 +00:00
Ilia K b56c50f0ec Support escapes and quotes in string and character values.
Summary:
Escape characters in strings and strings containing quotes were not appearing correctly in expression values.

Patch from paulmay@microsoft.com

Reviewers: abidh, ChuckR, paulmaybee

Subscribers: greggm, lldb-commits

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

llvm-svn: 243383
2015-07-28 05:43:47 +00:00
Dawn Perchik c9a0d3be69 [lldb-mi] Fix breakpoints on functions when C++ namespaces are used.
The command "-break-insert ns::foo" for function 'foo' in namespace 'ns'
was being parsed as file:function.  This patch fixes these cases by adding
checks for '::'. (Note: '::func' is not parsed correctly by lldb due to
llvm.org/pr24271).

Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11396

llvm-svn: 243281
2015-07-27 17:03:34 +00:00
Bruce Mitchener 8a67bf7298 Add UNUSED_IF_ASSERT_DISABLED and apply it.
Summary:
This replaces (void)x; usages where they x was subsequently
involved in an assertion with this macro to make the
intent more clear.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 243074
2015-07-24 00:23:29 +00:00
Bruce Mitchener b1e77a3642 Fix Mac OS X build, debugserver version handling.
Summary:
No longer rely on cmake to set DEBUGSERVER_VERSION_STR,
but now generate the _vers.c file like xcode does
and include the generated file into the build on Mac OS X.

This fixes the cmake Mac OS X build after an earlier change
by Jason Molenda.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 243072
2015-07-24 00:13:45 +00:00
Bruce Mitchener 5a95b0a043 [lldb-mi] Remove unwanted comment blocks.
Summary:
This removes Authors:, Gotchas:, Changes: and Copyright:.

It leaves a couple of Gotcha: blocks that were not empty.

Reviewers: abidh, ki.stfu, domipheus

Subscribers: lldb-commits

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

llvm-svn: 242996
2015-07-23 09:04:56 +00:00
Jason Molenda 5d935e8d24 Fix the variable used to reply to the qGDBServerVersion
packet so that debugserver will send a reply like

name:debugserver;version:340.99;

<rdar://problem/21933963> 

llvm-svn: 242968
2015-07-22 23:42:54 +00:00
Greg Clayton 97f9e40e3a Don't water JSONGenerator objects down into ObjectSP's too early so that we can call member functions specific to dictionaries and arrays without calling GetAsDictionary() or GetAsArray() on them.
llvm-svn: 242917
2015-07-22 18:15:30 +00:00
Bruce Mitchener a026de0585 Fix warnings.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 242913
2015-07-22 17:31:44 +00:00
Bruce Mitchener 2c674d347e [lldb-mi] Remove unused bool results.
Summary:
Many methods, in particular various 'Add' methods didn't have
any actual failure scenarios that were being emitted. This meant
that a lot of surrounding code could be simplified.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 242911
2015-07-22 17:07:27 +00:00
Pavel Labath cb213b3831 Fix warnings found by -Wextra-semi
patch by Eugene Zelenko.

llvm-svn: 242875
2015-07-22 08:12:01 +00:00
Bruce Mitchener 39e8823f84 [lldb-mi] Correct file names in first line comments.
llvm-svn: 242781
2015-07-21 13:09:39 +00:00
Bruce Mitchener dec98e1c84 [lldb-mi] Fix Windows build, missing assert.h include.
Reviewers: ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 242778
2015-07-21 12:39:58 +00:00
Bruce Mitchener 8d60fac5ba [lldb-mi] Simplify MICmnMIResultRecord implementation.
Summary:
* Remove extraneous members that were just storing temporary
  values.
* ResultClass_e parameters don't need to be const as they are
  scalars.
* Switch from a map with CMIUtilString values to using a mapping
  function. This uses a switch statement which will generate
  a warning if a new result class is added.
* Make BuildRecordResult a static function rather than a private
  member function so that we can construct the result text
  correctly and avoid having extra stuff in the header.
* Don't need (void) parameter lists in C++.

Reviewers: abidh, ki.stfu, domipheus

Subscribers: lldb-commits

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

llvm-svn: 242769
2015-07-21 11:30:39 +00:00
Bruce Mitchener 81457feffb [lldb-mi] Remove unused portions of MIDataTypes.h.
Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 242768
2015-07-21 11:27:40 +00:00
Bruce Mitchener 6268bacc0f [lldb-mi] size_t rather than MIuint for arg counts.
Summary: [lldb-mi] size_t rather than MIuint for arg counts.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 242762
2015-07-21 08:07:27 +00:00
Greg Clayton 2e309076f2 More packet performance improvements.
Changed the "jthreads" key/value in the stop reply packets to be "jstopinfo". This JSON only contains threads with valid stop reasons and allows us not to have to ask about other threads via qThreadStopInfo when we are stepping. The "jstopinfo" only gets sent if there are more than one thread since the stop reply packet contains all the info needed for a single thread.

Added a Process::WillPublicStop() in case process subclasses want to do any extra gathering for public stops. For ProcessGDBRemote, we end up sending a jThreadsInfo packet to gather all expedited registers, expedited memory and MacOSX queue information. We only do this for public stops to minimize the packets we send when we have multiple private stops. Multiple private stops happen when a source level single step, step into or step out run the process multiple times while implementing the stepping, and none of these private stops make it out to the UI via notifications because they are private stops. 

llvm-svn: 242593
2015-07-17 23:42:28 +00:00
Pavel Labath 4a0d7bcaa7 Fix liblldb linking on RHEL 6 (bug #24140)
Patch by Eugene Zelenko.

llvm-svn: 242525
2015-07-17 15:26:27 +00:00
Jason Molenda d25d72fb79 Only include the stack memory for the caller stack
frame, don't go any further, in RNBRemote::SendStopReplyPacketForThread.

These are the memory pre-fetches in the T05 packet and are
included in every private stop that lldb does.  lldb needs, at most,
the caller stack frame so we're sending more data than needed by
including additional stack memory prefetches in this reply packet.

Once we've stopped for a public stop, we're going to do a jThreadsInfo
which will include the stack memory prefetches for all threads, 
including the one which had the stop reason.

llvm-svn: 242380
2015-07-16 03:42:40 +00:00
Greg Clayton a5801ade5a Added the ability to get JSON thread stop info with thread ID and stop info only in the normal stop reply packets using the new "jthreads" key value pair.
This allows stepping operations that don't ever do a public stop to get all the info they need without having to send a jThreadsInfo packet since those tend to be large.

This patch will be followed by a patch that will detect when we do a public stop, and when that happens we will send a jThreadsInfo packet at that time to get all expedited registers and memory.

llvm-svn: 242352
2015-07-15 22:59:03 +00:00
Dawn Perchik a3ff7032c8 Fix -data-info-line when source includes column number.
This fixes an off-by-one bug in CMICmdCmdDataInfoLine::Acknowledge.  Given:
    LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:123:1
-data-info-line would report the line as 12, omitting the last digit.

Reviewed by: ki.stfu, abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11209

llvm-svn: 242306
2015-07-15 17:25:01 +00:00
Oleksiy Vyalov df62ed3f8b Fix temp port file path generation in lldb-platform.
http://reviews.llvm.org/D11152

llvm-svn: 242182
2015-07-14 18:54:52 +00:00
Dawn Perchik aa80814c69 Fix debugserver build breakage on Mavericks after lldb commit svn 240728
vm_kernel_page_size appears to not be defined on OSX Mavericks, so the
build fails.  This patch fixes the build by calculating the pagesize if
_VM_PAGE_SIZE_H_ is not defined.

llvm-svn: 242114
2015-07-14 03:50:10 +00:00
Dawn Perchik 6145ad2d36 [lldb-mi] Add const qualifier to vMITextLine in InterpretCommandThisDriver.
llvm-svn: 242057
2015-07-13 20:16:13 +00:00
Pavel Labath 77dc9569c6 Introduce a MainLoop class and switch llgs to use it
Summary:
This is the first part of our effort to make llgs single threaded. Currently, llgs consists of
about three threads and the synchronisation between them is a major source of latency when
debugging linux and android applications.

In order to be able to go single threaded, we must have the ability to listen for events from
multiple sources (primarily, client commands coming over the network and debug events from the
inferior) and perform necessary actions. For this reason I introduce the concept of a MainLoop.
A main loop has the ability to register callback's which will be invoked upon receipt of certain
events. MainLoopPosix has the ability to listen for file descriptors and signals.

For the moment, I have merely made the GDBRemoteCommunicationServerLLGS class use MainLoop
instead of waiting on the network socket directly, but the other threads still remain. In the
followup patches I indend to migrate NativeProcessLinux to this class and remove the remaining
threads.

Reviewers: ovyalov, clayborg, amccarth, zturner, emaste

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 242018
2015-07-13 10:44:55 +00:00
Jason Molenda 20ee21bde6 Add a another packet to the gdb-remote protocol,
jGetLoadedDynamicLibrariesInfos.  This packet is similar to
qXfer:libraries:read except that lldb supplies the number of solibs
that should be reported about, and the start address for the list
of them.  At the initial process launch we'll read the full list
of solibs linked by the process -- at this point we could be using
qXfer:libraries:read -- but on subsequence solib-loaded notifications,
we'll be fetching a smaller number of solibs, often only one or two.

A typical Mac/iOS GUI app may have a couple hundred different 
solibs loaded  - doing all of the loads via memory reads takes 
a couple of megabytes of traffic between lldb and debugserver.
Having debugserver summarize the load addresses of all the solibs
and sending it in JSON requires a couple of hundred kilobytes
of traffic.  It's a significant performance improvement when 
communicating over a slower channel.

This patch leaves all of the logic for loading the libraries
in DynamicLoaderMacOSXDYLD -- it only call over ot ProcesGDBRemote
to get the JSON result.

If the jGetLoadedDynamicLibrariesInfos packet is not implemented,
the normal technique of using memory read packets to get all of
the details from the target will be used.

<rdar://problem/21007465>

llvm-svn: 241964
2015-07-10 23:15:22 +00:00
Bruce Mitchener 0a07397433 [lldb-mi] Remove unused typedefs.
Summary: [lldb-mi] Remove unused typedefs.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 241791
2015-07-09 08:45:26 +00:00
Jim Ingham 22302e5995 Make command files specified to the driver actually print their
results if the -Q option is not provided.  Also took out the quietly
option from AddInitialCommand, we don't use that to set this option,
we use the override set by the -Q option.

<rdar://problem/21232087>

llvm-svn: 241652
2015-07-08 00:59:59 +00:00
Greg Clayton a7b2690cb3 Fix debugserver build after someone moved StrintExtractor.h.
llvm-svn: 241628
2015-07-07 21:27:08 +00:00
Bruce Mitchener 6c971ec217 [lldb-mi] Spell resource string name correctly.
Broardcaster -> Broadcaster

Summary: [lldb-mi] Spell resource string name correctly.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 241591
2015-07-07 14:54:07 +00:00
Bruce Mitchener c5638f915b [lldb-mi] Fix typo in variable name.
Seperated -> Separated.

Summary: [lldb-mi] Fix typo in variable name.

Reviewers: abidh, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 241586
2015-07-07 14:26:28 +00:00
Bruce Mitchener ae4c026765 [lldb-mi] Fix typos
llvm-svn: 241585
2015-07-07 14:04:40 +00:00