Commit Graph

5119 Commits

Author SHA1 Message Date
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