Commit Graph

3467 Commits

Author SHA1 Message Date
Johnny Chen 90d6fe5d35 Add FindValue() and WatchValue() fuzz calls to the mix.
llvm-svn: 140439
2011-09-24 01:02:22 +00:00
Greg Clayton cac9c5f971 Added to the public API to allow symbolication:
- New SBSection objects that are object file sections which can be accessed
  through the SBModule classes. You can get the number of sections, get a 
  section at index, and find a section by name.
- SBSections can contain subsections (first find "__TEXT" on darwin, then
  us the resulting SBSection to find "__text" sub section).
- Set load addresses for a SBSection in the SBTarget interface
- Set the load addresses of all SBSection in a SBModule in the SBTarget interface
- Add a new module the an existing target in the SBTarget interface
- Get a SBSection from a SBAddress object

This should get us a lot closer to being able to symbolicate using LLDB through
the public API.

llvm-svn: 140437
2011-09-24 00:52:29 +00:00
Johnny Chen 6027c94d2f Add an SB API SBFrame::WatchValue() and exported to the Python interface to
set a watchpoint Pythonically.  If the find-and-watch-a-variable operation
fails, an invalid SBValue is returned, instead.

Example Python usage:

        value = frame0.WatchValue('global',
                                  lldb.eValueTypeVariableGlobal,
                                  lldb.LLDB_WATCH_TYPE_READ|lldb.LLDB_WATCH_TYPE_WRITE)

Add TestSetWatchpoint.py to exercise this API.
We have 400 test cases now.

llvm-svn: 140436
2011-09-24 00:50:33 +00:00
Johnny Chen 12e27887cb Add a simple regression test for 'target stop-hook list' with no target specified.
It should not crash lldb.

llvm-svn: 140421
2011-09-23 21:34:40 +00:00
Jim Ingham 76bb759605 Added a test for problems caused when Clang errantly makes the line range for one line
too long, so that the jump from the line above the bad line to the line after
ends up in the middle of the bad line instead.  Added a workaround to lldb to just
continue to the end if we find ourselves stopped in the middle of some other line.

llvm-svn: 140419
2011-09-23 21:24:57 +00:00
Johnny Chen edf503757c Add a (bool)end_to_end parameter, default true, to the Target::Remove/Disable/EnableALLWatchpointLocations()
methods.  If passed as false, it signifies that only the debugger side is affected.

Modify Target::DeleteCurrentProcess() to use DisableAllWatchpointLocations(false) to
disable the watchpoint locations, instead of removing them between process instances.

llvm-svn: 140418
2011-09-23 21:21:43 +00:00
Jason Molenda effcd2aa70 in CommandObjectTargetStopHookList::Execute, if we don't have a target,
return before we try to dereference the target later in the function.
Currently,

% lldb -x
(lldb) target stop-hook list

crashes because of this.

llvm-svn: 140417
2011-09-23 21:15:42 +00:00
Jim Ingham 843bfb2c4e If stepping takes us from the line range we were stepping through into the MIDDLE of another line, then continue till we get to the real beginning of a line. This is mostly to work around debug information bugs.
llvm-svn: 140416
2011-09-23 21:08:11 +00:00
Johnny Chen 947961c151 Add test cases for watchpoint list, enable, disable, and delete commands.
llvm-svn: 140398
2011-09-23 18:42:28 +00:00
Johnny Chen 3aa2889cc7 A second try to make the TestStopHookMechanism.py more robust after recent changes.
llvm-svn: 140396
2011-09-23 18:25:02 +00:00
Johnny Chen 84128e640d Add a simple test case for 'help watchpoint', 'help watchpt-id', and 'help watchpt-id-list'.
llvm-svn: 140393
2011-09-23 17:57:49 +00:00
Johnny Chen 825815fbaf The "Stop Hooks" anchors have been removed from the stop-hook output.
Update the test case to fix test suite failure.

