Commit Graph

5268 Commits

Author SHA1 Message Date
Jim Ingham 98d6da5f7c Make the error message when we time out waiting for debugserver to reply to the qLaunchSuccess packet less cryptic.
<rdar://problem/11754744>

llvm-svn: 159373
2012-06-28 20:30:23 +00:00
Greg Clayton a7fb1dcd4b Listen to the "--verbose" flag when running "crashlog" and if verbose is enabled, then dump full paths to source files and modules.
Changed much of the output that was coming out with "--verbose" over to use the new "--debug" flag.

llvm-svn: 159363
2012-06-28 18:10:14 +00:00
Greg Clayton 20351ea310 Fixed a logic error which stopped paths from being properly remapped.
llvm-svn: 159362
2012-06-28 18:09:12 +00:00
Greg Clayton fe251c88d9 Added a new top level "Resources" group for plist files and moved a few dylib and .a files into the "Libraries" group.
llvm-svn: 159323
2012-06-28 01:28:49 +00:00
Enrico Granata c76715f3be <rdar://problem/11679380> Make sure we do not fallback to software stepping when hardware stepping should work but fails to get enabled. Also removing dead code paths
llvm-svn: 159322
2012-06-28 01:23:30 +00:00
Greg Clayton fed39aa653 Added the ability to read the dSYM plist file with source remappings even when DebugSymbols isn't used to find the dSYM. We now parse the plist as XML in the MacOSX symbol vendor.
Added the ability to get a section load address given a target which is needed for a previous checking which saves crashlogs.

llvm-svn: 159298
2012-06-27 22:22:28 +00:00
Greg Clayton 234076c429 Fixed the "target modules list" to not crash in Debug builds due to an assertion where the mutex in the "module_list" local variable would assert when the lldb_private::Mutex would destruct. What was happening was the mutex in the module list was being locked by a local locker object and then "module_list" would get destroyed before the locker and the locker still had the mutex locked which would cause the pthread call to destroy the mutex to fail with "Resource busy" and it would cause a mutex leak.
llvm-svn: 159291
2012-06-27 20:26:19 +00:00
Greg Clayton 8567355e8c Modify the ranges_access() helper function to be able to lookup the address range in a block given an address. Since blocks can have multiple discontiguous ranges, it helps to be able to get the current address range for the current block in a frame. This can be used in code like:
curr_block_range = lldb.frame.block.range[lldb.frame.addr]

llvm-svn: 159289
2012-06-27 20:23:09 +00:00
Greg Clayton 3e6dde6652 Fixed the get_process_thread_list function to correctly return a list of all threads in a process.
llvm-svn: 159288
2012-06-27 20:19:56 +00:00
Greg Clayton febc8bb479 Make the IsValid() operator for SBLineEntry "do the right thing" by returning true if the line entry is valid, not just if the opaque pointer to lldb_private::LineEntry is non NULL.
llvm-svn: 159287
2012-06-27 20:18:01 +00:00
Greg Clayton f47b2c26bb Added a "save_crashlog" command to the lldb.macosx.crashlog package that allow you to dump your current process state out to a crash log file. This will dump all of the target module information with all load addresses, UUID values, and shared library paths, as well as all thread stacks and the crash log header. This will make it easy for us to save the current state of a process and then reload it later into LLDB.
llvm-svn: 159286
2012-06-27 20:02:04 +00:00
Greg Clayton 8921ce8396 Fix the copy constructor and assignement operator for ModuleList to be thread safe.
llvm-svn: 159285
2012-06-27 19:59:26 +00:00
Greg Clayton 89d4f338a7 Check the return status of the make command.
llvm-svn: 159284
2012-06-27 19:57:59 +00:00
Greg Clayton 5b889eec4a Remove dependency on internal header file.
llvm-svn: 159283
2012-06-27 19:57:13 +00:00
Jim Ingham 70f11f88e3 Make a way to set the result status for Python defined commands, and don't overwrite the status of the result if
the python command has set it.

llvm-svn: 159273
2012-06-27 17:25:36 +00:00
Jim Ingham 0fd1b75f50 Fix ignore counts on breakpoints so they actually work.
llvm-svn: 159233
2012-06-26 22:27:55 +00:00
Jim Ingham 389512dc5e Add API logging to SBCommandInterpreter::HandleCompletion().
llvm-svn: 159180
2012-06-26 01:21:59 +00:00
Jim Ingham bc1d7f7a6a The StepOverBreakpoint plan should only explain eStopReasonTrace. It didn't cause any other exceptional stop reason.
llvm-svn: 159031
2012-06-22 20:42:22 +00:00
Filipe Cabecinhas 2f42bb03b7 DNBLogThreadedIf already inserts a newline
llvm-svn: 158995
2012-06-22 13:54:32 +00:00
Jason Molenda f813086c85 Additional comment in ObjectFileMachO::ParseSymtab to explain
the layout of the dyld shared cache file and how we're stepping
through it; also use offsetof to find offsets of struct elements.

