Commit Graph

4249 Commits

Author SHA1 Message Date
Johnny Chen 8d24390cad Clearify some comment.
llvm-svn: 148972
2012-01-25 20:29:26 +00:00
Johnny Chen 78e49e7fee Cleanup docstring and remove dead code.
llvm-svn: 148971
2012-01-25 20:25:38 +00:00
Greg Clayton 9431f01f65 Handle 's' packets correctly when disassembling GDB packet output.
llvm-svn: 148911
2012-01-25 03:20:34 +00:00
Johnny Chen f41385f9be Add some more test cases for command completion:
o complete an unambiguous option
  o complete/list the available option values
  o complete/list the candidate command names

llvm-svn: 148899
2012-01-25 01:37:36 +00:00
Johnny Chen 5f3bf63cac Fix a typo in the error message of the StopInfoWatchpoint class.
llvm-svn: 148876
2012-01-24 23:19:25 +00:00
Sean Callanan 175a0d04b6 Added a mechanism for the IR interpreter to return
an error along with its boolean result.  The
expression parser reports this error if the 
interpreter fails and the expression could not be
run in the target.

llvm-svn: 148870
2012-01-24 22:06:48 +00:00
Jim Ingham feb332c0f7 Better name for the Python Scripting.
llvm-svn: 148770
2012-01-24 02:44:55 +00:00
Jim Ingham 6ae0f99f59 Better name for the python reference.
llvm-svn: 148769
2012-01-24 02:44:07 +00:00
Jim Ingham 87a593687c Proof-reading the python docs.
llvm-svn: 148768
2012-01-24 02:40:42 +00:00
Johnny Chen d0077903d0 Modify redo.py script so that if sessin_dir is left unspecified, it uses the heuristic
to find the possible session directories with names starting with %Y-%m-%d- (for example,
2012-01-23-) and employs the one with the latest timestamp.  For example:

johnny:/Volumes/data/lldb/svn/latest/test $ ./redo.py 
Using session dir path: /Volumes/data/lldb/svn/latest/test/2012-01-23-11_28_30
adding filterspec: DisassembleRawDataTestCase.test_disassemble_raw_data
Running ./dotest.py  -C clang  -v -t -f DisassembleRawDataTestCase.test_disassemble_raw_data
LLDB build dir: /Volumes/data/lldb/svn/latest/build/Debug
LLDB-108
Path: /Volumes/data/lldb/svn/latest
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 148710
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 148650
Last Changed Date: 2012-01-21 18:55:08 -0800 (Sat, 21 Jan 2012)



Session logs for test failures/errors/unexpected successes will go into directory '2012-01-23-17_04_48'
Command invoked: python ./dotest.py -C clang -v -t -f DisassembleRawDataTestCase.test_disassemble_raw_data

Configuration:  compiler=clang
----------------------------------------------------------------------
Collected 1 test

Change dir to: /Volumes/data/lldb/svn/latest/test/python_api/disassemble-raw-data
1: test_disassemble_raw_data (TestDisassembleRawData.DisassembleRawDataTestCase)
   Test disassembling raw bytes with the API. ... 
Raw bytes:    ['0x48', '0x89', '0xe5']
Disassembled: movq   %rsp, %rbp
ok
Restore dir to: /Volumes/data/lldb/svn/latest/test

----------------------------------------------------------------------
Ran 1 test in 0.233s

OK

llvm-svn: 148766
2012-01-24 01:53:02 +00:00
Johnny Chen a5cde26b3e Minor comment change. Plus use member function instead of directly accessing member field.
llvm-svn: 148756
2012-01-24 00:11:02 +00:00
Johnny Chen fab7a91d92 Tiny refactoring to use member functions instead of directly accessing member fields.
llvm-svn: 148743
2012-01-23 23:03:59 +00:00
Johnny Chen 8cc80b2914 Followup check in for http://llvm.org/viewvc/llvm-project?rev=148491&view=rev,
where we changed the CommandObjectSettingsSet object impl to require raw command string.

Do the same for CommandObjectSettingsAppend/InsertBefore/InsertAfter classes and
add test cases for basic functionalities as well as for variable name completion.

llvm-svn: 148719
2012-01-23 19:49:28 +00:00
Johnny Chen e20e9aeb25 Dump the raw bytes and the disassembled instruction before calling self.assertTrue() instead of after,
in case the assert fails for any reason.

llvm-svn: 148717
2012-01-23 19:37:53 +00:00
Greg Clayton d879a6305b Added a python FAQ page with detailed examples of how to add python functions
to breakpoints, creating new LLDB commands using python modules and also how
to run scripts from the command line. 