llvm-svn: 140392
2011-09-23 17:53:13 +00:00
Jim Ingham 87df91b866 Added the ability to restrict breakpoints by function name, function regexp, selector
etc to specific source files.
Added SB API's to specify these source files & also more than one module.
Added an "exact" option to CompileUnit's FindLineEntry API.

llvm-svn: 140362
2011-09-23 00:54:11 +00:00
Jason Molenda 879cf77d12 Remove the Stop Hooks / End Stop Hooks lines before/after running
the stop-hooks.  I've been living on lldb with some stop-hooks
defined for the past week and the five extra lines of output on
every stop is really detracting from the usefulness of this feature.

llvm-svn: 140358
2011-09-23 00:42:55 +00:00
Jason Molenda 7f85299c1b LookupAddressInModule: Remove a couple of the extra
newlines output at the end of 'image lookup' / 'image lookup -v'.

llvm-svn: 140357
2011-09-23 00:27:44 +00:00
Johnny Chen de75346496 Watchpoint IDs and ID Ranges are not quite the same as Breakpoint IDs and ID Ranges.
Add eArgTypeWatchpointID and eArgTypeWatchpointIDRange to the CommandArgumentType enums and
modify the signature of CommandObject::AddIDsArgumentData() from:

    AddIDsArgumentData(CommandArgumentEntry &arg)

to:

    AddIDsArgumentData(CommandArgumentEntry &arg, CommandArgumentType ID, CommandArgumentType IDRange)

to accommodate.

llvm-svn: 140346
2011-09-22 22:34:09 +00:00
Greg Clayton 16abd328f5 Added missing forward declarations for SBFileSpecList and SBInstructionList.
llvm-svn: 140338
2011-09-22 21:17:19 +00:00
Johnny Chen f04ee930a0 Add initial implementation of watchpoint commands for list, enable, disable, and delete.
Test cases to be added later.

llvm-svn: 140322
2011-09-22 18:04:58 +00:00
Greg Clayton c14ee32db5 Converted the lldb_private::Process over to use the intrusive
shared pointers.

Changed the ExecutionContext over to use shared pointers for
the target, process, thread and frame since these objects can
easily go away at any time and any object that was holding onto
an ExecutionContext was running the risk of using a bad object.

Now that the shared pointers for target, process, thread and
frame are just a single pointer (they all use the instrusive
shared pointers) the execution context is much safer and still
the same size. 

Made the shared pointers in the the ExecutionContext class protected
and made accessors for all of the various ways to get at the pointers,
references, and shared pointers.

llvm-svn: 140298
2011-09-22 04:58:26 +00:00
Jason Molenda 1201723797 Fix printf call in SearchFilterByModuleList::GetDescription.
llvm-svn: 140289
2011-09-22 02:24:49 +00:00
Sean Callanan 0886e5657b Fixed a problem with the IR interpreter that caused
it to generate result variables that were not bound
to their underlying data.  This allowed the SBValue
class to use the interpreter (if possible).

Also made sure that any result variables that point
to stack allocations in the stack frame of the
interpreted expressions do not get live data.

llvm-svn: 140285
2011-09-22 00:41:11 +00:00
Johnny Chen fd158f411a StopInfoWatchpoint should override the StopInfo::ShouldStop() virtual method and delegate to
the WatchpointLocation object to check whether it should stop and allow it to update the hit
count, among other bookkeepings.

llvm-svn: 140279
2011-09-21 22:47:15 +00:00
Greg Clayton c1ef10f99e Fixed two printf format errors.
llvm-svn: 140239
2011-09-21 06:45:51 +00:00
Greg Clayton 593577a13a The first part of a fix for being able to select an architecture slice from
a file when the target has a triple with an unknown vendor and/or OS and the
slice of the file itself has a valid vendor and/or OS.

The Module now adopts the ObjectFile's architecture after a valid architecture
has been loaded to make sure the module matches the object file.