llvm-svn: 158962
2012-06-22 03:28:35 +00:00
Jason Molenda a5609c8588 Preliminary set of changes to ObjectFileMachO::ParseSymtab when lldb
is being run on iOS natively and we are examining a binary that is
in the shared-cache.  The shared cache may be set up to not load the
symbol names in memory (and may be missing some local symbols entirely,
to boot) so we need to read the on-disk-but-not-mapped-into-memory cache
of symbol names/symbols before we start processing the in-memory nlist
entries.  

This code needs to be reorganized into its own separate method, ideally
we'll find some way to not duplicate the nlist symbol handling.  But 
we need to handle this new format quickly and we'll clean up later.

Thanks for James McIlree for the patch.  Fixes <rdar://problem/11639018>.

llvm-svn: 158891
2012-06-21 01:51:02 +00:00
Jason Molenda 06bca9ed0e Bump version number to lldb-160.
llvm-svn: 158890
2012-06-21 01:41:15 +00:00
Filipe Cabecinhas 0eec15acf2 Continue the cleanup started on r158737
Adds a utility class method to TestBase that checks and removes a temp
file.
Removed every use of system() to execute rm -f.

llvm-svn: 158809
2012-06-20 10:13:40 +00:00
Johnny Chen 1773a89ff4 Chnage VerifyWatchpointIDs() from a static function to a class function to be called from other source files.
llvm-svn: 158751
2012-06-19 22:12:58 +00:00
Johnny Chen 59ceee7933 Test suite cleanup: use Python API to remove files as part of cleanup instead of running OS commands.
llvm-svn: 158737
2012-06-19 20:29:50 +00:00
Johnny Chen 9a63cfaf8d rdar://problem/11649610
lldb confused by single quote in executable path

Also add a test case.

llvm-svn: 158693
2012-06-19 00:56:55 +00:00
Johnny Chen be4e208103 rdar://problem/11390100
debugserver needs to be able to posix_spawn debugging apps that have ".app" in their path that aren't bundles

llvm-svn: 158327
2012-06-11 21:05:26 +00:00
Jason Molenda b68c2d96ce Incorporate suggestions from Jim, add "USING LLDB" and "FILES" sections.
llvm-svn: 158246
2012-06-08 23:49:32 +00:00
Jim Ingham 4ceb928f02 Change the Mutex::Locker class so that it takes the Mutex object and locks it, rather
than being given the pthread_mutex_t from the Mutex and locks that.  That allows us to
track ownership of the Mutex better.  

Used this to switch the LLDB_CONFIGURATION_DEBUG enabled assert when we can't get the
gdb-remote sequence mutex to assert when the thread that had the mutex releases it.  This
is generally more useful information than saying just who failed to get it (since the
code that had it locked often had released it by the time the assert fired.)

llvm-svn: 158240
2012-06-08 22:50:40 +00:00
Sean Callanan e3333d69db Minor fixes for ARM/iOS targets:
- On iOS, we select the "apcs-gnu" ABI to match
  what libraries expect.

- Literals are now allocated at their preferred
  alignment, eliminating many alignment crashes.

llvm-svn: 158236
2012-06-08 22:20:41 +00:00
Jim Ingham 5a98841673 Make raw & parsed commands subclasses of CommandObject rather than having the raw version implement an
Execute which was never going to get run and another ExecuteRawCommandString.  Took the knowledge of how
to prepare raw & parsed commands out of CommandInterpreter and put it in CommandObject where it belongs.

Also took all the cases where there were the subcommands of Multiword commands declared in the .h file for
the overall command and moved them into the .cpp file.

Made the CommandObject flags work for raw as well as parsed commands.

Made "expr" use the flags so that it requires you to be paused to run "expr".

llvm-svn: 158235
2012-06-08 21:56:10 +00:00
Johnny Chen 6097245436 Add a test case for r158222.
llvm-svn: 158232
2012-06-08 21:46:18 +00:00
Johnny Chen 6ea4c8ea26 rdar://problem/11487457
Previous fix to add convenience registers for x86_64 did not take the 'process attach' scenario into account.
This patch fixes that.

llvm-svn: 158222
2012-06-08 19:06:28 +00:00
Filipe Cabecinhas 89d91fcf1d Fixed TestCompletion, broken by r158173
llvm-svn: 158207
2012-06-08 16:16:19 +00:00
Jason Molenda 64f20ed5a1 Remove empty line at end.
llvm-svn: 158191
2012-06-08 03:38:53 +00:00
Jason Molenda e66b45df8d Add a simple man page for lldb.
llvm-svn: 158190
2012-06-08 03:34:09 +00:00
Sean Callanan 5677536bff Committed a change to the SectionList that introduces
a cache of address ranges for child sections,
accelerating lookups.  This cache is built during
object file loading, and is then set in stone once
the object files are done loading.  (In Debug builds,
we ensure that the cache is never invalidated after
that.)

llvm-svn: 158188
2012-06-08 02:16:08 +00:00
Sean Callanan 64c0cf2134 Added a setting (target.process.disable-memory-cache)
that controls whether memory is cached.  This is off
by default (i.e., memory is cached) because it greatly
improves performance.

