Commit Graph

3128 Commits

Author SHA1 Message Date
Enrico Granata 68eb4bb421 Added an error message when the user tries to add a filter when a synthetic provider for the same type is already defined in the same category
The converse is also true: an error is shown when the user tries to add a synthetic provider to a category that already has a filter for the same type

llvm-svn: 137493
2011-08-12 19:14:27 +00:00
Johnny Chen 70cb84a0f6 When running dotest.py under pdb (the python debugger), define DOTEST_PDB=YES and
DOTEST_SCRIPT_DIR=/path/leading/to/your/dotest/script/directory.

llvm-svn: 137492
2011-08-12 18:54:11 +00:00
Enrico Granata 4a04dbc749 Taking care of an issue relating to mapping DeclContext's to DIE's
llvm-svn: 137490
2011-08-12 18:43:16 +00:00
Johnny Chen 7feabf0643 Fix a logic error (Division by zero) uncovered by the static analyzer.
A8.6.391 VST1 (multiple single elements)
alignment = if align == '00' then 1 else 4 << UInt(align);

llvm-svn: 137477
2011-08-12 17:59:58 +00:00
Greg Clayton dd7feaf664 Fixed the issue of a DW_TAG_subprogram in a DW_TAG_subprogram correctly this
time after recently backing out another fix.

llvm-svn: 137475
2011-08-12 17:54:33 +00:00
Enrico Granata 61a80ba6c3 Giving a warning to the user the first time children are truncated by the new cap setting
llvm-svn: 137462
2011-08-12 16:42:31 +00:00
Greg Clayton b4d3733fca Backout previous fix that was designed to allow functions within functions
as this function is what parses the blocks for a function...

llvm-svn: 137461
2011-08-12 16:22:48 +00:00
Greg Clayton 3771927056 Fixed an assertion issue that can arise when a function
is contained inside a function.

llvm-svn: 137438
2011-08-12 07:35:23 +00:00
Greg Clayton 5113dc8e54 Fixed some issues with parsing C++ methods where our detection
was failing if the DWARF was laid out in a certain way. The way
we detect C++ classes is now more robust so that a class method
can be defined outside of the class and refer to a definition inside
the class with a DW_AT_specification or DW_AT_abstract_origin attribute.

Fixed a case in Thread.cpp where we were looking up info in the frame
when we didn't need to. This was from some changes to support external
editors. Now the info is only looked up if needed.

llvm-svn: 137436
2011-08-12 06:47:54 +00:00
Jason Molenda 7efc7e949c Fixes the occasional crash on exit when quitting lldb with control-D.
If the IOChannel has already freed out its m_driver member, and
there's still a character to be read/written (that is, the ^D
character), just skip that char instead of trying to write through
a null object pointer.

llvm-svn: 137421
2011-08-12 02:40:17 +00:00
Enrico Granata 22c55d180d *Some more optimizations in usage of ConstString
*New setting target.max-children-count gives an upper-bound to the number of child objects that will be displayed at each depth-level
  This might be a breaking change in some scenarios. To override the new limit you can use the --show-all-children (-A) option
  to frame variable or increase the limit in your lldbinit file
*Command "type synthetic" has been split in two:
  - "type synthetic" now only handles Python synthetic children providers
  - the new command "type filter" handles filters
  Because filters and synthetic providers are both ways to replace the children of a ValueObject, only one can be effective at any given time.

llvm-svn: 137416
2011-08-12 02:00:06 +00:00
Johnny Chen ff7f3cd277 Fix a logic error caught by the static analyzer.
llvm-svn: 137407
2011-08-12 01:22:56 +00:00
Johnny Chen 160ee8b43d Fix some warnings from static analyzer.
The initialization of 'replicated_element' to 0 is needed, otherwise we get a garbage value to start with.

llvm-svn: 137405
2011-08-12 01:10:45 +00:00
Johnny Chen 1cee80c081 Silence the static analyzer.
llvm-svn: 137396
2011-08-12 00:21:20 +00:00
Johnny Chen d397dc80eb Fix two 'dereference of a null pointer' detected by the static analyzer.
llvm-svn: 137394
2011-08-12 00:02:24 +00:00
Sean Callanan 912855fd27 Fixed LLDB's handling of ElaboratedTypes, which was
causing problems with printing the values of persistent
variables with struct types.