llvm-svn: 140236
2011-09-21 03:57:31 +00:00
Jim Ingham 969795f14b Add a new breakpoint type "break by source regular expression".
Fix the RegularExpression class so it has a real copy constructor.
Fix the breakpoint setting with multiple shared libraries so it makes
  one breakpoint not one per shared library.
Add SBFileSpecList, to be used to expose the above to the SB interface (not done yet.)

llvm-svn: 140225
2011-09-21 01:17:13 +00:00
Johnny Chen a3234732a0 Fix comment typo.
llvm-svn: 140222
2011-09-21 01:04:49 +00:00
Johnny Chen 184d7a727e A little refactoring of the way to add break IDs or ID ranges as command argument data
to the command argument entry.  Add a static helper function:

    CommandObject::AddIDsArgumentData(CommandArgumentEntry &arg)

to be used from CommandObjectBreakpoint.cpp.  The helper function could also be useful
for commands in the future to manipulate watchpoints.

llvm-svn: 140221
2011-09-21 01:00:02 +00:00
Johnny Chen 86364b4521 Add some watchpoint maintenance methods to the Target class.
Plus some minor changes to the WatchpointLocationList and WatchpointLocation classes.

llvm-svn: 140211
2011-09-20 23:28:55 +00:00
Jason Molenda ca0e3fa325 One last printf-style call cleanup.
llvm-svn: 140205
2011-09-20 23:23:44 +00:00
Sean Callanan 90539456a1 Fixed a problem where expressions would attempt to
allocate memory in a process that did not support
expression execution.  Also improved detection of
whether or not a process can execute expressions.

llvm-svn: 140202
2011-09-20 23:01:51 +00:00
Jason Molenda fd54b368ea Update declarations for all functions/methods that accept printf-style
stdarg formats to use __attribute__ format so the compiler can flag
incorrect uses.  Fix all incorrect uses.  Most of these are innocuous,
a few were resulting in crashes.

llvm-svn: 140185
2011-09-20 21:44:10 +00:00
Johnny Chen d0b0f4920c Add four new expectedFailre decorators to new failures most likely due to r139772 check-in.
llvm-svn: 140150
2011-09-20 17:31:05 +00:00
Jason Molenda 7e589a6011 Change Error::SetErrorStringWithFormat() prototype to use an
__attribute__ format so the compiler knows that this method takes
printf style formatter arguments and checks that it's being used
correctly.  Fix a couple dozen incorrect SetErrorStringWithFormat()
calls throughout the sources.

llvm-svn: 140115
2011-09-20 00:26:08 +00:00
Johnny Chen ac559323aa Add GetByIndex() methods to the WatchpointLocationList class to facilitate iteration
through the watchpoint locations by index.

llvm-svn: 140071
2011-09-19 21:53:51 +00:00
Johnny Chen 870f4f4213 The r139982 patch has a bug by using the constant "x86_AVX_STATE64".
Patch by Filipe.

llvm-svn: 140037
2011-09-19 18:54:01 +00:00
Greg Clayton 762f7135e2 Don't put modules for .o files into the global shared module list. We
used to do this because we needed to find the shared pointer for a .o
file when the .o file's module was needed in a SymbolContext since the
module in a symbol context was a shared pointer. Now that we are using
intrusive pointers we don't have this limitation anymore since any
instrusive shared pointer can be made from a pointer to an object
all on its own.

Also switched over to having the Module and SymbolVendor use shared 
pointers to their object files as had a leak on MacOSX when the 
SymbolVendor's object file wasn't the same as the Module's (debug info
in a stand along file (dSYM file)). Now everything will correctly clean
itself up when the module goes away after an executable gets rebuilt.

Now we correctly get rid of .o files that are used with the DWARF with 
debug map executables on subsequent runs since the only shared pointer
to the object files in from the DWARF symbol file debug map parser, and
when the module gets replaced, it destroys to old one along with all .o 
files. 