llvm-svn: 158173
2012-06-07 22:26:42 +00:00
Jim Ingham aebdf1bed2 Add API logging for SBDebugger::MemoryPressureDetected.
llvm-svn: 158159
2012-06-07 19:08:07 +00:00
Enrico Granata 79cc6f7a26 <rdar://problem/11538779> Fixing issues where Python scripts were not able to read user input and/or display output to the user in certain situations - This fix introduces a Python InputReader manager class that mimics the behavior of the interactive interpreter in terms of access to I/O and ensures access to the input and output flows
llvm-svn: 158124
2012-06-07 00:17:18 +00:00
Sean Callanan d38b4a998e Added the --all argument to "target modules lookup"
that forces all matches to be looked up.  When --all
is not passed, and the current execution frame can
be used to narrow down the search, "target modules
lookup" will try searching in that specific frame
first.  Only if nothing is turned up there will it
go on to search all modules.

This feature is currently enabled only for types.

llvm-svn: 158107
2012-06-06 20:49:55 +00:00
Johnny Chen 89b639e9a8 Update wording for the member field m_error.
llvm-svn: 158095
2012-06-06 19:01:20 +00:00
Jim Ingham ef42a6fb1d Add the SBWatchpoint::GetError back, we have clients who use it.
llvm-svn: 158092
2012-06-06 18:46:25 +00:00
Jim Ingham babfc38abc Fix a place in GDBRemoteCommunicationClient::SendContinuePacketAndWaitForReply where we weren't taking
m_interrupt_sent into account.  Also don't reset m_interrupt_sent in SendInterrupt but do so in SendPacketAndWaitForResponse
when we know we've handled the interrupt.
Fix a code path through ProcessGDBRemote::DoDestroy where we were tearing down the debug session but
not setting the exit status.

llvm-svn: 158043
2012-06-06 00:32:39 +00:00
Jim Ingham aacc31813e Make sure that when if we are going to Halt while the process is in the middle of HandlePrivateEvent we
wait till that is done.  We need a stronger way to do this, but in practice this works and using some locking
strategy is harder because Halt & HandlePrivateEvent generally happen on different threads.

llvm-svn: 158042
2012-06-06 00:29:30 +00:00
Johnny Chen c4392d2ad0 rdar://problem/11598332
The output of 'register read' should be prettier.
Modify RegisterValue::Dump() to take an additional parameter:

    uint32_t reg_name_right_align_at

which defaults to 0 (i.e., no alignment at all).  Update the 'register read' command impl to pass 8
as the alignment to RegisterValue::Dump() method.  If more sophisticated scheme is desired, we will
need to introduce an additional command option to 'register read' later on.

llvm-svn: 158039
2012-06-05 23:25:10 +00:00
Jim Ingham 41ec0f9018 Whitespace cleanup.
llvm-svn: 158032
2012-06-05 22:53:34 +00:00
Greg Clayton 8ae50eb4a6 <rdar://problem/11597333>
Fixed an issue where LLDB would use armv7-apple-unknown even though armv7-unknown-unknown was specified with the target create command:

(lldb) target create -a armv7-unknown-unknown <executable>

llvm-svn: 158023
2012-06-05 21:17:09 +00:00
Johnny Chen 3f476c4a72 rdar://problem/11597911
Fix confusing error message about "expression did not evaluate to an address" when doing 'watchpoint set expression".
Instead of using 0 as the fail_value when invoking ValueObject::GetValueAsUnsigned(), modify the API to take an addition
bool pointer (defaults to NULL) to indicate success/failure of value conversion.

llvm-svn: 158016
2012-06-05 19:37:43 +00:00
Jim Ingham 38c5849e7e Make sure the module_uuid_ptr is non-NULL before checking whether its contents match the module's UUID.
llvm-svn: 157971
2012-06-05 00:34:37 +00:00
Johnny Chen 974759fd8b Funnel the old API call SBValue::Watch (bool resolve_location, bool read, bool write) to the one which takes an SBError.
llvm-svn: 157969
2012-06-05 00:14:15 +00:00
Johnny Chen d3761a7e10 Cannot break the existing API client of SBValue::Watch(bool resolve_location, bool read, bool write).
Leave this method in the codebase for a while.

llvm-svn: 157967
2012-06-04 23:45:50 +00:00
Greg Clayton f51a23fb6f Cleaned up some stuff in symbolication where we can now lazily get images when symbolicating after loading a crash log file.
Added colorization to the gdbremote.py output and also added the ability to symbolicate the addresses in registers.

llvm-svn: 157965
2012-06-04 23:22:17 +00:00
Johnny Chen b90827e66c rdar://problem/11584012
Refactorings of watchpoint creation APIs so that SBTarget::WatchAddress(), SBValue::Watch(), and SBValue::WatchPointee()
now take an additional 'SBError &error' parameter (at the end) to contain the reason if there is some failure in the
operation.  Update 'watchpoint set variable/expression' commands to take advantage of that.

Update existing test cases to reflect the API change and add test cases to verify that the SBError mechanism works for
SBTarget::WatchAddress() by passing an invalid watch_size.

llvm-svn: 157964
2012-06-04 23:19:54 +00:00
Jim Ingham a8f556657f -i option should apply to "-n" as well as "-F".
llvm-svn: 157960
2012-06-04 22:47:34 +00:00
Sean Callanan a0b80aba46 Fixed handling of Objective-C properties to ensure
that automatically generated setters/getters only
get added to a class after explicitly declared (or
synthesized) getters/setters had the chance to be
added.  This eliminates conflicts creating errors
of the form:

