Commit Graph

1952 Commits

Author SHA1 Message Date
Enrico Granata 7934a878a0 More useful printout of arguments after the recent changes to support LLDB_TEST_ARGUMENTS
llvm-svn: 185246
2013-06-29 01:53:55 +00:00
Enrico Granata b4675a4e12 <rdar://problem/14266411>
The semi-unofficial way of returning a status from a Python command was to return a string (e.g. return "no such variable was found") that LLDB would pick as a clue of an error having happened

This checkin changes that:
- SBCommandReturnObject now exports a SetError() call, which can take an SBError or a plain C-string
- script commands now drop any return value and expect the SBCommandReturnObject ("return object") to be filled in appropriately - if you do nothing, a success will be assumed

If your commands were relying on returning a value and having LLDB pick that up as an error, please change your commands to SetError() through the return object or expect changes in behavior

llvm-svn: 184893
2013-06-25 23:43:28 +00:00
Daniel Malea 795cc3afc3 Fix undefined behaviour in data formatter test -- ensure char* null-terminated
so LLDB does not read off the end of the array.

llvm-svn: 184877
2013-06-25 20:54:24 +00:00
Ed Maste 3d3295daab Skip dsym tests also on FreeBSD
llvm-svn: 184874
2013-06-25 19:59:56 +00:00
Ed Maste 09617a5d03 Skip tests that hang on FreeBSD
There's still significant work to do in the FreeBSD port, so no point
in a pr for these yet.

llvm-svn: 184871
2013-06-25 19:11:36 +00:00
Ed Maste 81ca910af7 Tests require GNU make, called gmake on FreeBSD
llvm-svn: 184748
2013-06-24 15:40:27 +00:00
Enrico Granata 091dd7be12 Test suite support for setting arguments through the environment
Set your env variable LLDB_TEST_ARGUMENTS to one or more options to be passed to the lldb test suite and those will be picked automatically

No more fighting about whether the progress bar is good or bad :-)

llvm-svn: 184615
2013-06-22 00:15:25 +00:00
Enrico Granata 57a8ca3a06 make command history test case run silently regardless of import status of module foo
llvm-svn: 184613
2013-06-22 00:01:21 +00:00
Enrico Granata c20eed4280 Lots of cleanup on the SWIG wrapping layer
Now, the way SWIG wrappers call into Python is through a utility PyCallable object, which overloads operator () to look like a normal function call
Plus, using the SBTypeToSWIGWrapper() family of functions, we can call python functions transparently as if they were plain C functions
Using this new technique should make adding new Python call points easier and quicker

The PyCallable is a generally useful facility, and we might want to consider moving it to a separate layer where other parts of LLDB can use it

llvm-svn: 184608
2013-06-21 23:27:16 +00:00
Sean Callanan a4e8105bfd Fixed a problem with materialization and
dematerialization of registers that caused
conditional breakpoint expressions not to
work properly.  Also added a testcase.

<rdar://problem/14129252>

llvm-svn: 184451
2013-06-20 18:42:16 +00:00
Enrico Granata 6d2cfb80ba Huge speedup for testsuite categories
This ensures that we won't try to do cleanups of test cases that we are skipping
e.g. this brings down the time required to run the cmdline category on my machine from ~70s to ~30s

llvm-svn: 184363
2013-06-19 21:48:09 +00:00
Enrico Granata 9ac21aef9b <rdar://problem/14086503>
Hardening the libstdc++ std::map test case against line table changes

llvm-svn: 184265
2013-06-19 00:20:57 +00:00
Enrico Granata d223563a59 <rdar://problem/14086503>
Hardening the libstdc++ std::vector test case against line table changes

llvm-svn: 184264
2013-06-19 00:14:02 +00:00
Enrico Granata a2e7f9ab2b <rdar://problem/14194128>
ClangASTContext was failing to retrieve fields and base class info for ObjC variables
This checkin fixes that and adds a test case

llvm-svn: 184248
2013-06-18 22:40:36 +00:00
Enrico Granata a62e38c898 Adding a "cmdline" category to the test suite
llvm-svn: 184155
2013-06-18 00:22:27 +00:00
Enrico Granata 63123b6484 Renaming the "--wipe" option to "command history" to "--clear" (-C) for coherence with the rest of the LLDB command-line interface
llvm-svn: 184147
2013-06-17 23:28:27 +00:00
Enrico Granata 7594f14f7d <rdar://problem/14134716>
This is a rewrite of the command history facility of LLDB

It takes the history management out of the CommandInterpreter into its own CommandHistory class
It reimplements the command history command to allow more combinations of options to work correctly (e.g. com hist -c 1 -s 5)
It adds a new --wipe (-w) option to command history to allow clearing the history on demand
It extends the lldbtest runCmd: and expect: methods to allow adding commands to history if need be
It adds a test case for the reimplemented facility