llvm-svn: 137392
2011-08-11 23:56:13 +00:00
Johnny Chen ec34c6aba5 Silence the static analyzer.
llvm-svn: 137387
2011-08-11 23:47:21 +00:00
Johnny Chen ec95565a9d Fix 'Undefined or garbage value returned to caller' (static analyzer).
llvm-svn: 137374
2011-08-11 22:23:44 +00:00
Johnny Chen 0861be0c30 Silence the static analyzer.
llvm-svn: 137360
2011-08-11 21:43:13 +00:00
Enrico Granata 5c7b8e682c changed some variables from char* to std::string
llvm-svn: 137357
2011-08-11 21:37:21 +00:00
Johnny Chen cbbd9bea53 To silence the static analyzer.
llvm-svn: 137355
2011-08-11 21:24:08 +00:00
Johnny Chen d5e00ba6c4 Fix the expect patterns to work for both OSX SnowLeopard and Lion.
On Lion, printf is defined in libsystem_c.dylib.

llvm-svn: 137348
2011-08-11 20:51:45 +00:00
Johnny Chen d08a834a68 Patch by Matt Johnson to build on his Linux machine with recent versions of libstdc++ and glibc!
llvm-svn: 137343
2011-08-11 20:40:21 +00:00
Sean Callanan 793d6330cd Updated LLVM/Clang to to pick up fixes for a
problem in which the following cast:
–
expr (int (*)(const char*, ...))printf
-
caused a crash.  This had several causes:

  - First, Clang did not support implicit
    casts of a function of unknown type to
    a function pointer.

  - Second, after this was fixed, the
    Clang AST importer did not support
    importing function pointer types
    produced by resolving these casts.

These two problems are now resolved, and
I have added a test case to verify that
they work.  I also did a little bit of
build-system cleanup because we now use
libEnhancedDisassembly.a instead of the
.dylib.

llvm-svn: 137338
2011-08-11 20:11:18 +00:00
Johnny Chen 3e99bc3a07 Fix a logic error caught by the static analyzer.
llvm-svn: 137334
2011-08-11 19:40:36 +00:00
Enrico Granata a365f296e6 Fixed an issue where LLDB was complaining about the lack of 'update' in a synthetic provider, despite it being optional
llvm-svn: 137330
2011-08-11 19:20:44 +00:00
Johnny Chen 0a76c28a87 To silence the static analyzer.
llvm-svn: 137329
2011-08-11 19:17:45 +00:00
Johnny Chen 8446277c11 Fix a logic error caught by the static analyzer.
llvm-svn: 137328
2011-08-11 19:12:10 +00:00
Johnny Chen 64503c8168 To silence the static analyzer.
llvm-svn: 137326
2011-08-11 19:03:44 +00:00
Johnny Chen d14651afaf To silence the static analyzer.
llvm-svn: 137319
2011-08-11 18:21:06 +00:00
Enrico Granata 8c9d35603e Fixed an issue where a pointer's address was being logged instead of its value
Access to synthetic children by name:
 if your object has a synthetic child named foo you can now type
  frame variable object.foo (or ->foo if you have a pointer)
  and that will print the value of the synthetic child
  (if your object has an actual child named foo, the actual child prevails!)
 this behavior should also work in summaries, and you should be able to use
 ${var.foo} and ${svar.foo} interchangeably
  (but using svar.foo will mask an actual child named foo)

llvm-svn: 137314
2011-08-11 17:08:01 +00:00
Greg Clayton aa51684318 Patch for "process load" by Filipe Cabecinhas.
Filipe was attempting to do a:

(lldb) process load ~/path/foo.dylib

But the process load command wasn't resolving the path. We have to be careful
about resolving the path here because we want to do it in terms of the platform
we are using. the "~/" can mean a completely different path if you are remotely
debugging on another machine as another user. So to support this, platforms now
can resolve remote paths:

bool
Platform::ResolveRemotePath (const FileSpec &platform_path,
                             FileSpec &resolved_platform_path);

The host/local platform will just resolve the path.
                             

llvm-svn: 137307
2011-08-11 16:25:18 +00:00
Greg Clayton 0c02e4eaea Fix the broken build that happened with my last checkin.
llvm-svn: 137300
2011-08-11 04:30:39 +00:00
Greg Clayton aa149cbd86 Added the ability to remove orphaned module shared pointers from a ModuleList.
This is helping us track down some extra references to ModuleSP objects that
are causing things to get kept around for too long. 

Added a module pointer accessor to target and change a lot of code to use 
it where it would be more efficient.

"taret delete" can now specify "--clean=1" which will cleanup the global module
list for any orphaned module in the shared module cache which can save memory
and also help track down module reference leaks like we have now.

llvm-svn: 137294
2011-08-11 02:48:45 +00:00
Johnny Chen e1894cf97c Add logic to SBValue.linked_list_iter() to detect infinite loop and to bail out early.
Add code to test case to create an evil linked list with:

    task_evil -> task_2 -> task_3 -> task_evil ...