error: instance method '...' has incompatible result
types in different translation units ('X *' vs. 'id')

llvm-svn: 157956
2012-06-04 22:28:05 +00:00
Greg Clayton eac87f87ce Patch that fixes log messages in SBValue.cpp from Lau Sennels.
llvm-svn: 157949
2012-06-04 20:13:23 +00:00
Johnny Chen 3cb41e82cb Give more explicit error messages when watchpoint creation command (watchpoint set) fails,
like number of supported hardware watchpoints reached or the watch size is not allowed.

llvm-svn: 157948
2012-06-04 20:08:23 +00:00
Johnny Chen a539598f65 Properly initialize the member fields used for hardware watchpoint transaction management.
llvm-svn: 157878
2012-06-02 06:25:23 +00:00
Sean Callanan 8b0737fe28 Fixed a problem where detaching from a process
left a read-write lock dangling, causing crashes
in debug builds.

llvm-svn: 157875
2012-06-02 01:16:20 +00:00
Johnny Chen 561e190a36 Use Log::Printf() instead of printf().
llvm-svn: 157869
2012-06-02 00:22:07 +00:00
Johnny Chen 847075607f rdar://problem/11320188
Designate MachThreadList as a transaction coordinator when doing Enable/DisableHardwareWatchpoint on the list of threads.
In case the operation (iterating on the threads and doing enable/disable) fails in the middle, we rollback the already
enabled/disabled threads to their checkpointed states.  When all the threads succeed in enable/disable, we ask each thread
to finsih the transaction and commit the change of the debug state.

llvm-svn: 157858
2012-06-01 23:43:05 +00:00
Sean Callanan 2e1d9bac35 Added "kill" as an alias for "process kill".
llvm-svn: 157856
2012-06-01 23:29:32 +00:00
Johnny Chen 4ce37abb52 Fix a typo for 'waitfor' option help wording.
llvm-svn: 157853
2012-06-01 23:16:58 +00:00
Greg Clayton e5476db2d8 <rdar://problem/11548378>
Fixed an issue with the current type being set to DIE_IS_BEING_PARSED in the m_die_to_type map by making sure the type pointer is valid. 

llvm-svn: 157836
2012-06-01 20:32:35 +00:00
Greg Clayton 8ebb9a8564 Added the ability to disassembly GDB remote packets with the python file. This will make it easier to symbolicate the packet log output since we can use the lldb.utils.symbolication package module to symbolicate register values.
llvm-svn: 157835
2012-06-01 20:23:54 +00:00
Jason Molenda 382dcfda20 Register the ProcessGDBRemote plugin ahead of the ProcessKDP plugin
so a process connect without any plugin specified picks up the 
gdb-remote plugin by default.

llvm-svn: 157792
2012-06-01 01:39:46 +00:00
Jim Ingham b4451b1730 When the Platform launches a process for debugging, make sure it goes into a separate process group, otherwise ^C will both cause us to try to Stop it manually, AND send it a SIGINT, which can confuse us.
rdar://problem/11369230

llvm-svn: 157791
2012-06-01 01:22:13 +00:00
Jim Ingham d242f1c037 If the Driver's input reader gets an Interrupt and the current command line is empty, then treat that interrupt as an instruction to Stop the process of the currently selected target.
llvm-svn: 157790
2012-06-01 01:07:02 +00:00
Jim Ingham 6d10c17a31 Add an API to determine whether there are any characters on the current input line.
llvm-svn: 157789
2012-06-01 01:03:40 +00:00
Johnny Chen e48fb7d732 For hardware watchpoint enable/disable, in case the kernel call to set the revised debug state fails, we need to recover the local cache to the previous known state.
llvm-svn: 157778
2012-05-31 23:02:30 +00:00
Johnny Chen 7385a5ae0b Thread-hardening the SB API calls related to watchpoint operations.
llvm-svn: 157776
2012-05-31 22:56:36 +00:00
Greg Clayton d354405426 <rdar://problem/11486302>
Improve logging a bit.

llvm-svn: 157771
2012-05-31 21:24:20 +00:00
Greg Clayton eb749096e0 Added the ability to run "symbolicate [options] <crashlog-index>" in interactive mode.
llvm-svn: 157770
2012-05-31 21:21:08 +00:00
Jim Ingham ce76c62b08 Fix a bunch of thinko's in the command "thread continue".
rdar://problem/11562050

llvm-svn: 157767
2012-05-31 20:48:41 +00:00
Jim Ingham cb5d5a571e When we are preparing all threads to run, if the overall run state of a thread is "suspended" that
should override the thread's thread plan's run state.

llvm-svn: 157766
2012-05-31 20:47:56 +00:00
Sean Callanan 0c5aabc2c7 Made nil resolve as (id)0 and not be looked up
(which regularly conflicts with existing symbols
in Objective-C).

llvm-svn: 157758
2012-05-31 17:49:31 +00:00
Greg Clayton d9896733c7 <rdar://problem/11486302>
Fixed a case where multiple threads can be asking to send a packet to the GDB server and one of three things will happen:
1 - everything works
2 - one thread will fail to send the packet due to not being able to get the sequence mutex
3 - one thread will try and interrupt the other packet sending and fail and not send the packet