Also added a small optimization when using BSD archives where we will
remove old BSD containers from the shared list when they are outdated.

llvm-svn: 140002
2011-09-18 18:59:15 +00:00
Greg Clayton 4d122c4009 Adopt the intrusive pointers in:
lldb_private::Breakpoint
lldb_private::BreakpointLocations
lldb_private::BreakpointSite
lldb_private::Debugger
lldb_private::StackFrame
lldb_private::Thread
lldb_private::Target

llvm-svn: 139985
2011-09-17 08:33:22 +00:00
Greg Clayton a2eee184e0 Removed the function:
ModuleSP
	Module::GetSP();

Since we are now using intrusive ref counts, we can easily turn any
pointer to a module into a shared pointer just by assigning it.
	

llvm-svn: 139984
2011-09-17 07:23:18 +00:00
Greg Clayton 747bcb03d2 Convert lldb::ModuleSP to use an instrusive ref counted pointer.
We had some cases where getting the shared pointer for a module from
the global module list was causing a performance issue when debugging
with DWARF in .o files. Now that the module uses intrusive ref counts,
we can easily convert any pointer to a shared pointer.

llvm-svn: 139983
2011-09-17 06:21:20 +00:00
Greg Clayton 5631ebce5e Added more logging, and renamed FPR to FPU in a the register set/flavor enum.
llvm-svn: 139982
2011-09-17 05:59:37 +00:00
Greg Clayton 5299cc58cb Correctly handle the when we the 'G' packet fails. There were
cases where we were returning no error even though this packet
was failing.

llvm-svn: 139981
2011-09-17 05:47:55 +00:00
Greg Clayton 9163c394d9 Make sure to print out register names when reading registers and also
be able to display 256 byte registers.

llvm-svn: 139980
2011-09-17 05:45:35 +00:00
Johnny Chen 236888d026 Foe x86_64/i386, piggyback the hardware index of the fired watchpoint in the exception
data sent back to the debugger.  On the debugger side, use the opportunity during the
StopInfoMachException::CreateStopReasonWithMachException() method to set the hardware index
for the very watchpoint location.

llvm-svn: 139975
2011-09-17 01:05:03 +00:00
Johnny Chen 18d7b950e1 Fix typo.
llvm-svn: 139948
2011-09-16 21:46:38 +00:00
Johnny Chen 2a82cd5232 Add comment.
llvm-svn: 139947
2011-09-16 21:44:45 +00:00
Johnny Chen de6bd2432c Add a declaraion info member field to the WatchpointLocation class.
Modify CommandObjectFrame.cpp to populate this field when creating a watchpoint location.
Update the test case to verify that the declaration info matches the file and line number.

llvm-svn: 139946
2011-09-16 21:41:42 +00:00
Johnny Chen 9846019114 Minor change for output message (less is better).
llvm-svn: 139924
2011-09-16 18:09:45 +00:00
Johnny Chen 9c0a94ad64 To be more paranoid, check cmd_output before searching in it.
llvm-svn: 139920
2011-09-16 18:03:19 +00:00
Johnny Chen 095ff6fdf6 Rephrase the checkDsymForUUIDIsNotOn() a bit so that in the normal case where automatic
lookup and cacheing of dSYMs is not enabled, the 'defaults read com.apple.DebugSymbols'
output is not shown.

llvm-svn: 139914
2011-09-16 17:50:44 +00:00
Jason Molenda 113f2d5289 Tighten up the 'log enable lldb unwind' printing for
the arm emulate instruction unwinder so you can leave it
on by default and not be overwhelmed.  Set verbose mode to
get the full story on how the unwindplans were created.

llvm-svn: 139897
2011-09-16 01:32:10 +00:00
Johnny Chen 3cc78e608e Add a check for the test driver to make sure that, on Mac OS X, the automatic lookup and caching
of dSYMs is not turned on before running the test suite.

