Skip to content
  1. Sep 15, 2010
  2. Sep 14, 2010
    • Sean Callanan's avatar
      Added code to support use of "this" and "self" in · 44096b1a
      Sean Callanan authored
      expressions.  This involved three main changes:
      
       - In ClangUserExpression::ClangUserExpression(),
         we now insert the following lines into the
         expression:
           #define this ___clang_this
           #define self ___clang_self
      
       - In ClangExpressionDeclMap::GetDecls(), we
         special-case ___clang_(this|self) and instead
         look up "this" or "self"
      
       - In ClangASTSource, we introduce the capability
         to generate Decls with a different, overridden,
         name from the one that was requested, e.g.
         this for ___clang_this.
      
      llvm-svn: 113866
      44096b1a
    • Greg Clayton's avatar
      95112df6
    • Greg Clayton's avatar
      Fixed an issue that was always causing an extra empty argument to be sent · a52c155e
      Greg Clayton authored
      to any inferior process because the code was checking if no run args were
      set and then adding and empty string. This was happening for environment
      vars as well.
      
      llvm-svn: 113831
      a52c155e
    • Greg Clayton's avatar
      Fixed the implementation of "bool Block::Contains (const Block *block) const" · 6f00abd5
      Greg Clayton authored
      to return the correct result.
      
      Fixed "bool Variable::IsInScope (StackFrame *frame)" to return the correct
      result when there are no location lists.
      
      Modified the "frame variable" command such that:
      - if no arguments are given (dump all frame variables), then we only show
        variables that are currently in scope
      - if some arguments are given, we show an error if the variable is out of 
        scope
      
      llvm-svn: 113830
      6f00abd5
    • Greg Clayton's avatar
      Looking at some of the test suite failures in DWARF in .o files with the · 016a95eb
      Greg Clayton authored
      debug map showed that the location lists in the .o files needed some 
      refactoring in order to work. The case that was failing was where a function
      that was in the "__TEXT.__textcoal_nt" in the .o file, and in the 
      "__TEXT.__text" section in the main executable. This made symbol lookup fail
      due to the way we were finding a real address in the debug map which was
      by finding the section that the function was in in the .o file and trying to
      find this in the main executable. Now the section list supports finding a
      linked address in a section or any child sections. After fixing this, we ran
      into issue that were due to DWARF and how it represents locations lists. 
      DWARF makes a list of address ranges and expressions that go along with those
      address ranges. The location addresses are expressed in terms of a compile
      unit address + offset. This works fine as long as nothing moves around. When
      stuff moves around and offsets change between the remapped compile unit base
      address and the new function address, then we can run into trouble. To deal
      with this, we now store supply a location list slide amount to any location
      list expressions that will allow us to make the location list addresses into
      zero based offsets from the object that owns the location list (always a
      function in our case). 
      
      With these fixes we can now re-link random address ranges inside the debugger
      for use with our DWARF + debug map, incremental linking, and more.
      
      Another issue that arose when doing the DWARF in the .o files was that GCC
      4.2 emits a ".debug_aranges" that only mentions functions that are externally
      visible. This makes .debug_aranges useless to us and we now generate a real
      address range lookup table in the DWARF parser at the same time as we index
      the name tables (that are needed because .debug_pubnames is just as useless).
      llvm-gcc doesn't generate a .debug_aranges section, though this could be 
      fixed, we aren't going to rely upon it.
      
      Renamed a bunch of "UINT_MAX" to "UINT32_MAX".
      
      llvm-svn: 113829
      016a95eb
    • Johnny Chen's avatar
      Fixed an error in Debugger::UpdateExecutionContext() where an invalid index ID 0 · c13ee52c
      Johnny Chen authored
      was used to set the selected thread if none was selected.  Use a more robust
      API to accomplish the task.
      
      Also fixed an error found, while investigating, in CommandObjectThreadSelect::
      Execute() where the return status was not properly set if successful.
      
      As a result, both the stl step-in test cases with expectedFailure decorators now
      passed.
      
      llvm-svn: 113825
      c13ee52c
  3. Sep 13, 2010
    • Sean Callanan's avatar
      Bugfixes to the expression parser. Fixes include: · 9e6ed53e
      Sean Callanan authored
       - If you put a semicolon at the end of an expression,
         this no longer causes the expression parser to
         error out.  This was a two-part fix: first,
         ClangExpressionDeclMap::Materialize now handles
         an empty struct (such as when there is no return
         value); second, ASTResultSynthesizer walks backward
         from the end of the ASTs until it reaches something
         that's not a NullStmt.
      
       - ClangExpressionVariable now properly byte-swaps when
         printing itself.
      
       - ClangUtilityFunction now cleans up after itself when
         it's done compiling itself.
      
       - Utility functions can now use external functions just
         like user expressions.
      
       - If you end your expression with a statement that does
         not return a value, the expression now runs correctly
         anyway.
      
      Also, added the beginnings of an Objective-C object
      validator function, which is neither installed nor used
      as yet.
      
      llvm-svn: 113789
      9e6ed53e
    • Caroline Tice's avatar
      Clean up help text. · 8830091a
      Caroline Tice authored
      llvm-svn: 113738
      8830091a
    • Greg Clayton's avatar
      Fixed an assertion that happened when debugging DWARF in .o files with debug · ffc1d667
      Greg Clayton authored
      map on macosx.
      
      llvm-svn: 113737
      ffc1d667
    • Greg Clayton's avatar
      Make sure we have a variable list so we don't crash when a frame has no · 9df87c17
      Greg Clayton authored
      frame variables.
      
      llvm-svn: 113736
      9df87c17
    • Greg Clayton's avatar
      Added the summary values for function pointers so we can show where they · 737b9329
      Greg Clayton authored
      point to.
      
      llvm-svn: 113735
      737b9329
    • Greg Clayton's avatar
      Removed unused variable. · 5804fa41
      Greg Clayton authored
      llvm-svn: 113734
      5804fa41
    • Greg Clayton's avatar
      Added a work in the DWARF parser when we parse an array that ends up having · a134cc1b
      Greg Clayton authored
      no elements so that they at least have 1 element. 
      
      Added the ability to show the declaration location of variables to the 
      "frame variables" with the "--show-declaration" option ("-c" for short).
      
      Changed the "frame variables" command over to use the value object code
      so that we use the same code path as the public API does when accessing and
      displaying variable values.
      
      llvm-svn: 113733
      a134cc1b
    • Greg Clayton's avatar
      Fixed a crash that would happen when using "frame variables" on any struct, · 83ff3898
      Greg Clayton authored
      union, or class that contained an enumeration type. When I was creating
      the clang enumeration decl, I wasn't calling "EnumDecl::setIntegerType (QualType)" 
      which means that if the enum decl was ever asked to figure out it's bit width
      (getTypeInfo()) it would crash. We didn't run into this with enum types that 
      weren't inside classes because the DWARF already told us how big the type was
      and when we printed an enum we would never need to calculate the size, we
      would use the pre-cached byte size we got from the DWARF. When the enum was 
      in a struct/union/class and we tried to layout the struct, the layout code
      would attempt to get the type info and segfault.
      
      llvm-svn: 113729
      83ff3898
  4. Sep 12, 2010
  5. Sep 11, 2010
  6. Sep 10, 2010
    • Greg Clayton's avatar
      There was a check to make sure that the frame had a valid function before the... · b57a127a
      Greg Clayton authored
      There was a check to make sure that the frame had a valid function before the expression parser would allow decl lookups which was not needed. After removing this you can evaluate expressions correctly when stopped in a frame that only has a symbol or has no symbol context at all.
      
      llvm-svn: 113611
      b57a127a
    • Johnny Chen's avatar
      Fixed the breakage of "breakpoint command add -p 1 2" caused by r113596 as · 0e1cb4e0
      Johnny Chen authored
      pointed out by Jim Ingham.  The convenient one-liner specification should only
      apply when there is only one breakpoint id being specified for the time being.
      
      llvm-svn: 113609
      0e1cb4e0
    • Johnny Chen's avatar
      3495f25a
    • Greg Clayton's avatar
      Added some missing API for address resolving within a module, and looking · 09960031
      Greg Clayton authored
      up a seciton offset address (SBAddress) within a module that returns a
      symbol context (SBSymbolContext). Also added a SBSymbolContextList in 
      preparation for adding find/lookup APIs that can return multiple results.
      
      Added a lookup example code that shows how to do address lookups.
      
      llvm-svn: 113599
      09960031
    • Johnny Chen's avatar
      Added the capability to specify a one-liner Python script as the callback · 94de55d5
      Johnny Chen authored
      command for a breakpoint, for example:
      
      (lldb) breakpoint command add -p 1 "conditional_break.stop_if_called_from_a()"
      
      The ScriptInterpreter interface has an extra method:
      
          /// Set a one-liner as the callback for the breakpoint command.
          virtual void 
          SetBreakpointCommandCallback (CommandInterpreter &interpreter,
                                        BreakpointOptions *bp_options,
                                        const char *oneliner);
      
      to accomplish the above.
      
      Also added a test case to demonstrate lldb's use of breakpoint callback command
      to stop at function c() only when its immediate caller is function a().  The
      following session shows the user entering the following commands:
      
      1) command source .lldb (set up executable, breakpoint, and breakpoint command)
      2) run (the callback mechanism will skip two breakpoints where c()'s immeidate caller is not a())
      3) bt (to see that indeed c()'s immediate caller is a())
      4) c (to continue and finish the program)
      
      test/conditional_break $ ../../build/Debug/lldb
      (lldb) command source .lldb
      Executing commands in '.lldb'.
      (lldb) file a.out
      Current executable set to 'a.out' (x86_64).
      (lldb) breakpoint set -n c
      Breakpoint created: 1: name = 'c', locations = 1
      (lldb) script import sys, os
      (lldb) script sys.path.append(os.path.join(os.getcwd(), os.pardir))
      (lldb) script import conditional_break
      (lldb) breakpoint command add -p 1 "conditional_break.stop_if_called_from_a()"
      (lldb) run
      run
      Launching '/Volumes/data/lldb/svn/trunk/test/conditional_break/a.out'  (x86_64)
      (lldb) Checking call frames...
      Stack trace for thread id=0x2e03 name=None queue=com.apple.main-thread:
        frame #0: a.out`c at main.c:39
        frame #1: a.out`b at main.c:34
        frame #2: a.out`a at main.c:25
        frame #3: a.out`main at main.c:44
        frame #4: a.out`start
      c called from b
      Continuing...
      Checking call frames...
      Stack trace for thread id=0x2e03 name=None queue=com.apple.main-thread:
        frame #0: a.out`c at main.c:39
        frame #1: a.out`b at main.c:34
        frame #2: a.out`main at main.c:47
        frame #3: a.out`start
      c called from b
      Continuing...
      Checking call frames...
      Stack trace for thread id=0x2e03 name=None queue=com.apple.main-thread:
        frame #0: a.out`c at main.c:39
        frame #1: a.out`a at main.c:27
        frame #2: a.out`main at main.c:50
        frame #3: a.out`start
      c called from a
      Stopped at c() with immediate caller as a().
      a(1) returns 4
      b(2) returns 5
      Process 20420 Stopped
      * thread #1: tid = 0x2e03, 0x0000000100000de8 a.out`c + 7 at main.c:39, stop reason = breakpoint 1.1, queue = com.apple.main-thread
        36   	
        37   	int c(int val)
        38   	{
        39 ->	    return val + 3;
        40   	}
        41   	
        42   	int main (int argc, char const *argv[])
      (lldb) bt
      bt
      thread #1: tid = 0x2e03, stop reason = breakpoint 1.1, queue = com.apple.main-thread
        frame #0: 0x0000000100000de8 a.out`c + 7 at main.c:39
        frame #1: 0x0000000100000dbc a.out`a + 44 at main.c:27
        frame #2: 0x0000000100000e4b a.out`main + 91 at main.c:50
        frame #3: 0x0000000100000d88 a.out`start + 52
      (lldb) c
      c
      Resuming process 20420
      Process 20420 Exited
      a(3) returns 6
      (lldb) 
      
      llvm-svn: 113596
      94de55d5
    • Johnny Chen's avatar
      Don't flatten lldb and import everything into the global namespace. Instead, · d0211cc6
      Johnny Chen authored
      set the debugger_unique_id with the lldb prefix.
      
      llvm-svn: 113589
      d0211cc6
    • Jason Molenda's avatar
      The first part of an lldb native stack unwinder. · fbcb7f2c
      Jason Molenda authored
      The Unwind and RegisterContext subclasses still need
      to be finished; none of this code is used by lldb at
      this point (unless you call into it by hand).
      
      The ObjectFile class now has an UnwindTable object.
      
      The UnwindTable object has a series of FuncUnwinders
      objects (Function Unwinders) -- one for each function
      in that ObjectFile we've backtraced through during this
      debug session.
      
      The FuncUnwinders object has a few different UnwindPlans.
      UnwindPlans are a generic way of describing how to find
      the canonical address of a given function's stack frame
      (the CFA idea from DWARF/eh_frame) and how to restore the
      caller frame's register values, if they have been saved
      by this function.
      
      UnwindPlans are created from different sources.  One source is the
      eh_frame exception handling information generated by the compiler
      for unwinding an exception throw.  Another source is an assembly
      language inspection class (UnwindAssemblyProfiler, uses the Plugin
      architecture) which looks at the instructions in the funciton
      prologue and describes the stack movements/register saves that are
      done.
      
      Two additional types of UnwindPlans that are worth noting are
      the "fast" stack UnwindPlan which is useful for making a first
      pass over a thread's stack, determining how many stack frames there
      are and retrieving the pc and CFA values for each frame (enough
      to create StackFrameIDs).  Only a minimal set of registers is
      recovered during a fast stack walk.  
      
      The final UnwindPlan is an architectural default unwind plan.
      These are provided by the ArchDefaultUnwindPlan class (which uses
      the plugin architecture).  When no symbol/function address range can
      be found for a given pc value -- when we have no eh_frame information
      and when we don't have a start address so we can't examine the assembly
      language instrucitons -- we have to make a best guess about how to 
      unwind.  That's when we use the architectural default UnwindPlan.
      On x86_64, this would be to assume that rbp is used as a stack pointer
      and we can use that to find the caller's frame pointer and pc value.
      It's a last-ditch best guess about how to unwind out of a frame.
      
      There are heuristics about when to use one UnwindPlan versues the other --
      this will all happen in the still-begin-written UnwindLLDB subclass of
      Unwind which runs the UnwindPlans.
      
      llvm-svn: 113581
      fbcb7f2c
    • Caroline Tice's avatar
      If the file the user specifies can't be found in the current directory, · 428a9a58
      Caroline Tice authored
      and the user didn't specify a particular directory, search for the file 
      using the $PATH environment variable.
      
      llvm-svn: 113575
      428a9a58
    • Greg Clayton's avatar
      Cleaned up the output of "image lookup --address <ADDR>" which involved · c9800667
      Greg Clayton authored
      cleaning up the output of many GetDescription objects that are part of a 
      symbol context. This fixes an issue where no ranges were being printed out
      for functions, blocks and symbols.
      
      llvm-svn: 113571
      c9800667
  7. Sep 09, 2010
Loading