Now the flow is a bit different. Prior to this fix we did:

if (try_get_sequence_mutex()) {
    send_packet()
    return success;
} else {
   if (async_ok) {
       interrupt()
       send_packet() 
       resume()
       return success;
   }
}
return fail

The issue is that the call to "try_get_sequence_mutex()" could fail if another thread was sending a packet and could cause us to just not send the packet and an error would be returned.

What we really want is to try and get the sequence mutex, and if this succeeds, send the packet. Else check if we are running and if we are, do what we used to do. The big difference is when we aren't running, we wait for the sequence mutex so we don't drop packets. Pseudo code is:

if (try_get_sequence_mutex()) {
    // Safe to send the packet right away
    send_packet()
    return success;
} else {
    if (running) {
       // We are running, interrupt and send async packet if ok to do so,
       // else it is ok to fail
       if (async_ok) {
           interrupt()
           send_packet() 
           resume()
           return success;
        }
    }
    else {
        // Not running, wait for the sequence mutex so we don't drop packets
        get_sequence_mutex()
        send_packet()
        return success;
    }
}
return fail

llvm-svn: 157751
2012-05-31 16:54:51 +00:00
Filipe Cabecinhas b76d5c965d FreeBSD patch by Viktor Kutuzov
llvm-svn: 157735
2012-05-31 07:49:36 +00:00
Sean Callanan 5bcaf5836b Fixed a missed case in the patch to make
HandleCommand take a LazyBool instead of a bool.

llvm-svn: 157728
2012-05-31 01:30:08 +00:00
Enrico Granata 5f5ab60274 <rdar://problem/11328896> Fixing a bug where regex commands were saved in the history even if they came from a 'command sourced' file - this fix introduces a command sourcing depth and disables history for all levels of depth > 0, which means no commands go into history when being sourced from a file. we need an integer depth because command files might themselves source other command files, ...
llvm-svn: 157727
2012-05-31 01:09:06 +00:00
Greg Clayton 76927ee56d <rdar://problem/11562050>
"thread continue" uses zero based thread indexes, not the thread index ID.

Also fixed "thread until" if it uses the -t option.

llvm-svn: 157724
2012-05-31 00:29:20 +00:00
Greg Clayton 177b855ed7 <rdar://problem/11537498>
Fixed an issue with the symbol table parsing of files that have STAB entries in them where there are two N_SO entries where the first has a directory, and the second contains a full path:

[     0] 00000002 64 (N_SO         ) 00     0000   0000000000000000 '/Volumes/data/src/'
[     1] 0000001e 64 (N_SO         ) 00     0000   0000000000000000 '/Volumes/data/src/Source/main.m'
[     2] 00000047 66 (N_OSO        ) 09     0001   000000004fc642d2 '/tmp/main.o'
[     3] 00000001 2e (N_BNSYM      ) 01     0000   0000000000003864
[     4] 000000bd 24 (N_FUN        ) 01     0000   0000000000003864 '_main'
[     5] 00000001 24 (N_FUN        ) 00     0000   00000000000000ae
[     6] 00000001 4e (N_ENSYM      ) 01     0000   00000000000000ae
[     7] 00000001 64 (N_SO         ) 01     0000   0000000000000000

We now correctly combine entries 0 and 1 into a single entry.

llvm-svn: 157712
2012-05-30 20:20:34 +00:00
Filipe Cabecinhas 22889540dc Mark the test as failing on both architectures, since LLDB won't handle the function to clang.
llvm-svn: 157679
2012-05-30 05:44:59 +00:00
Filipe Cabecinhas 51c277876a Make the test suite work again on Mac OS X without the LLDB_BUILD_TYPE env var
llvm-svn: 157678
2012-05-30 05:40:23 +00:00
Filipe Cabecinhas f96964b6ef Clean all files when executing 'make clean'
llvm-svn: 157677
2012-05-30 05:35:14 +00:00
Filipe Cabecinhas 9f84da9b52 Clean renamed files on 'make clean'
llvm-svn: 157669
2012-05-30 02:52:29 +00:00
Jim Ingham 3ee12ef26e We were accessing the ModuleList in the target without locking it for tasks like
setting breakpoints.  That's dangerous, since while we are setting a breakpoint,
the target might hit the dyld load notification, and start removing modules from
the list.  This change adds a GetMutex accessor to the ModuleList class, and
uses it whenever we are accessing the target's ModuleList (as returned by GetImages().)

<rdar://problem/11552372>

llvm-svn: 157668
2012-05-30 02:19:25 +00:00
Filipe Cabecinhas 970c6f39da Make dbgnub-config.pl work with multiline env vars.
llvm-svn: 157664
2012-05-30 00:44:14 +00:00
Johnny Chen f728f40873 For dump_register_value() sub-routine, issue a return after an error condition occurs.
llvm-svn: 157656
2012-05-30 00:29:12 +00:00
Jim Ingham 1afbfd0c76 Check for NULL modules coming into the SearchFilter's ModulePasses & PlatformDarwin::ModuleIsExcludedForNonModuleSpecificSearches functions.
llvm-svn: 157653
2012-05-29 23:48:51 +00:00
Sean Callanan 53bacf2130 Insert dynamic checks only if the appropriate
checker functions exist.