and to check that the linked list iterator only iterates 3 times.

llvm-svn: 137291
2011-08-11 01:19:46 +00:00
Johnny Chen 9c1b703ac4 Change the SBValue.linked_list_iter() to treat the value object as a homogeneous linked list data structure
where an empty linked list is represented as a value object with a NULL value, instead of a special value
object which 'points' to NULL.

Also modifies the test case to comply.

rdar://problem/9933692

llvm-svn: 137289
2011-08-11 00:49:03 +00:00
Johnny Chen 3c24a17c7c Incremental fixes of issues found by Xcode static analyzer.
llvm-svn: 137288
2011-08-11 00:43:20 +00:00
Jim Ingham 478235d882 In the case where we are trying to resume a thread all the way to 0, if we get
llvm-svn: 137287
2011-08-11 00:38:52 +00:00
Johnny Chen 8082a00dcb When a benchmarks test fails, the re-run command should include the '+b' option instead of the '-t' option.
llvm-svn: 137285
2011-08-11 00:16:28 +00:00
Johnny Chen 119fd6c03b Ignore the static analyzer, instead; and add comment why.
llvm-svn: 137275
2011-08-10 23:19:32 +00:00
Johnny Chen 2fe7dd445b Incremental fixes of issues found by Xcode static analyzer.
llvm-svn: 137267
2011-08-10 23:01:39 +00:00
Johnny Chen 25f3a3cde2 Incremental fixes of issues found by Xcode static analyzer.
llvm-svn: 137257
2011-08-10 22:06:24 +00:00
Greg Clayton 8b45bee0e4 Include the qLaunchSuccess and qC packets in the
10 second timeout zone. When launching we increase the
timeout to 10 seconds to ensure we have time to launch a
process, and then set it back.

llvm-svn: 137256
2011-08-10 22:05:39 +00:00
Sean Callanan 5207a340e5 Fixed a problem that prevented access to members
of string literals ("hello"[2]).  Also fixed a
problem in which empty string literals were not
being compiled correctly ((int)printf("") would
print garbage).

Added a testcase that covers both.

llvm-svn: 137247
2011-08-10 21:05:52 +00:00
Johnny Chen 9e916e8096 Check log shared pointer before using it.
llvm-svn: 137228
2011-08-10 17:58:11 +00:00
Enrico Granata 6680421015 renaming command "type synth" to "type synthetic" for added readability
llvm-svn: 137213
2011-08-10 15:29:15 +00:00
Jason Molenda a985d411bc Remove extra newline from end of 'frame info' command output.
llvm-svn: 137208
2011-08-10 10:51:24 +00:00
Greg Clayton 3418c85771 While tracking down memory consumption issue a few things were needed: the
ability to dump more information about modules in "target modules list". We
can now dump the shared pointer reference count for modules, the pointer to
the module itself (in case performance tools can help track down who has
references to said pointer), and the modification time.

Added "target delete [target-idx ...]" to be able to delete targets when they
are no longer needed. This will help track down memory usage issues and help 
to resolve when module ref counts keep getting incremented. If the command gets
no arguments, the currently selected target will be deleted. If any arguments 
are given, they must all be valid target indexes (use the "target list" 
command to get the current target indexes).

Took care of a bunch of "no newline at end of file" warnings.

TimeValue objects can now dump their time to a lldb_private::Stream object.

Modified the "target modules list --global" command to not error out if there
are no targets since it doesn't require a target.

Fixed an issue in the MacOSX DYLD dynamic loader plug-in where if a shared 
library was updated on disk, we would keep using the older one, even if it was
updated.

Don't allow the ModuleList::GetSharedModule(...) to return an empty module.
Previously we could specify a valid path on disc to a module, and specify an
architecture that wasn't contained in that module and get a shared pointer to
a module that wouldn't be able to return an object file or a symbol file. We
now make sure an object file can be extracted prior to adding the shared pointer
to the module to get added to the shared list.

llvm-svn: 137196
2011-08-10 02:10:13 +00:00
Enrico Granata ce68b02c99 CFString.py now shows contents in a more NSString-like way (e.g. you get @"Hello" instead of "Hello")
new --raw-output (-R) option to frame variable prevents using summaries and synthetic children
 other future formatting enhancements will be excluded by using the -R option
 test case enhanced to check that -R works correctly

llvm-svn: 137185
2011-08-09 23:50:01 +00:00
Johnny Chen d62fe94b45 Fix indentation for a log statement.
llvm-svn: 137178
2011-08-09 23:26:20 +00:00