Commit Graph

15 Commits

Author SHA1 Message Date
Jason Molenda 6ab659a922 First part of an attempt to indicate to the user when they are
debugging optimized code.  Adds new methods on Function/SBFunction
to query whether a given function is optimized.  Adds a new
function.is-optimized format entity and changes the default 
frame-format to append "[opt]" if the function was built with
optimization.

The only indication that a binary was built with optimization
that we have right now is the presence of the DW_AT_APPLE_optimized
attribute (DW_FORM_flag value 1) in the DW_TAG_compile_unit.
The absence of this flag may mean that the compile_unit was not
compiled with optimization, or it may mean that the producer 
does not generate this attribute.

Currently this only works for dSYM debugging.  When we create
the CompileUnit with dwarf-in-.o-file debugging we don't have
the attribute value yet so it's not set.  I need to find the
flag value when we do start to read the .o file DWARF and 
set the CompileUnit's status at that point - but haven't 
done it yet.

I'm also going to add a mechanism for issuing warnings to users
such that they're only issued once in a debug session and 
there is away for users to suppress these warnings altogether
via .lldbinit file settings.  But I want to get this changeset
committed now that it's at a useful state.

<rdar://problem/19281172> 

llvm-svn: 243508
2015-07-29 00:42:47 +00:00
Chaoren Lin 98d0a4b39a Refactor Unix signals.
Summary:
- Consolidate Unix signals selection in UnixSignals.
- Make Unix signals available from platform.
- Add jSignalsInfo packet to retrieve Unix signals from remote platform.
- Get a copy of the platform signal for each remote process.
- Update SB API for signals.
- Update signal utility in test suite.

Reviewers: ovyalov, clayborg

Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D11094

llvm-svn: 242101
2015-07-14 01:09:28 +00:00
Jim Ingham 763b2b26a0 Add a version of SBTarget::EvaluateExpression that doesn't require
an options (and makes an appropriate defaulted option for you.)

<rdar://problem/20639202>

llvm-svn: 241632
2015-07-07 22:12:17 +00:00
Enrico Granata c1f705c229 Add a GetDisplayName() API to SBFrame, SBFunction and SBSymbol
This API is currently a no-op (in the sense that it has the same behavior as the already existing GetName()), but is meant long-term to provide a best-for-visualization version of the name of a function

It is still not hooked up to the command line 'bt' command, nor to the 'gui' mode, but I do have ideas on how to make that work going forward

rdar://21203242

llvm-svn: 241482
2015-07-06 18:28:46 +00:00
Oleksiy Vyalov 05f75e9ffb Add const versions of SBFrame::GetFunctionName and SBFrame::IsInlined.
http://reviews.llvm.org/D10711

llvm-svn: 240660
2015-06-25 17:41:41 +00:00
Oleksiy Vyalov 6345fe3eb3 Revert rL240435: "Mark SBFrame::GetFunctionName and SBFrame::IsInlined as const.".
llvm-svn: 240565
2015-06-24 18:35:36 +00:00
Oleksiy Vyalov a5d9c1d32f Mark SBFrame::GetFunctionName and SBFrame::IsInlined as const.
llvm-svn: 240435
2015-06-23 18:21:55 +00:00
Bruce Mitchener 58ef391f3e Fix a variety of typos.
No functional change.

llvm-svn: 239995
2015-06-18 05:27:05 +00:00
Enrico Granata 84afb21563 Add a .parent property to SBFrame's Python interface which allows easy access to the caller frame of the current frame
llvm-svn: 239853
2015-06-16 21:07:52 +00:00
Jason Molenda de905773ae Add quick bit of doc about SBFrame::GetCFA().
llvm-svn: 238395
2015-05-28 04:55:53 +00:00
Greg Clayton 424a5dbc73 Added a new API to SBFrame:
lldb::addr_t SBFrame::GetCFA();

This gets the CFA (call frame address) of the frame so it allows us to take an address that is on the stack and figure out which thread it comes from.

Also modified the heap.py module to be able to find out which variable in a frame's stack frame contains an address. This way when ptr_refs finds a match on the stack, it get then report which variable contains the pointer.

llvm-svn: 238393
2015-05-28 03:27:22 +00:00
Greg Clayton 4e1042e1bf Allow expresions to have unique expression prefixes:
expr_options = lldb.SBExpressionOptions()
expr_options.SetPrefix('''
struct Foo {
   int a;
   int b;
   int c;
}
'''
expr_result = frame.EvaluateExpression ("Foo foo = { 1, 2, 3}; foo", expr_options)

This fixed a current issue with ptr_refs, cstr_refs and malloc_info so that they can work. If expressions define their own types and then return expression results that use those types, those types get copied into the target's AST context so they persist and the expression results can be still printed and used in future expressions. Code was added to the expression parser to copy the context in which types are defined if they are used as the expression results. So in the case of types defined by expressions, they get defined in a lldb_expr function and that function and _all_ of its statements get copied. Many types of statements are not supported in this copy (array subscript, lambdas, etc) so this causes expressions to fail as they can't copy the result types. To work around this issue I have added code that allows expressions to specify an expression specific prefix. Then when you evaluate the expression you can pass the "expr_options" and have types that can be correctly copied out into the target. I added this as a way to work around an issue, but I also think it is nice to be allowed to specify an expression prefix that can be reused by many expressions, so this feature is very useful.

<rdar://problem/21130675>

llvm-svn: 238365
2015-05-27 22:32:39 +00:00
Ilia K 06d2855fb3 Fix a reason of *stopped notifications due to SIGINT/SIGSTOP signals (MI)
# Add SBProcess::GetInterruptedFromEvent
# Add vrEvent arg in CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateStopped
  and CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal
# Refactor CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal
## Clean up and fix typos
## Remove vwrbShouldBrk arg
# Fix MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_{local,remote}
  to expect SIGSTOP instead of SIGINT

llvm-svn: 237426
2015-05-15 09:29:09 +00:00
Ilia K 7f83624222 Add language option in -gdb-show command (MI)
Summary:
Add language option in -gdb-show command + test:
```
$ bin/lldb-mi ~/p/hello
[...]
b main
[...]
r
[...]
(gdb)
-gdb-show language
^done,value="c++"
(gdb)
quit
```

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh, granata.enrico, jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, jingham, granata.enrico, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D9279

llvm-svn: 235983
2015-04-28 12:51:16 +00:00
Bruce Mitchener 17d2730ee0 Start to share SWIG interface files between languages.
Summary:
Move scripts/Python/interface to scripts/interface so that we
can start making iterative improvements towards sharing the
interface files between multiple languages (each of which would
have their own directory as now).

Test Plan: Build and see.

Reviewers: zturner, emaste, clayborg

Reviewed By: clayborg

Subscribers: mjsabby, lldb-commits

Differential Revision: http://reviews.llvm.org/D9212

llvm-svn: 235676
2015-04-24 00:38:53 +00:00