llvm-svn: 139896
2011-09-16 01:04:26 +00:00
Johnny Chen f436eea584 Untabify and fix indentation.
llvm-svn: 139867
2011-09-15 22:25:30 +00:00
Johnny Chen 3c7054a37b Fix wrong test method name.
llvm-svn: 139863
2011-09-15 22:13:43 +00:00
Johnny Chen 55114c241c Untabify and fix indentations. Tabs are bad.
llvm-svn: 139862
2011-09-15 22:05:38 +00:00
Johnny Chen 81be205460 Add fuzz calls for added API methods: FindFirstType(), FindTypes(), and GetSourceManager().
llvm-svn: 139857
2011-09-15 21:58:36 +00:00
Johnny Chen b08b736de9 Add fuzz calls to newly added methods: GetAsync() and SetSelectedTarget(SBTarget).
llvm-svn: 139855
2011-09-15 21:52:59 +00:00
Jim Ingham 8314c5259d Track whether a process was Launched or Attached to. If Attached, the detach when the debugger is destroyed, rather than killing the process. Also added a Debugger::Clear, which gets called in Debugger::Destroy to deal with all the targets in the Debugger. Also made the Driver's main loop call Destroy on the debugger, rather than just Destroying the currently selected Target's process.
llvm-svn: 139853
2011-09-15 21:36:42 +00:00
Jim Ingham 12e9a2012f Track whether a process was Launched or Attached to. If Attached, the detach when the debugger is destroyed, rather than killing the process. Also added a Debugger::Clear, which gets called in Debugger::Destroy to deal with all the targets in the Debugger. Also made the Driver's main loop call Destroy on the debugger, rather than just Destroying the currently selected Target's process.
llvm-svn: 139852
2011-09-15 21:30:02 +00:00
Johnny Chen f68cc12453 Add a simple watchpoint test to exercise watchpoint creation followed by watchpoint hit events.
llvm-svn: 139847
2011-09-15 21:09:59 +00:00
Johnny Chen ecb623a672 Add cleanup of watchpoint locations during Target::DeleteCurrentProcess().
llvm-svn: 139840
2011-09-15 20:54:25 +00:00
Sean Callanan c2ff27446d Fixed a problem where the symbol context was not
being initialized properly in the absence of a
process.

llvm-svn: 139823
2011-09-15 18:41:04 +00:00
Sean Callanan 64fe1994d8 Fixed a problem where the expression parser would
attempt to obtain information from the process even
in cases where the process isn't available.

llvm-svn: 139803
2011-09-15 17:43:00 +00:00
Johnny Chen 848b5b9903 Fixed indentation.
llvm-svn: 139802
2011-09-15 17:36:17 +00:00
Johnny Chen 76abb3b559 Add comment regarding method call to DNBArchProtocol::NotifyException().
llvm-svn: 139800
2011-09-15 17:17:51 +00:00
Sean Callanan 3bfdaa2a47 This patch modifies the expression parser to allow it
to execute expressions even in the absence of a process.
This allows expressions to run in situations where the
target cannot run -- e.g., to perform calculations based
on type information, or to inspect a binary's static
data.

This modification touches the following files:

lldb-private-enumerations.h
  Introduce a new enum specifying the policy for
  processing an expression.  Some expressions should
  always be JITted, for example if they are functions
  that will be used over and over again.  Some
  expressions should always be interpreted, for
  example if the target is unsafe to run.  For most,
  it is acceptable to JIT them, but interpretation
  is preferable when possible.

Target.[h,cpp]
  Have EvaluateExpression now accept the new enum.

ClangExpressionDeclMap.[cpp,h]
  Add support for the IR interpreter and also make
  the ClangExpressionDeclMap more robust in the 
  absence of a process.

ClangFunction.[cpp,h]
  Add support for the new enum.