llvm-svn: 148650
2012-01-22 02:55:08 +00:00
Greg Clayton bc48f32d0a Added options to specify how many instructions before and after the frame
PC to disassemble. Users can also specify the frame depth to disassemble to
and also if disassembly should happen for all threads.

llvm-svn: 148627
2012-01-21 05:10:20 +00:00
Greg Clayton 53b43b0798 Use the "shlex" module to parse the command line that was passed down into
python so that single and double quotes and other standard shell like argument
parsing happens as expected before passing stuff along to option parsing.

Also handle exceptions so that we don't accidentally exit lldb if an uncaught
exception occurs.

llvm-svn: 148623
2012-01-21 04:26:24 +00:00
Greg Clayton 3af493f068 <rdar://problem/10711649>
A Small tweak to handle a zero timeout.

llvm-svn: 148617
2012-01-21 02:28:13 +00:00
Jim Ingham c668f81107 Our Read functions were taking a timeout of UINT32_MAX to mean wait forever, but then
we didn't implement that in setting the socket option.
<rdar://problem/10711649>

llvm-svn: 148616
2012-01-21 02:03:41 +00:00
Johnny Chen 5928f64e2c Followup check in for http://llvm.org/viewvc/llvm-project?rev=148491&view=rev,
where we changed the CommandObjectSettingsSet object impl to require raw command string.

Do the same for CommandObjectSettingsReplace class and add two test cases; one for
the "settings replace" command and the other to ensure that completion for variable
name still works. 

llvm-svn: 148615
2012-01-21 01:45:18 +00:00
Greg Clayton 6b10d5470e Bumped Xcode project versions for lldb-108 and debugserver-166.
llvm-svn: 148613
2012-01-21 01:15:06 +00:00
Greg Clayton 5c0f483ec1 Fixed it so the "--help" option works for the crashlog command. Corrected and
filled out the command help and removed unused options.

Updated the command to have a "--load-all" option that will cause the target
that gets created to locate and load all images specified in the Binary Images
section of the crash log to allow for complete program state to be matched
to that of the crash log, not just the images that were in the stack frames
(the default).

llvm-svn: 148605
2012-01-21 00:37:19 +00:00
Johnny Chen 5b201cf86c Add comment.
llvm-svn: 148602
2012-01-21 00:08:37 +00:00
Johnny Chen 384dd63189 A little bit of cleanup to make the code more understandable.
llvm-svn: 148600
2012-01-20 23:34:35 +00:00
Greg Clayton 9054bc18dc This file is no longer needed since the command:
(lldb) script import crashlog

will automatically add the "crashlog" command to the command interpreter!

llvm-svn: 148598
2012-01-20 23:12:25 +00:00
Greg Clayton 894f82fa49 <rdar://problem/10732738>
Release more stuff in Process::Destroy().

llvm-svn: 148597
2012-01-20 23:08:34 +00:00
Johnny Chen 98aceb08f8 o CommandObjectSettingsSet.cpp:
Fix a bug where "settings set -r th" wouldn't complete.

o UserSettingsController.cpp:

  Fix a bug where "settings set target.process." wouldn't complete.

o test/functionalities/completion:

  Add various completion test cases related to 'settings set' command.

llvm-svn: 148596
2012-01-20 23:02:51 +00:00
Sean Callanan 88685f2865 Fixed a global reference that should have been
a reference to a class variable.

llvm-svn: 148562
2012-01-20 19:27:48 +00:00
Greg Clayton 42a6eb7195 Make the script work again from the command line as long as the PYTHONPATH
environment variable it set to include a path to lldb.py.

Also fixed the case where the executable can't be located and doesn't match
what is installed on the current system. It will still symbolicate the other
frames, and will just show what was originally in the crash log file.

Also removed the --crash-log option so the arguments to the "crashlog"
command are one or more paths to crash logs.

Fixed the script to "auto-install" itself when loaded from the embedded
script interpreter. Now you only need to import the module and the
command is ready for use.

llvm-svn: 148561
2012-01-20 19:25:32 +00:00
Greg Clayton 3d8d3db34e More fixed to verify if a file in the crash log is installed in the current
system and also deal with dsymForUUID being available on the network, locally,
and not at all.

llvm-svn: 148534
2012-01-20 06:12:47 +00:00
Greg Clayton a32bfbeeda Improved the regular expressions to handle "+" characters being at the front
of the identifier name in the binary images section. Improved the regular
expression for the frames.

Added a new file "crashlog.lldb" which can be sourced with "command source"
that will import the module and set itself up to be used as a command.