llvm-svn: 157652
2012-05-29 23:46:46 +00:00
Johnny Chen 6d4d4f7db3 rdar://problem/11541676
Do not show the derived registers like "eax", ... for the vanilla "register read" command.
Also add a test scenario for that.

llvm-svn: 157647
2012-05-29 21:55:08 +00:00
Johnny Chen 797a1b37e5 Fix arch_helper() to return the list of supported architectures.
llvm-svn: 157643
2012-05-29 20:04:10 +00:00
Enrico Granata de4ca5b789 rdar://problem/10996978 - Fixing an issue where crash reports for the expression parser might include symbols from the user's application
llvm-svn: 157631
2012-05-29 18:06:49 +00:00
Filipe Cabecinhas 3de2a75997 Commit Charles Davis' patch with some additional modifications.
llvm-svn: 157621
2012-05-29 14:08:19 +00:00
Filipe Cabecinhas 54d730430c Update the Makefile to expect the lldb package
llvm-svn: 157620
2012-05-29 14:06:40 +00:00
Filipe Cabecinhas 3f4b843fd1 Don't include LLDBWrapPython.cpp here. Use it in Interpreter.
llvm-svn: 157619
2012-05-29 14:03:55 +00:00
Filipe Cabecinhas fefeba65f0 Continue the work started by Dragos' Makefile patch (LLVMLibsOptions usage)
Also replace hard-coded paths with a variable.
Fixed a comment.
Included missing dependencies on Mac OS X (lldbPluginDynamicLoaderPOSIX.a
is a common dependency).
We can't use EXPORTED_SYMBOL_FILE on Darwin right now, don't pass it to
the linker just yet.

llvm-svn: 157618
2012-05-29 13:41:50 +00:00
Filipe Cabecinhas 20a5813a5f Substitute LLVMLibsOptions for LD.Flags so we can find the mentioned libs
llvm-svn: 157616
2012-05-29 13:35:46 +00:00
Filipe Cabecinhas 2137c928b0 Remove all written files
llvm-svn: 157562
2012-05-28 04:07:56 +00:00
Greg Clayton d70b14ea9d Fixed memory management issues introduced by revision 157507.
A local std::string was being filled in and then the function would return "s.c_str()".
A local StreamString (which contains a std::string) was being filled in, and essentially also returning the c string from the std::string, though it was in a the StreamString class.

The fix was to not do this by passing a stream object into StringList::Join() and fix the "arch_helper()" function to do what it should: cache the result in a global.

llvm-svn: 157519
2012-05-26 17:21:14 +00:00
Johnny Chen ca7835c685 rdar://problem/11535045
Make 'help arch' return the list of supported architectures.
Add a convenience method StringList::Join(const char *separator) which is called from the help function for 'arch'.
Also add a simple test case.

llvm-svn: 157507
2012-05-26 00:32:39 +00:00
Jim Ingham de22182b33 Fix the comments about LLDB_DISABLE_PYTHON in the python swig shell scripts to be more clear.
llvm-svn: 157506
2012-05-26 00:23:52 +00:00
Johnny Chen 7d49c9c861 rdar://problem/11533713
Allow setting conditions inline with breakpoints.  Add test cases.

llvm-svn: 157497
2012-05-25 21:10:46 +00:00
Sean Callanan 48e894bdc9 Fixed a crash in logging when the name of an
entity imported by the ASTImporter had a NamedDecl
with a name that wasn't a plain string (e.g., a
selector).

llvm-svn: 157488
2012-05-25 18:12:26 +00:00
Greg Clayton 4d78c40825 <rdar://problem/11535465>
LC_ENCRYPTION_INFO with "cryptid == 0" is not actually encrypted and LLDB fails to read memory from file.

llvm-svn: 157487
2012-05-25 18:09:55 +00:00
Greg Clayton 57f0630cc5 <rdar://problem/11534686>
Reading memory from a file when the section is encrypted doesn't show an error. No we do.

llvm-svn: 157484
2012-05-25 17:05:55 +00:00
Greg Clayton debb881079 Fixed an issue where we might have easy access to the string table data for a mach file from memory even though we have a process. So now we don't read the string table strings from memory when we don't have to.
llvm-svn: 157482
2012-05-25 17:04:00 +00:00
Jason Molenda 6bfd821ad0 Bump to lldb 152.
llvm-svn: 157456
2012-05-25 02:05:58 +00:00
Jason Molenda 6f5e8c2647 Add support for function with stack frame checks added by the compiler;
these functions will end in the sequence

  mov %rbp, %rsp
  ret
  call __stack_chk_fail

instead of the usual mov, ret.  The x86 assembly profiler only looked
for functions ending in 'ret' and added the Unwind row describing how to
set the CFA based on that -- the addition of the call insn (which is jumped
to earlier in the function body) threw off that inspection.

Resolves the need to "step" twice to get out of these functions when doing
source-level stepping.

<rdar://problem/11469705>

