2011-07-19 07:11:07 +08:00
//===-- SWIG Interface for SBLineEntry --------------------------*- C++ -*-===//
//
2019-01-19 16:50:56 +08:00
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2011-07-19 07:11:07 +08:00
//
//===----------------------------------------------------------------------===//
n a m e s p a c e l l d b {
% f e a t u r e ( "docstring" ,
" S p e c i f i e s a n a s s o c i a t i o n with a c o n t i g u o u s r a n g e of i n s t r u c t i o n s and
2021-01-16 02:49:51 +08:00
a source file l o c a t i o n .
: p y : class : ` S B C o m p i l e U n i t ` contains S B L i n e E n t r y ( s ) . For e x a m p l e , : :
2011-07-19 07:11:07 +08:00
2011-07-28 02:28:07 +08:00
for l i n e E n t r y in c o m p i l e U n i t :
2015-10-17 01:52:32 +08:00
p r i n t ( 'line entry: %s:%d' % ( s t r ( l i n e E n t r y . G e t F i l e S p e c ( ) ) ,
l i n e E n t r y . G e t L i n e ( ) ) )
p r i n t ( 'start addr: %s' % s t r ( l i n e E n t r y . G e t S t a r t A d d r e s s ( ) ) )
p r i n t ( 'end addr: %s' % s t r ( l i n e E n t r y . G e t E n d A d d r e s s ( ) ) )
2011-07-28 02:28:07 +08:00
2021-01-15 21:43:26 +08:00
p r o d u c e s : : :
line entry : / V o l u m e s / d a t a / l l d b / s v n / t r u n k / t e s t / p y t h o n _ a p i / s y m b o l - c o n t e x t / m a i n . c : 20
start a d d r : a . o u t [ 0x100000d98 ]
end a d d r : a . o u t [ 0x100000da3 ]
line entry : / V o l u m e s / d a t a / l l d b / s v n / t r u n k / t e s t / p y t h o n _ a p i / s y m b o l - c o n t e x t / m a i n . c : 21
start a d d r : a . o u t [ 0x100000da3 ]
end a d d r : a . o u t [ 0x100000da9 ]
line entry : / V o l u m e s / d a t a / l l d b / s v n / t r u n k / t e s t / p y t h o n _ a p i / s y m b o l - c o n t e x t / m a i n . c : 22
start a d d r : a . o u t [ 0x100000da9 ]
end a d d r : a . o u t [ 0x100000db6 ]
line entry : / V o l u m e s / d a t a / l l d b / s v n / t r u n k / t e s t / p y t h o n _ a p i / s y m b o l - c o n t e x t / m a i n . c : 23
start a d d r : a . o u t [ 0x100000db6 ]
end a d d r : a . o u t [ 0x100000dbc ]
. . .
S e e a l s o : p y : class : ` S B C o m p i l e U n i t ` . "
2011-07-19 07:11:07 +08:00
) S B L i n e E n t r y ;
class S B L i n e E n t r y
{
public :
S B L i n e E n t r y ( ) ;
S B L i n e E n t r y ( c o n s t l l d b : : S B L i n e E n t r y &rhs);
~ S B L i n e E n t r y ( ) ;
l l d b : : S B A d d r e s s
G e t S t a r t A d d r e s s ( ) c o n s t ;
l l d b : : S B A d d r e s s
G e t E n d A d d r e s s ( ) c o n s t ;
b o o l
I s V a l i d ( ) c o n s t ;
Add "operator bool" to SB APIs
Summary:
Our python version of the SB API has (the python equivalent of)
operator bool, but the C++ version doesn't.
This is because our python operators are added by modify-python-lldb.py,
which performs postprocessing on the swig-generated interface files.
In this patch, I add the "operator bool" to all SB classes which have an
IsValid method (which is the same logic used by modify-python-lldb.py).
This way, we make the two interfaces more constent, and it allows us to
rely on swig's automatic syntesis of python __nonzero__ methods instead
of doing manual fixups.
Reviewers: zturner, jingham, clayborg, jfb, serge-sans-paille
Subscribers: jdoerfert, lldb-commits
Differential Revision: https://reviews.llvm.org/D58792
llvm-svn: 355824
2019-03-11 21:58:46 +08:00
explicit o p e r a t o r b o o l ( ) c o n s t ;
2011-07-19 07:11:07 +08:00
l l d b : : S B F i l e S p e c
G e t F i l e S p e c ( ) c o n s t ;
u i n t 32 _ t
G e t L i n e ( ) c o n s t ;
u i n t 32 _ t
G e t C o l u m n ( ) c o n s t ;
b o o l
G e t D e s c r i p t i o n ( l l d b : : S B S t r e a m &description);
2011-09-26 15:11:27 +08:00
void
S e t F i l e S p e c ( l l d b : : S B F i l e S p e c f i l e s p e c ) ;
2019-04-19 00:23:33 +08:00
2011-09-26 15:11:27 +08:00
void
S e t L i n e ( u i n t 32 _ t line ) ;
2019-04-19 00:23:33 +08:00
2011-09-26 15:11:27 +08:00
void
S e t C o l u m n ( u i n t 32 _ t column ) ;
2013-05-03 09:29:27 +08:00
b o o l
o p e r a t o r = = ( c o n s t l l d b : : S B L i n e E n t r y &rhs) const;
2019-04-19 00:23:33 +08:00
2013-05-03 09:29:27 +08:00
b o o l
o p e r a t o r ! = ( c o n s t l l d b : : S B L i n e E n t r y &rhs) const;
2019-04-19 00:23:33 +08:00
2020-01-09 08:13:03 +08:00
S T R I N G _ E X T E N S I O N ( S B L i n e E n t r y )
2019-12-09 06:46:48 +08:00
# i f def S W I G P Y T H O N
2012-01-29 14:07:39 +08:00
% p y t h o n c o d e % {
2019-07-03 06:18:35 +08:00
file = property ( G e t F i l e S p e c , None , d o c = '''A read only property that returns an lldb object that represents the file (lldb.SBFileSpec) for this line entry.''' )
line = property ( G e t L i n e , None , d o c = '''A read only property that returns the 1 based line number for this line entry, a return value of zero indicates that no line information is available.''' )
column = property ( G e t C o l u m n , None , d o c = '''A read only property that returns the 1 based column number for this line entry, a return value of zero indicates that no column information is available.''' )
a d d r = property ( G e t S t a r t A d d r e s s , None , d o c = '''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this line entry.''' )
e n d _ a d d r = property ( G e t E n d A d d r e s s , None , d o c = '''A read only property that returns an lldb object that represents the end address (lldb.SBAddress) for this line entry.''' )
2012-01-29 14:07:39 +08:00
% }
2019-12-09 06:46:48 +08:00
# e n d i f
2011-07-19 07:11:07 +08:00
} ;
} // namespace lldb