llvm-svn: 148529
2012-01-20 03:32:35 +00:00
Greg Clayton aa9d02b17c Modified the symbolicate-crash.py so it can be imported into python as a
module (you can't import a module with a '-' in it) and also added a
Symbolcate(...) top level function so it can be imported and used as an
LLDB command.

Then you can import the module and map a "crashlog" command (for darwin
use only currently) to the python function "crashlog.Symbolicate":

(lldb) script import crashlog
(lldb) command script add -f crashlog.Symbolicate crashlog

Then use it to symbolicate:

(lldb) crashlog --crash-log /path/to/foo.crash

The crash log will then get symbolicated and inline frames will be added to
the crash log and the frames will be displayed. The crash log currently will
only try and fetch and setup the target images requires in order to do the
symbolication.

This will need to be iterated upon, but it is getting close to being useful
so I am going to check this in.

llvm-svn: 148528
2012-01-20 03:15:45 +00:00
Greg Clayton 415c72cbfb Add some usage documentation to the top of the source file.
llvm-svn: 148527
2012-01-20 02:10:52 +00:00
Greg Clayton 5d34322811 Added a new tool that can be loaded into a user space darwin application and allows you
to find data on the heap. To use this, make the project and then when stopped in your
lldb debug session:

(lldb) process load /path/to/libheap.dylib
(lldb) find_pointer_in_heap (0x112233000000)

This will grep everything in all active allocation blocks and print and malloc blocks that contain the pointer 0x112233000000.

This can also work for c strings:

(lldb) find_cstring_in_heap ("hello")

llvm-svn: 148523
2012-01-20 01:31:24 +00:00
Johnny Chen 6561d15dcb Add comment describing the interaction of WantsRawCommandString()/WantsCompletion() with the completion mechanism.
llvm-svn: 148521
2012-01-20 00:59:19 +00:00
Sean Callanan 0caa21cb25 Made IsArrayOfScalarType handle typedefs correctly.
We should ultimately introduce GetAs...Type
functions in all cases where we have Is...Type
functions that know how to look inside typedefs.

llvm-svn: 148512
2012-01-19 23:54:24 +00:00
Sean Callanan d8186490c1 Integrated a patch for the MCJIT that inhibits
a memory leak.

llvm-svn: 148507
2012-01-19 23:01:46 +00:00
Johnny Chen 6f99b63718 rdar://problem/10724187
http://llvm.org/viewvc/llvm-project?rev=148491&view=rev check in broke the argument completion
for "settings set th", followed by TAB.  Provide a way for commands who want raw commands to
hook into the completion mechanism.

llvm-svn: 148500
2012-01-19 22:16:06 +00:00
Jim Ingham 6657d09e8b ValueObjectRegister type value objects should obey the format in ValueAsCString.
<rdar://problem/10719481>

llvm-svn: 148494
2012-01-19 21:10:56 +00:00
Johnny Chen a28b89c700 rdar://problem/10712130
Fixed an issue where backtick char is not properly honored when setting the frame-format variable, like the following:

(lldb) settings set frame-format frame #${frame.index}: ${frame.pc}{ ${module.file.basename}{`${function.name-with-args}${function.pc-offset}}}{ at ${line.file.basename}:${line.number}}\n
(lldb) settings show frame-format
frame-format (string) = "frame #${frame.index}: ${frame.pc}{ `${module.file.basename}{${function.name-with-args}${function.pc-offset}}}{` at ${line.file.basename}:${line.number}}\n"
(lldb)

o CommandObjectSettings.h/.cpp:

  Modify the command object impl to require raw command string instead of parsed command string,
  which also fixes an outstanding issue that customizing the prompt with trailing spaces doesn't
  work.

o Args.cpp:

  During CommandInterpreter::HandleCommand(), there is a PreprocessCommand phase which already
  strips/processes pairs of backticks as an expression eval step.  There's no need to treat
  a backtick as starting a quote.

o TestAbbreviations.py and change_prompt.lldb:

  Fixed incorrect test case/logic.

o TestSettings.py:

  Remove expectedFailure decorator.

llvm-svn: 148491
2012-01-19 19:22:41 +00:00
Sean Callanan 2e93a2ad21 Fixed a problem where Objective-C classes that were
originally imported from symbols for the expression
parser didn't get their superclasses set properly.

llvm-svn: 148488
2012-01-19 18:23:06 +00:00
Greg Clayton bdf3a01bb0 Allow a way to track all allocations for our intrusive ref counted pointers.
It is disabled by default, but can be enabled to track down shared pointer 
cycles.

llvm-svn: 148461
2012-01-19 04:44:00 +00:00
Greg Clayton e42ae8497f Fixed an issue with the Instruction subclasses where the strings might
be fetched too many times and the DisassemblerLLVM was appending to strings
when the opcode, mnemonic and comment accessors were called multiple times
and if any of the strings were empty.

Also fixed the test suite failures from recent Objective C modifications.

llvm-svn: 148460
2012-01-19 03:24:53 +00:00
Sean Callanan a9bc065607 Fixed a problem where maintaining the ObjCInterfaceMap
for each ObjCInterfaceDecl was imposing performance
penalties for Objective-C apps.  Instead, we now use
the normal function query mechanisms, which use the
relevant accelerator tables.

This fix also includes some modifications to the
SymbolFile which allow us to find Objective-C methods
and report their Clang Decls correctly.

llvm-svn: 148457
2012-01-19 02:17:40 +00:00
Sean Callanan b811e4bb5d Fix to ensure that methods aren't called on NULL
objects.

llvm-svn: 148450
2012-01-19 01:10:27 +00:00
Greg Clayton 278a16bb7a Added an extra way to chop up an objective C prototype and use it where necessary.
llvm-svn: 148445
2012-01-19 00:52:59 +00:00
Greg Clayton 7c8104227e Be sure to use the one and only trusted source for chopping up
objective C class names when extracting the class name, selector and
name without category for objective C full class and instance method
names.

llvm-svn: 148435
2012-01-18 23:40:49 +00:00
Greg Clayton 5b6889b1f6 Fixed an issue in the debugger format strings that include "${function.name-with-args}"
where we grabbed the variable list size from the wrong list (we needed it
from "args" and we were getting it from "variable_list_sp").

llvm-svn: 148425
2012-01-18 21:56:18 +00:00
Johnny Chen 8715c517d5 Add comment regarding TestHelloWorld.py's use of a dictionary to specify/overwrite the EXE name.
llvm-svn: 148418
2012-01-18 21:22:38 +00:00
Johnny Chen fef3e2797a Modify the test cases so that each uses a unique executable name for the debugger to attach/launch.
I've see cases where there are lingering processes ("hello_world") staying around and the
test_with_dsym_and_attach_to_process_with_name_api() test case just hangs.

llvm-svn: 148417
2012-01-18 21:20:03 +00:00
Greg Clayton 68221ec3dc Fixed an issue where we might not find the one true ObjC definition. Now we do things
much smarter by extracting search results more efficiently and by properly obeying the 
must_be_implementation bool in the SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE()
function.

llvm-svn: 148413
2012-01-18 20:58:12 +00:00
Johnny Chen 41b780d704 Add a test case where 'settings set frame-format' supplies a format string containing, among other things, a single backtick character.
rdar://problem/10712130

llvm-svn: 148403
2012-01-18 19:07:08 +00:00
Jason Molenda 9351402fa4 Bump version number past lldb-107.
llvm-svn: 148380
2012-01-18 05:19:15 +00:00
Johnny Chen bc774c1156 Add a '-X excluded-dir' option to the test driver to exclude a directory from consideration during test discovery. For example:
./dotest.py -X types -v

from the test dir will ignore test cases under test/types.

llvm-svn: 148379
2012-01-18 05:15:00 +00:00
Jim Ingham 5c93906cbf Fix the test properly now that SBValue::GetValueAsUnsigned works for bitfields.
llvm-svn: 148280
2012-01-17 02:17:45 +00:00
Johnny Chen 2e275c9e6a Add usage example of specifying the full path to the compiler used while building the debuggees for running the test suite.
llvm-svn: 148273
2012-01-17 01:26:06 +00:00
Johnny Chen 64a7e741b0 Add usage example from test/functionalities/archives/Makefile.
llvm-svn: 148269
2012-01-17 00:58:08 +00:00
Greg Clayton d5e4edbfbf More improvements to not follow child processes and improved logging that always shows the process info.
llvm-svn: 148257
2012-01-16 22:21:29 +00:00
Greg Clayton 907018f0ad Bumped xcode project versions for lldb-106 and debugserver-165
llvm-svn: 148202
2012-01-14 20:57:34 +00:00
Greg Clayton 32720b51e2 <rdar://problem/9731573>
Fixed two double "int close(int fd)" issues found by our file descriptor
interposing library on darwin:

The first is in SBDebugger::SetInputFileHandle (FILE *file, bool transfer_ownership)
where we would give our FILE * to a lldb_private::File object member variable and tell
it that it owned the file descriptor if "transfer_ownership" was true, and then we
would also give it to the communication plug-in that waits for stdin to come in and
tell it that it owned the FILE *. They would both try and close the file.

The seconds was when we use a file descriptor through ConnectionFileDescriptor 
where someone else is creating a connection with ConnectionFileDescriptor and a URL
like: "fd://123". We were always taking ownwership of the fd 123, when we shouldn't
be. There is a TODO in the comments that says we should allow URL options to be passed
to be able to specify this later (something like: "fd://123?transer_ownership=1"), but
we can get to this later.

llvm-svn: 148201
2012-01-14 20:47:38 +00:00
Sean Callanan 36fa92af46 I forgot to import a header file change. This
should fix builds.

llvm-svn: 148199
2012-01-14 20:16:24 +00:00
Greg Clayton 662125ae93 Added some fixes for the fd interposing dylib:
- don't strip too many frames from the backtrace when logging close backtraces
- cleanup some logging messages

llvm-svn: 148195
2012-01-14 18:18:31 +00:00
Greg Clayton ccbc08e6ae <rdar://problem/10684141>
When the lldb_private::Debugger goes away, it should cleanup all
of its targets.

llvm-svn: 148189
2012-01-14 17:04:19 +00:00
Sean Callanan cbbe3ac4a9 I made two major improvements to the way the
master AST importer imports types.

- First, before importing the definition of a
  Decl from its source, notify the underlying
  importer of the source->destination mapping.
  Especially for anonymous strucutres that are
  otherwise hard to unique in the target AST
  context, this hint is very helpful.

- When deporting a type or Decl from one
  ASTContext to another (deporting occurs in
  the case of moving result types from the
  parser's AST context to the result AST
  context), don't forget their origin if the
  origin is the original debug information.

llvm-svn: 148152
2012-01-13 22:55:55 +00:00
Sean Callanan ba5be17e7d Only create new ASTImporters on demand, not
proactively.

llvm-svn: 148146
2012-01-13 22:19:53 +00:00
Sean Callanan 7282e2acf4 If the name of a struct or union is NULL in the
debug info, call it anonymous.  This isn't
perfect, because Clang actually considers the
following struct not to be anonymous:
–
struct {
  int x;
  int y;
} g_foo;
-
but DWARF doesn't make the distinction.

llvm-svn: 148145
2012-01-13 22:10:18 +00:00
Sean Callanan a6e61a7820 Fixed some logging in the AST source and added
more information.

llvm-svn: 148144
2012-01-13 22:05:55 +00:00
Greg Clayton 13d284b284 Updated HTML with info for ${function.name-with-args}
llvm-svn: 148111
2012-01-13 08:41:20 +00:00
Greg Clayton 6d3dbf5161 Added a new thread and frame format that can be used to display a function
name + arguments when the data is available. It seems to work really well, 
but some more testing is needed before we make this on by default.

The new function format name is:

 ${function.name-with-args}

To see how to use these formats see the website:

    http://lldb.llvm.org/formats.html

Here is a sample backtrace of debugging LLDB with LLDB using this new format
value:

(lldb) thread backtrace all
* thread #1: tid = 0x2203, 0x00007fff88a17bca libsystem_kernel.dylib __psynch_cvwait + 10, stop reason = signal SIGINT, name = <lldb.driver.main-thread>, queue = com.apple.main-thread
    frame #0: 0x00007fff88a17bca libsystem_kernel.dylib __psynch_cvwait + 10
    frame #1: 0x00007fff884ae274 libsystem_c.dylib _pthread_cond_wait + 840
    frame #2: 0x00000001010778ea LLDB lldb_private::Condition::Wait(this=0x0000000104846770, mutex=0x0000000104846730, abstime=0x0000000000000000, timed_out=0x00007fff5fbfdea7) + 138 at Condition.cpp:92
    frame #3: 0x0000000101244c21 LLDB lldb_private::Predicate<bool>::WaitForValueEqualTo(this=0x0000000104846728, value=true, abstime=0x0000000000000000, timed_out=0x00007fff5fbfdea7) + 209 at Predicate.h:317
    frame #4: 0x0000000100f6eeb2 LLDB lldb_private::Listener::WaitForEventsInternal(this=0x0000000104846660, timeout=0x0000000000000000, broadcaster=0x0000000000000000, broadcaster_names=0x0000000000000000, num_broadcaster_names=0x00000000, event_type_mask=0x00000000, event_sp=0x00007fff5fbfe030) + 386 at Listener.cpp:388
    frame #5: 0x0000000100f6f231 LLDB lldb_private::Listener::WaitForEvent(this=0x0000000104846660, timeout=0x0000000000000000, event_sp=0x00007fff5fbfe030) + 81 at Listener.cpp:436
    frame #6: 0x0000000100098dcd LLDB lldb::SBListener::WaitForEvent(this=0x00007fff5fbff0f0, timeout_secs=0xffffffff, event=0x00007fff5fbfe430) + 685 at SBListener.cpp:181
    frame #7: 0x000000010000628c lldb Driver::MainLoop(this=0x00007fff5fbff620) + 5244 at Driver.cpp:1325
    frame #8: 0x0000000100006ca3 lldb main(argc=1, argv=0x00007fff5fbff758, envp=0x00007fff5fbff768) + 419 at Driver.cpp:1460
    frame #9: 0x0000000100000d54 lldb start + 52

  thread #3: tid = 0x2703, 0x00007fff88a17df2 libsystem_kernel.dylib select$DARWIN_EXTSN + 10, name = <lldb.comm.debugger.input>
    frame #0: 0x00007fff88a17df2 libsystem_kernel.dylib select$DARWIN_EXTSN + 10
    frame #1: 0x0000000100f3f072 LLDB lldb_private::ConnectionFileDescriptor::BytesAvailable(this=0x000000010524d040, timeout_usec=0x004c4b40, error_ptr=0x0000000105640a18) + 722 at ConnectionFileDescriptor.cpp:542
    frame #2: 0x0000000100f3e6dd LLDB lldb_private::ConnectionFileDescriptor::Read(this=0x000000010524d040, dst=0x0000000105640a60, dst_len=1024, timeout_usec=0x004c4b40, status=0x0000000105640a14, error_ptr=0x0000000105640a18) + 301 at ConnectionFileDescriptor.cpp:273
    frame #3: 0x0000000100f3b8f7 LLDB lldb_private::Communication::ReadFromConnection(this=0x0000000104846270, dst=0x0000000105640a60, dst_len=1024, timeout_usec=0x004c4b40, status=0x0000000105640a14, error_ptr=0x0000000105640a18) + 167 at Communication.cpp:317
    frame #4: 0x0000000100f3b197 LLDB lldb_private::Communication::ReadThread(p=0x0000000104846270) + 327 at Communication.cpp:344
    frame #5: 0x0000000101078923 LLDB ThreadCreateTrampoline(arg=0x00000001045f6650) + 227 at Host.cpp:549
    frame #6: 0x00007fff884aa8bf libsystem_c.dylib _pthread_start + 335
    frame #7: 0x00007fff884adb75 libsystem_c.dylib thread_start + 13

  thread #4: tid = 0x2803, 0x00007fff88a17df2 libsystem_kernel.dylib select$DARWIN_EXTSN + 10, name = <lldb.comm.driver.editline>
    frame #0: 0x00007fff88a17df2 libsystem_kernel.dylib select$DARWIN_EXTSN + 10
    frame #1: 0x0000000100f3f072 LLDB lldb_private::ConnectionFileDescriptor::BytesAvailable(this=0x0000000105700370, timeout_usec=0x004c4b40, error_ptr=0x00000001056c3a18) + 722 at ConnectionFileDescriptor.cpp:542
    frame #2: 0x0000000100f3e6dd LLDB lldb_private::ConnectionFileDescriptor::Read(this=0x0000000105700370, dst=0x00000001056c3a60, dst_len=1024, timeout_usec=0x004c4b40, status=0x00000001056c3a14, error_ptr=0x00000001056c3a18) + 301 at ConnectionFileDescriptor.cpp:273
    frame #3: 0x0000000100f3b8f7 LLDB lldb_private::Communication::ReadFromConnection(this=0x0000000105700000, dst=0x00000001056c3a60, dst_len=1024, timeout_usec=0x004c4b40, status=0x00000001056c3a14, error_ptr=0x00000001056c3a18) + 167 at Communication.cpp:317
    frame #4: 0x0000000100f3b197 LLDB lldb_private::Communication::ReadThread(p=0x0000000105700000) + 327 at Communication.cpp:344
    frame #5: 0x0000000101078923 LLDB ThreadCreateTrampoline(arg=0x0000000105700430) + 227 at Host.cpp:549
    frame #6: 0x00007fff884aa8bf libsystem_c.dylib _pthread_start + 335
    frame #7: 0x00007fff884adb75 libsystem_c.dylib thread_start + 13

  thread #5: tid = 0x2903, 0x00007fff88a17df2 libsystem_kernel.dylib select$DARWIN_EXTSN + 10, name = <lldb.comm.driver.editline_output>
    frame #0: 0x00007fff88a17df2 libsystem_kernel.dylib select$DARWIN_EXTSN + 10
    frame #1: 0x0000000100f3f072 LLDB lldb_private::ConnectionFileDescriptor::BytesAvailable(this=0x00000001057178f0, timeout_usec=0x004c4b40, error_ptr=0x0000000105980a18) + 722 at ConnectionFileDescriptor.cpp:542
    frame #2: 0x0000000100f3e6dd LLDB lldb_private::ConnectionFileDescriptor::Read(this=0x00000001057178f0, dst=0x0000000105980a60, dst_len=1024, timeout_usec=0x004c4b40, status=0x0000000105980a14, error_ptr=0x0000000105980a18) + 301 at ConnectionFileDescriptor.cpp:273
    frame #3: 0x0000000100f3b8f7 LLDB lldb_private::Communication::ReadFromConnection(this=0x0000000105717580, dst=0x0000000105980a60, dst_len=1024, timeout_usec=0x004c4b40, status=0x0000000105980a14, error_ptr=0x0000000105980a18) + 167 at Communication.cpp:317
    frame #4: 0x0000000100f3b197 LLDB lldb_private::Communication::ReadThread(p=0x0000000105717580) + 327 at Communication.cpp:344
    frame #5: 0x0000000101078923 LLDB ThreadCreateTrampoline(arg=0x00000001057179b0) + 227 at Host.cpp:549
    frame #6: 0x00007fff884aa8bf libsystem_c.dylib _pthread_start + 335
    frame #7: 0x00007fff884adb75 libsystem_c.dylib thread_start + 13

  thread #6: tid = 0x2a03, 0x00007fff88a18af2 libsystem_kernel.dylib read + 10, name = <lldb.driver.commandline_io>
    frame #0: 0x00007fff88a18af2 libsystem_kernel.dylib read + 10
    frame #1: 0x0000000100050c3b libedit.3.dylib read_init + 247
    frame #2: 0x0000000100050e96 libedit.3.dylib el_wgetc + 155
    frame #3: 0x000000010005115d libedit.3.dylib el_wgets + 578
    frame #4: 0x000000010005debc libedit.3.dylib el_gets + 37
    frame #5: 0x000000010000d409 lldb IOChannel::LibeditGetInput(this=0x0000000105700490, new_line=0x0000000105a03db0) + 89 at IOChannel.cpp:311
    frame #6: 0x000000010000d8b6 lldb IOChannel::Run(this=0x0000000105700490) + 806 at IOChannel.cpp:391
    frame #7: 0x000000010000d57d lldb IOChannel::IOReadThread(ptr=0x0000000105700490) + 29 at IOChannel.cpp:345
    frame #8: 0x0000000101078923 LLDB ThreadCreateTrampoline(arg=0x00000001057179f0) + 227 at Host.cpp:549
    frame #9: 0x00007fff884aa8bf libsystem_c.dylib _pthread_start + 335
    frame #10: 0x00007fff884adb75 libsystem_c.dylib thread_start + 13
(lldb) 

llvm-svn: 148110
2012-01-13 08:39:16 +00:00
Greg Clayton ae3e9927a5 Bumped Xcode project version for lldb-105 and debugserver-164.
llvm-svn: 148098
2012-01-13 05:54:31 +00:00
Greg Clayton d66945ae3d <rdar://problem/10688864>
Fixed the new __apple_types to be able to accept a DW_TAG_structure_type
forward declaration and then find a DW_TAG_class_type definition, or vice
versa.

llvm-svn: 148097
2012-01-13 05:38:24 +00:00
Jim Ingham bc2f918200 Don't set breakpoints independently comp unit by comp unit, but look over all the file & line matches
and only pick the "best" ones.
<rdar://problem/10685990>

llvm-svn: 148087
2012-01-13 02:04:05 +00:00
Johnny Chen fb05d23789 Add some description for this test directory.
llvm-svn: 148075
2012-01-13 00:24:11 +00:00
Johnny Chen 7840c81df2 Modify a couple of Makefiles to use clang instead of gcc, since gcc is being deprecated.
llvm-svn: 148071
2012-01-12 23:50:28 +00:00
Johnny Chen fe14162e71 rdar://problem/10680957
Need a test case that tests DWARF with .o in .a files

test/functionalities/archives:

Produces libfoo.a from a.o and b.o.  Test breaking inside functions defined
inside the libfoo.a BSD Archive.

test/make/makefile.rules:

Some additional rules to sepcify archive building.  For example:

ARCHIVE_NAME := libfoo.a
ARCHIVE_C_SOURCES := a.c b.c

llvm-svn: 148066
2012-01-12 23:09:42 +00:00
Jim Ingham 18f4629c78 Discriminate between the lldb_private::Type's for ObjC Classes that come from debug info, and those that
are made up from the ObjC runtime symbols.  For now the latter contain nothing but the fact that the name
describes an ObjC class, and so are not useful for things like dynamic types.

llvm-svn: 148059
2012-01-12 22:45:31 +00:00
Jim Ingham 5cfbe4aa53 Fix a comment typo.
llvm-svn: 148057
2012-01-12 22:42:34 +00:00
Jim Ingham 50b3d507bd Let the Module FindType do the stripping of namespace components, that's not expensive
and doing it both at the ModuleList and Module levels means we look 4 times for a negative
search.  Also, don't do the search for the stripped name if that is the same as the original
one.

llvm-svn: 148054
2012-01-12 22:35:29 +00:00
Greg Clayton 4d4c988c6a Bumped Xcode project versions for lldb-104 and debugserver-163.
llvm-svn: 148018
2012-01-12 05:29:50 +00:00
Greg Clayton 44435ed07a Big change in the way ObjectFile file contents are managed. We now
mmap() the entire object file contents into memory with MAP_PRIVATE.
We do this because object file contents can change on us and currently
this helps alleviate this situation. It also make the code for accessing
object file data much easier to manage and we don't end up opening the
file, reading some data and closing the file over and over.

llvm-svn: 148017
2012-01-12 05:25:17 +00:00
Greg Clayton c7f03b6155 <rdar://problem/10681814>
Fix DWARF parsing issue we can run into when using llvm-gcc based dSYM files.

Also fix the parsing of objective C built-in types (Class, id and SEL) so
they don't parse more information that is not needed due to the way they
are represented in DWARF.

llvm-svn: 148016
2012-01-12 04:33:28 +00:00
Jim Ingham c07fe69850 Don't dereference the oso_dwarf without checking for NULL.
llvm-svn: 148005
2012-01-12 01:45:53 +00:00
Greg Clayton fa8c004aba Revert some changes I did for logging that affected the ability to
load .o files in BSD archive parsing.

llvm-svn: 147987
2012-01-12 01:21:31 +00:00
Johnny Chen 5886fb5bd3 rdar://problem/10492827
SBProcess.GetSTDERR() not getting stderr of the launched process

Since we are launch the inferior with:

    process = target.LaunchSimple(None, None, os.getcwd())

i.e., without specifying stdin/out/err.  A pseudo terminal is used for
handling the process I/O, and we are satisfied once the expected output
appears in process.GetSTDOUT().

llvm-svn: 147983
2012-01-12 00:29:46 +00:00
Sean Callanan ee458a7785 After thinking about it, it doesn't seem right
to make assumptions if the type is unsized.  We
just give up (and let the JIT handle it) instead.

llvm-svn: 147915
2012-01-11 02:23:25 +00:00
Jim Ingham c354928786 Don't assert but report & return a NULL type if we end up parsing a type we are in the middle of parsing.
llvm-svn: 147914
2012-01-11 02:21:12 +00:00
Johnny Chen 4876b5fccd Add more usage examples.
llvm-svn: 147909
2012-01-11 01:59:55 +00:00
Greg Clayton 8b35334e0c Fixed a missing space when reporting errors and warning through the module
and also print out the full path and architecture.

llvm-svn: 147908
2012-01-11 01:59:18 +00:00
Johnny Chen e9f97704ea Add usage examples of recently added functionality.
llvm-svn: 147907
2012-01-11 01:42:58 +00:00
Sean Callanan 285e4b22f5 If the size of a type can't be determined, default
to assume it's of pointer size.

llvm-svn: 147906
2012-01-11 01:36:21 +00:00
Johnny Chen 17b4ea54bf Snapshot of initial work for ARM watchpoint support on the debugserver.
It is incomplete and untested; passes the compilation only.

llvm-svn: 147901
2012-01-11 00:35:13 +00:00
Johnny Chen c260232dfa Add comment for build_and_run_with_source_atoms_expr() and remove redundant #include from basic_type.cpp.
llvm-svn: 147895
2012-01-10 23:36:06 +00:00
Johnny Chen 0d81fe7a77 Add documentation for the generic functions build_and_run() and build_and_run_expr() called from
the Test*Types*.py test cases.

llvm-svn: 147893
2012-01-10 23:22:57 +00:00
Greg Clayton 8ffc4f11ce Disable ARMDisassembler.framework support which was used for software single stepping.
llvm-svn: 147886
2012-01-10 22:33:56 +00:00
Jim Ingham 82283e8e91 Check the return value of GetBasicInfo before dereferencing it. <rdar://problem/10568492>
llvm-svn: 147883
2012-01-10 22:21:42 +00:00
Sean Callanan 30ce74f9b4 Updating Xcode project version numbers for lldb-103 and debugserver-162
llvm-svn: 147865
2012-01-10 18:37:32 +00:00
Jim Ingham f714d3d7f2 As we are grubbing through memory chasing down the hierarchy of an ObjC object, protect against the possibility that that object might be just random memory with loops.
llvm-svn: 147838
2012-01-10 03:58:23 +00:00
Greg Clayton 7d7850af64 Since clang modifies .o files in place, use MAP_PRIVATE as it seems
to fix the issues we run into on darwin even though the docs don't
seems to say it will.

llvm-svn: 147835
2012-01-10 02:53:13 +00:00
Greg Clayton 99e6e2f6f0 Fix for linux build.
llvm-svn: 147834
2012-01-10 02:52:21 +00:00
Jim Ingham aa1bc80f5d Don't call lldb_private::Process::GetLoadAddressPermissions to sanity check the unwind addresses
when you already know that the address is contained in a bona fide function.  This can be a 
slow call.

llvm-svn: 147829
2012-01-10 02:14:47 +00:00