llvm-svn: 157454
2012-05-25 01:54:06 +00:00
Greg Clayton f1186de3f4 <rdar://problem/11529853>
Sending async packets can deadlock a program on darwin. We currently allow breakpoint packets and memory read/write packets (for software breakpoints) to be sent while a program is running. In the GDB remote plug-in, we will interrupt the run, send the async packet and resume (currently with the continue packet that caused the program to resume). If the GDB server supports the "vCont" packet, we might have initially continued with each thread stating it should continue. If new threads show up while we are stopped, which happend when running GCD, we can end up with new threads that we aren't mentioning in the continue list. So we start with a thread list of 1,2,3 and continue:

continue thread 1, continue thread 2, continue thread 3 

Now we interrupt and set a breakpoint and we actually have threads 1,2,3,4 now when we are about to resume, yet we send:

continue thread 1, continue thread 2, continue thread 3 

Any thread that isn't mentioned is currently going to stay suspended. This causes the deadlock.

llvm-svn: 157439
2012-05-24 23:42:14 +00:00
Johnny Chen a0d4b5da35 Fix missing Resources/Python directory for macosx build.
llvm-svn: 157405
2012-05-24 18:14:18 +00:00
Jim Ingham 777e6d01ea Change the "Debug" build to use the current MacOSX SDK. Fix the swig builder to have an explicit
short-circuit of the Python SWIG building, rather than relying on the SDKROOT being set.

llvm-svn: 157363
2012-05-24 01:16:09 +00:00
Johnny Chen a95ce623d8 rdar://problem/11457634
Supports the use-case scenario of immediately continuing the process once attached.
Add a simple completion test case from "process attach --con" to "process attach --continue ".

llvm-svn: 157361
2012-05-24 00:43:00 +00:00
Johnny Chen f9ef60d236 Add SBProcess::GetNumSupportedHardwareWatchpoints() API and export it through the Python scripting bridge.
Add/modify some test cases.

llvm-svn: 157353
2012-05-23 22:34:34 +00:00
Johnny Chen 6463720505 Add the capability to display the number of supported hardware watchpoints to the "watchpoint list" command.
Add default Process::GetWatchpointSupportInfo() impl which returns an error of "not supported".
Add "qWatchpointSupportInfo" packet to the gdb communication layer to support this, and modify TestWatchpointCommands.py to test it.

llvm-svn: 157345
2012-05-23 21:09:52 +00:00
Filipe Cabecinhas c34f776877 extra ';' outside of a function [-pedantic,-Wextra-semi]
llvm-svn: 157330
2012-05-23 16:27:09 +00:00
Filipe Cabecinhas 52008c641c Small fixes: actually return a boolean and remove semi-colons.
llvm-svn: 157328
2012-05-23 16:24:11 +00:00
Jim Ingham 04e0a2270a Process::Destroy should Halt before it tries to destroy so we don't have race conditions where we are in the middle of trying to service an event when we go to Destroy.
The AttachCompletionHandler should note that it has restarted the target if it indeed does so.

llvm-svn: 157327
2012-05-23 15:46:31 +00:00
Johnny Chen ebffd2e7fd Add more convenience registers to x86_64 and a simple test scenario:
self.expect("expr -- $ax == (($ah << 8) | $al)",
            substrs = ['true'])

llvm-svn: 157302
2012-05-22 23:32:12 +00:00
Sean Callanan 8b1e432113 Integrated a fix for an ARM disassembler crash
(0xd 0xd 0xa0 0xf4, or "vld2hs.8 {d0[], d1[]}, [r0]!")

llvm-svn: 157289
2012-05-22 21:42:43 +00:00
Johnny Chen 6c26f0b2a7 Fix a typo.
llvm-svn: 157278
2012-05-22 19:41:53 +00:00
Johnny Chen 819b35daf7 Add a test case to check that eax's content equals the lower half of rax.
Plus fix the test class name as well as wrong directory path.

llvm-svn: 157277
2012-05-22 19:37:01 +00:00
Johnny Chen b42b05e6de The RegisterInfo descriptors for the convenience registers can specify an offset to be added to the offset as derived from
the value_regs field, which is useful for future expansion purposes.  As of now, we have:

    calculated_offset_of_eax = offset_of_rax + (offset_of_eax_from_the_descriptor which is 0)

llvm-svn: 157275
2012-05-22 18:59:38 +00:00
Johnny Chen 377c63da9e Fix wrong offset of eax and friends pointed out by Greg.
rdar://problem/11487457

llvm-svn: 157272
2012-05-22 18:34:18 +00:00
Filipe Cabecinhas 9c946f3e2d Return a constant of the appropriate type.
llvm-svn: 157241
2012-05-22 08:38:06 +00:00
Filipe Cabecinhas fccc829ce7 Remove trailing semicolons.
llvm-svn: 157240
2012-05-22 08:36:18 +00:00
Johnny Chen 7a34875b3b rdar://problem/11487457
Add convenience registers eax, ebx, ecx, edx, edi, esi, ebp, esp to the 'register read' command for x86_64.
Add a GDBRemoteRegisterContext::Addx86_64ConvenienceRegisters() method called from ProcessGDBRemote::BuildDynamicRegisterInfo().
Servicing of eax, for example, is accomplished by delegating to rax with an adjusted offset into the register context.