llvm-svn: 184140
2013-06-17 22:51:50 +00:00
Matt Kopec 2ee99f4922 Fix breakpoint test to account for full path of source file location.
llvm-svn: 184126
2013-06-17 21:27:50 +00:00
Matt Kopec 36e5a7db2a Fix single whitespace before breakpoint filename in some tests due to r183932.
llvm-svn: 184104
2013-06-17 19:00:31 +00:00
Greg Clayton 1767a73bc8 Added a new makefile setting that can be set in LLDB makefiles: USE_LIBCPP. This will enable libc++ support.
Improved the makefile "clean" to include deleting all ".d.[0-9]+" files.

Added options to the "lldb/examples/lookup" example and made it build using the LLDB_BUILD_DIR. If this is not set, it will default to "/Applications/Xcode.app/Contents/SharedFrameworks" on Darwin.

Added options to the "lldb/examples/function" example and made it build using the LLDB_BUILD_DIR.

llvm-svn: 183949
2013-06-13 21:27:14 +00:00
Daniel Malea 31ebbed47a If using clang 3.4, skip tests affected by llvm.org/pr16214
- clang emits incomplete DWARF information for structures referenced via typedef

llvm-svn: 183846
2013-06-12 16:48:33 +00:00
Daniel Malea c087a6bd54 Update TestRegisters for running on Linux (filed llvm.org/pr16301)
- skip the attach cases in TestRegisters.py -- caused slowness/sigabrt
- fixed log file removal function (in case test is run with -# flag)

llvm-svn: 183812
2013-06-12 00:13:43 +00:00
Greg Clayton bc8fc0f5e0 Use llvm::APFloat for formatting if a target is available. Each target when debugging has a "ASTContext" that helps us to use the correct floating point semantics. Now that APFloat supports toString we now use that. If we don't have a target, we still fall back on the old display methodology, but the important formatting should always have a target available and thus use the compiler floating point code.
Modified the test programs to use floating point constants that always will display correctly. We had some numbers that were being rounded, and now that we are using clang, we no longer round them and we get more correct results.

llvm-svn: 183792
2013-06-11 21:56:55 +00:00
Enrico Granata 7bd2bbb9ac <rdar://problem/13779789>
Allow memory read -t to take persistent types (those defined with expression struct $....)

llvm-svn: 183766
2013-06-11 18:47:55 +00:00
Andrew Kaylor 69cb7d40fd Updating convenience register attach test
llvm-svn: 183580
2013-06-07 22:16:14 +00:00
Andrew Kaylor 5c282cc886 Don't set stdin to devnull for forked processes
llvm-svn: 183578
2013-06-07 22:12:54 +00:00
Ashok Thirumurthi ec000b6714 Revert r183281, adds a comment about how to reproduce the hang.
llvm-svn: 183569
2013-06-07 20:58:47 +00:00
Enrico Granata a1acb49188 Tweaking Daniel Malea's fixes to Makefile.rules to ensure that we correctly pass -stdlib=libstdc++ to clang when compiling as well as when linking
Not doing this was causing link errors as clang was looking for libc++ symbols while linking against libstdc++

llvm-svn: 183482
2013-06-07 01:58:52 +00:00
Enrico Granata 1a8aa4c04e Tweaks to the std::list (libstdc++ test case)
llvm-svn: 183480
2013-06-07 01:53:59 +00:00
Ashok Thirumurthi e244ceec2e Adding a test case for pr15415 - partial backtrace with -fomit-frame-pointer
that is patterned after its parent TestInferiorCrashing.py.

- The xfail decorator limits the xfail to tool-chains that support this compiler option.
- Included a TODO concerning the platform-specific behavior when 'next' is issued after a crash.
- Toggling -fomit-frame-pointer results in an xpass as mentioned in pr15415.

Thanks to Daniel for the review, and Samuel for the bug report and reproducer.

llvm-svn: 183434
2013-06-06 19:22:05 +00:00
Ashok Thirumurthi 3b03728227 Reworked the routine that qualifies the tool-chain for expected failures to handle sub-strings.
- For instance, allows 'gcc' to match x86-64-linux-gnu-gcc as required on some Debian builds.
- Also adds doc-strings and a more consistent naming convention for related helpers.

llvm-svn: 183415
2013-06-06 14:23:31 +00:00
Enrico Granata ed4b293b68 <rdar://problem/14064994>
Fixing a test case to correctly check that the class name has changed instead of relying on GetValueDidChange()

llvm-svn: 183364
2013-06-06 00:58:37 +00:00
Sean Callanan 415422ce76 Fixes for the IR interpreter:
- Implemented the SExt instruction, and

 - eliminated redundant codepaths for constant
   handling.

Added test cases.

<rdar://problem/13244258>
<rdar://problem/13955820>

llvm-svn: 183344
2013-06-05 22:07:06 +00:00
Daniel Malea 692074622c Add test cases for attaching to a process after fork
- one test case is due to llvm.org/pr16229
- other test case uses a Linux workaround for above by using os.fork() instead of subprocess module

Patch by Andy Kaylor!

llvm-svn: 183340
2013-06-05 21:07:02 +00:00
Daniel Malea c7ffa7a958 Fix Makefiles in the data-formatter-stl tests
- specify compiler flag -stdlib=libstdc++ only if using clang (not supported in gcc)

llvm-svn: 183333
2013-06-05 19:32:34 +00:00
Enrico Granata b26fdada54 <rdar://problem/13125225>
Adding data formatters for std::set, std::multiset and std::multimap for libc++
The underlying data structure is the same as std::map, so this change is very minimal and mostly consists of test cases

llvm-svn: 183323
2013-06-05 17:47:23 +00:00
Matt Kopec 17b1624dda Skip intermittent watchpoint test failure when testing on Linux/gcc.
llvm-svn: 183316
2013-06-05 15:36:33 +00:00
Andrew Kaylor 912a710a8a Re-enabling a test that is no longer failing
llvm-svn: 183281
2013-06-04 23:38:51 +00:00
Enrico Granata daa0ac48e6 <rdar://problem/12582328>
If you want to define a formatter for "array of Foo of any size", ordinarily you would say

-x "Foo \[[0-9]+\]"

this checkin allows you to instead say "Foo[]" (or "Foo []") and LLDB will automatically create the regular expression and add the -x flag on your behalf

llvm-svn: 183272
2013-06-04 22:25:36 +00:00
Daniel Malea 1d1592624c Un-skipping test that was disabled due to llvm.org/pr16191
- adding workaround recommended by Greg (-fno-limit-debug-info clang flag)
- filed bug llvm.org/pr16214 against Clang

llvm-svn: 183156
2013-06-03 21:42:50 +00:00
Matt Kopec 6f961239ae Fix setting of watchpoints on inferior thread creation for Linux.
llvm-svn: 183139
2013-06-03 17:40:20 +00:00
Daniel Malea fac51ab5e2 Skipping test case for clang 3.4 due to llvm.org/pr16191
- should resolve remaining buildbot issues with debian/clang builder

llvm-svn: 183044
2013-05-31 21:05:23 +00:00
Enrico Granata b294fd2037 <rdar://problem/14035604>
Fixing an issue where formats would not propagate from parents to children in all cases
Details follow:
an SBValue has children and those are fetched along with their values
Now, one calls SBValue::SetFormat() on the parent
Technically, the format choices should propagate onto the children (see ValueObject::GetFormat())
But if the children values are already fetched, they won't notice the format change and won't update themselves
This commit fixes that by making ValueObject::GetValueAsCString() check if any format change intervened from the previous call to the current one
A test case is also added

llvm-svn: 183030
2013-05-31 19:18:19 +00:00
Sean Callanan 7d01ddd6f8 Fixed value evaluation to handle null constants.
<rdar://problem/14005311>

llvm-svn: 183022
2013-05-31 17:29:03 +00:00
Enrico Granata e0c70f1b2c <rdar://problem/11109316>
command script import now does reloads - for real
If you invoke command script import foo and it detects that foo has already been imported, it will
 - invoke reload(foo) to reload the module in Python
 - re-invoke foo.__lldb_init_module
 This second step is necessary to ensure that LLDB does not keep cached copies of any formatter, command, ... that the module is providing

Usual caveats with Python imports persist. Among these:
 - if you have objects lurking around, reloading the module won't magically update them to reflect changes
 - if module A imports module B, reloading A won't reload B
These are Python-specific issues independent of LLDB that would require more extensive design work

The --allow-reload (-r) option is maintained for compatibility with existing scripts, but is clearly documented as redundant - reloading is always enabled whether you use it or not

llvm-svn: 182977
2013-05-31 01:03:09 +00:00
Daniel Malea 960d738510 Find 'ps' command using which() rather than invoking directly
- should address Debian test errors due to not being able to 'ps' directly

llvm-svn: 182965
2013-05-30 21:48:58 +00:00
Daniel Malea 4a01e59354 Improve TestExitDuringStep to verify thread behaviour during step-over, step-in in addition to step-inst
Patch by Brian Minard!

llvm-svn: 182961
2013-05-30 21:14:31 +00:00
Matt Kopec ef7ea33178 Disabling another watchpoint test with intermittent failure.
llvm-svn: 182952
2013-05-30 18:54:48 +00:00
Matt Kopec 03da5167cd Remove extraneous files from test directory.
llvm-svn: 182943
2013-05-30 17:59:36 +00:00
Andrew Kaylor baa14e852b Fixing problems with thread create during step test.
llvm-svn: 182888
2013-05-29 22:40:17 +00:00