IRInterpreter.[cpp,h]
  New implementation.

ClangUserExpression.[cpp,h]
  Add support for the new enum, and for running 
  expressions in the absence of a process.

ClangExpression.h
  Remove references to the old DWARF-based method
  of evaluating expressions, because it has been
  superseded for now.

ClangUtilityFunction.[cpp,h]
  Add support for the new enum.

ClangExpressionParser.[cpp,h]
  Add support for the new enum, remove references
  to DWARF, and add support for checking whether
  the expression could be evaluated statically.

IRForTarget.[h,cpp]
  Add support for the new enum, and add utility
  functions to support the interpreter.

IRToDWARF.cpp
  Removed

CommandObjectExpression.cpp
  Remove references to the obsolete -i option.

Process.cpp 
  Modify calls to ClangUserExpression::Evaluate
  to pass the correct enum (for dlopen/dlclose)

SBValue.cpp
  Add support for the new enum.

SBFrame.cpp
  Add support for he new enum.

BreakpointOptions.cpp
  Add support for the new enum.

llvm-svn: 139772
2011-09-15 02:13:07 +00:00
Johnny Chen 88c1b77f74 Modify MachThread::NotifyException() to allow the arch specific protocol to process
the passed in (MachException::Data &)exc first before possible reassignment of the
member m_stop_exception with exc.  This allows lldb to stop at the watchpoint of
a simple test program.

llvm-svn: 139767
2011-09-15 01:12:15 +00:00
Jim Ingham 4299fdb1a3 Take out all the separate places in Attach where we were getting the target architecture, and move that but of functionality into CompleteAttach.
llvm-svn: 139766
2011-09-15 01:10:17 +00:00
Jim Ingham 31412642a6 Change the "attach" command to always wait synchronously for the target to stop. It's not very useful to return the prompt in mid-attach, and it makes reporting the result of the attach hard to do.
llvm-svn: 139764
2011-09-15 01:08:57 +00:00
Jim Ingham 4d9695a2b6 Fix ArchSpec::operator== to take the Triple into account as well as the Core. Also make the constructors explicit.
llvm-svn: 139762
2011-09-15 01:07:30 +00:00
Jim Ingham e76b036ebf Fix ArchSpec::operator== to take the Triple into account as well as the Core. Also make the constructors explicit.
llvm-svn: 139761
2011-09-15 01:07:28 +00:00
Jason Molenda 995cd3a514 Have the FuncUnwinder object request & provide an architecture-defined
UnwindPlan for unwinding from the first instruction of an otherwise
unknown function call (GetUnwindPlanArchitectureDefaultAtFunctionEntry()).

Update RegisterContextLLDB::GetFullUnwindPlanForFrame() to detect the
case of a frame 0 at address 0x0 which indicates that we jumped through
a NULL function pointer.  Use the ABI's FunctionEntryUnwindPlan to
find the caller frame.

These changes make it so lldb can identify the calling frame correctly
in code like

int main ()
{
  void (*f)(void) = 0;
  f();
}

llvm-svn: 139760
2011-09-15 00:44:34 +00:00
Greg Clayton e1dadb831a Set the OS in the triple correctly in response to the qHostInfo packet.
llvm-svn: 139759
2011-09-15 00:21:03 +00:00
Johnny Chen 45e541f0ed Fix a bug where re-use of the same existing target-wise watchpoint did not work correctly.
llvm-svn: 139746
2011-09-14 22:20:15 +00:00
Johnny Chen 0c40637012 Add logging to Target::CreateWatchpointLocation() and fix some bug of using the wrong variable.
Plus simplify WatchpointLocation::Dump() output.

llvm-svn: 139724
2011-09-14 20:23:45 +00:00
Jim Ingham 91991efcdc If we haven't gotten the architecture of the process we're attaching
to by the time we get to the AttachCompletionHandler, do it before
completing the attach.