llvm-svn: 157230
2012-05-22 00:57:05 +00:00
Johnny Chen 058bb9908f Fix a bug where if I just run:
./dotest.py

No progress bar appears.

llvm-svn: 157226
2012-05-22 00:22:18 +00:00
Jim Ingham a8558b6289 Also push file & line breakpoints past the prologue. Also added a "-K" argument to the relevant
"break set" commands to set this per breakpoint.  Also, some CreateBreakpoint API's in the lldb_private
namespace had "internal" first and "skip_prologue" second.  "internal should always be last.  Fixed that.

rdar://problem/11484729

llvm-svn: 157225
2012-05-22 00:12:20 +00:00
Sean Callanan ce8af862ae Added support for rvalue references in debug information
(actually, mainly just hooked up support that was already
there).  Added a test case, although it's expected to fail
right now unless you're using top-of-tree LLVM.

llvm-svn: 157220
2012-05-21 23:31:51 +00:00
Jim Ingham 62ac08e4e6 CompileUnit::ResolveSymbolContext was only filling in the LineEntry regardless of what was passed in for "resolve_scope". I fixed that.
llvm-svn: 157217
2012-05-21 23:06:47 +00:00
Sean Callanan 3e606ea7ae Updated the object-pointer lookup logic to fix
Objective-C "self," which is not a regular pointer.

llvm-svn: 157214
2012-05-21 22:25:52 +00:00
Sean Callanan 0061222ed8 Fixed the new-syntax testcase to reflect how we
print string literals.

llvm-svn: 157213
2012-05-21 22:25:12 +00:00
Enrico Granata 7c015e1020 Fixes for performance to data formatters - Python < 3.0 is much slower when using True/False as compared to 1/0 for logical values. Wexploit this to our advantage. Other minor tweaks
llvm-svn: 157209
2012-05-21 21:52:38 +00:00
Sean Callanan 0259e51287 Fixed a nasty bug where JIT expressions didn't work
when stopped in a const method.  Also updated our
testsuite to ensure that JIT is forced in this case.

llvm-svn: 157208
2012-05-21 21:29:52 +00:00
Sean Callanan fc732755ad Added an "rb" alias that sets breakpoints by
regular expression.

llvm-svn: 157202
2012-05-21 18:25:19 +00:00
Sean Callanan 66ad3bcb16 Integrated a check into Clang that make sure that
it doesn't try to call LookupDestructor on an
incomplete class.

llvm-svn: 157199
2012-05-21 17:54:55 +00:00
Sean Callanan a69e64481d Added a GDB equivalent for saving binary memory
data.

llvm-svn: 157192
2012-05-21 17:01:59 +00:00
Enrico Granata fd4c84ee9f <rdar://problem/11355592> Fixing a bug where we would incorrectly try and determine a dynamic type for a variable of a pointer type that is not a valid generic type for dynamic pointers.
llvm-svn: 157190
2012-05-21 16:51:35 +00:00
Filipe Cabecinhas 721ba3ff77 Fixes the case where we created a dummy target, deleted it, and then tried to evaluate an expression with no target.
llvm-svn: 157110
2012-05-19 09:59:08 +00:00
Sean Callanan 02b00c9ba7 Updated LLVM to take a disassembler fix that causes
the LOCK prefix to be printed explicitly when it's
the first prefix on the instruction.

llvm-svn: 157096
2012-05-19 02:36:49 +00:00
Jason Molenda 8d27075c3d bump to lldb-150.
llvm-svn: 157090
2012-05-19 00:32:19 +00:00
Greg Clayton de87c0fdb4 Forgot to bump the local string buffer up in size after debugging to make sure long strings would be correctly read when the buffer is too small for the string.
llvm-svn: 157087
2012-05-19 00:18:00 +00:00
Johnny Chen 90830703b2 Add test cases where we start three worker threads, with a write watchpoint set. As soon as a watchpoint is hit in either of the worker thread,
we delete the watchpoint.  The test succeeds when no more watchpoint hit event fires after the deletion of the watchpoint.

related to rdar://problem/11320188

llvm-svn: 157084
2012-05-18 23:30:57 +00:00
Greg Clayton 4c82d425fa Found a quick way to improve the speed with which we can read object files from memory when they are in the shared cache: always read the symbol table strings from memory and let the process' memory cache do the work.
llvm-svn: 157083
2012-05-18 23:20:01 +00:00
Greg Clayton 6c59661e4f Warn when we detect a valid dSYM file that is empty. This can happen when a dSYM file is created from a binary with no debug info, that has been stripped, or when the .o files are not available when the dSYM is created.
llvm-svn: 157078
2012-05-18 21:47:20 +00:00
Filipe Cabecinhas 5158f3de24 Cleanup a custom thread-format so we don't fail TestLoadUnload when running the
test suite for two architectures (the full path to d.c would appear).

llvm-svn: 157077
2012-05-18 21:35:43 +00:00
Enrico Granata 263ebe5f78 Optimizations to the Python ObjC formatters - Benchmarking infrastructure
llvm-svn: 157066
2012-05-18 19:55:37 +00:00