llvm-svn: 139679
2011-09-14 01:01:48 +00:00
Johnny Chen ab9ee76ee5 Add comments.
llvm-svn: 139673
2011-09-14 00:26:03 +00:00
Johnny Chen 3ba42283f4 Update I386 DNB impl to fix the same errors as DNBArchImplX86_64: ('==' instead of '=') and (by value instead of by reference).
llvm-svn: 139667
2011-09-13 23:43:18 +00:00
Johnny Chen 3c53258964 Watchpoint WIP:
o WatchpointLocationList:
  Add a GetListMutex() method.
o WatchpointLocation:
  Fix Dump() method where there was an extra % in the format string.
o Target.cpp:
  Add implementation to CreateWatchpointLocation() to create and enable a watchpoint.

o DNBArchImplX86_64.cpp:
  Fix bugs in SetWatchpoint()/ClearWatchpoint() where '==' was used, instead of '=',
  to assign/reset the data break address to a debug register.

  Also fix bugs where a by reference debug_state should have been used, not by value.

llvm-svn: 139666
2011-09-13 23:29:31 +00:00
Jim Ingham e64f0dc7bf Adding "-n", "-p" and "-w" flags to the lldb command-line tool to
allow attaching from the command line.

llvm-svn: 139665
2011-09-13 23:25:31 +00:00
Johnny Chen 2fd89a0956 Get the address and the size of the variable for passing to the Target::CreateWatchpointLocation() method.
llvm-svn: 139614
2011-09-13 18:30:59 +00:00
Greg Clayton cce8671fca Fixed some incorrect return values.
llvm-svn: 139582
2011-09-13 04:03:52 +00:00
Johnny Chen 7313a648e9 Fix compiler warning.
llvm-svn: 139569
2011-09-13 01:15:36 +00:00
Johnny Chen 02ae341043 Add trivial implementation for GetDescription().
llvm-svn: 139568
2011-09-13 01:13:20 +00:00
Jason Molenda 354b9a65f9 In ThreadList::GetSelectedThread, handle the case where we have no
valid threads - can happen if attaching to a process fails in a
certain way.

llvm-svn: 139567
2011-09-13 01:13:16 +00:00
Jason Molenda 542adbfccf Change the macosx Host::FindProcesses() to include all processes
(running under any uid) if lldb is being run as root.  It might be
better to handle this up at the ProcessInstanceInfoMatch class with
its m_match_all_users ivar instead of down here...

llvm-svn: 139566
2011-09-13 00:52:59 +00:00
Jim Ingham e37d605e7d SBSourceManager now gets the real source manager either from the Debugger or Target. Also, move the SourceManager file cache into the debugger
so it can be shared amongst the targets.

llvm-svn: 139564
2011-09-13 00:29:56 +00:00
Johnny Chen 1e49e5e730 Remove an unnecessary 'else { ... }', which adds to vertical as well as horizontal spans,
from CommandObjectFrame::Execute().

llvm-svn: 139561
2011-09-12 23:58:53 +00:00
Johnny Chen 887062aeb3 Watchpoint WIP:
o Rename from OptionGroupWatchpoint::WatchMode to OptionGroupWatchpoint::WatchType,
  and CommandArgumentType::eArgTypeWatchMode to CommandArgumentType::eArgTypeWatchType.
  Update the sources to reflect the change.

o Add a CreateWatchpointLocation() method to Target class, which is currently not implmeneted
  (returns an empty WatchpointLocationSP object).  Add logic to CommandObjectFrame::Execute()
  to exercise the added API for creating a watchpoint location.

llvm-svn: 139560
2011-09-12 23:38:44 +00:00
Greg Clayton d4a2b37091 Huge memory and performance improvements in the DWARF parser.
Address ranges are now split up into two different tables: 
- one in DWARFDebugInfo that is compile unit specific
- one in each DWARFCompileUnit that has exact function DIE offsets

This helps keep the size of the aranges down since the main table will get
uniqued and sorted and have consecutive ranges merged. We then only parse the
compile unit one on demand once we have determined that a compile unit contains
the address in question. We also now use the .debug_aranges section if there 
is one instead of always indexing the DWARF manually.

NameToDIE now uses a UniqueCStringMap<dw_offset> map instead of a std::map.
std::map is very bulky as each node has 3 pointers and the key and value types.
This gets our NameToDIE entry down to 12 bytes each instead of 48 which saves
us a lot of memory when we have very large DWARF.

DWARFDebugAranges now has a smaller footprint for each range it contains to 
save on memory.

llvm-svn: 139557
2011-09-12 23:21:58 +00:00
Johnny Chen 926d086e9b Fix indentations, add some comments.
llvm-svn: 139534
2011-09-12 20:25:57 +00:00
Greg Clayton 98f8c5252e Added GDB/LLDB commands for the "target stop-hook add" command.
llvm-svn: 139529
2011-09-12 19:56:07 +00:00
Johnny Chen 3a9838c07b Fix a bug in OptionGroupWatchpoint.cpp where the '-w' option arg parsing result was not checked
to effect an early error return.

Plus add logic to 'frame variable' command object to check that when watchpoint option is on,
only one variable with exact name (no regex) is specified as the sole command arg.

llvm-svn: 139524
2011-09-12 19:12:06 +00:00
Greg Clayton a76dd62211 Fixed the header guards.
llvm-svn: 139490
2011-09-12 04:20:38 +00:00
Greg Clayton b14eeddaa1 Fixed the logging output to be done consistently across all plug-ins.
Added a new log category for DWARF called "aranges" to log the parsing
of address ranges.

llvm-svn: 139489
2011-09-12 04:05:41 +00:00
Greg Clayton 6372d1cda2 Changed to using an "operator bool" instead of an "operator void*"
and avoid returning a pointer to the current object. In the new 
"operator bool" implementation, check the filename object first 
since many times we have FileSpec objects with a filename, yet no
directory.

llvm-svn: 139488
2011-09-12 04:00:42 +00:00
Greg Clayton 24756648e5 Fixed up the comments in the headerdoc to match the current implementation
of how ConstString objects work, and removed the duplicate and out of date
comments that were in the cpp file.

llvm-svn: 139487
2011-09-12 03:55:58 +00:00
Greg Clayton 38e953dda2 Fixes for Symtab.cpp to take advantage of the new unique C string map
changes that were just submitted.

llvm-svn: 139478
2011-09-11 00:20:09 +00:00
Greg Clayton c0a87652ba Added extra calls to the UniqueCStringMap to allow it to be used
more efficiently when it contains a large number of items. Since
the map is actually a vector of "const char *" and type T values,
it will double in size every time you append to it. The extra
added functions allow the collection to be sized to fit the data
after all entries have been appended, and lookups by name or by
regex have been built in to the class to allow efficient lookup.

llvm-svn: 139477
2011-09-11 00:06:05 +00:00
Greg Clayton 14a3551aea Don't skip the application specific ~/.lldbinit file when the program
name is "lldb". So currently when you startup any application and you
have not specified that you would like to skip loading init files through
the API or from "lldb" options, then LLDB will try and load:

"~/.lldbinit-%s" where %s the basename of your program
"~/.lldbinit"

Then LLDB will load any program specified on the command line and then
source the "./.llbinit" file for any temporary debug session specific
commands.

I want this feature because I have thread and frame formats that do
ANSI color codes that I only want to load when running in a terminal
which is when I am running the "lldb" command line program.

llvm-svn: 139476
2011-09-11 00:01:44 +00:00
Johnny Chen 944cdc09a9 A little bit of cleanup; set watch_mode to eWatchInvalid at the OptionParsingStarting() lifecycle point.
llvm-svn: 139467
2011-09-10 06:22:46 +00:00