Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
dart::CodeBreakpoint Class Reference

#include <debugger.h>

Public Member Functions

 CodeBreakpoint (const Code &code, BreakpointLocation *loc, uword pc, UntaggedPcDescriptors::Kind kind)
 
 ~CodeBreakpoint ()
 
FunctionPtr function () const
 
uword pc () const
 
bool HasBreakpointLocation (BreakpointLocation *breakpoint_location)
 
bool FindAndDeleteBreakpointLocation (BreakpointLocation *breakpoint_location)
 
bool HasNoBreakpointLocations ()
 
void Enable ()
 
void Disable ()
 
bool IsEnabled () const
 
CodePtr OrigStubAddress () const
 
const char * ToCString () const
 

Friends

class Debugger
 
class GroupDebugger
 

Detailed Description

Definition at line 210 of file debugger.h.

Constructor & Destructor Documentation

◆ CodeBreakpoint()

dart::CodeBreakpoint::CodeBreakpoint ( const Code code,
BreakpointLocation loc,
uword  pc,
UntaggedPcDescriptors::Kind  kind 
)

Definition at line 1317 of file debugger.cc.

1321 : code_(code.ptr()),
1322 pc_(pc),
1323 enabled_count_(0),
1324 next_(nullptr),
1325 breakpoint_kind_(kind),
1326 saved_value_(Code::null()) {
1327 ASSERT(!code.IsNull());
1328 ASSERT(pc_ != 0);
1329 ASSERT((breakpoint_kind_ & kSafepointKind) != 0);
1330 AddBreakpointLocation(breakpoint_location);
1331 ASSERT(breakpoint_location->token_pos().IsReal());
1332}
uword pc() const
Definition: debugger.h:226
static ObjectPtr null()
Definition: object.h:433
#define ASSERT(E)
const uint8_t kSafepointKind
Definition: debugger.cc:1313

◆ ~CodeBreakpoint()

dart::CodeBreakpoint::~CodeBreakpoint ( )

Definition at line 1334 of file debugger.cc.

1334 {
1335 // Make sure we don't leave patched code behind.
1336 ASSERT(!IsEnabled());
1337// Poison the data so we catch use after free errors.
1338#ifdef DEBUG
1339 code_ = Code::null();
1340 pc_ = 0ul;
1341 next_ = nullptr;
1342 breakpoint_kind_ = UntaggedPcDescriptors::kOther;
1343#endif
1344}
bool IsEnabled() const
Definition: debugger.h:235

Member Function Documentation

◆ Disable()

void dart::CodeBreakpoint::Disable ( )

Definition at line 1353 of file debugger.cc.

1353 {
1354 if (enabled_count_ == 1) {
1355 RestoreCode();
1356 }
1357 --enabled_count_;
1358}

◆ Enable()

void dart::CodeBreakpoint::Enable ( )

Definition at line 1346 of file debugger.cc.

1346 {
1347 if (enabled_count_ == 0) {
1348 PatchCode();
1349 }
1350 ++enabled_count_;
1351}

◆ FindAndDeleteBreakpointLocation()

bool dart::CodeBreakpoint::FindAndDeleteBreakpointLocation ( BreakpointLocation breakpoint_location)

Definition at line 1370 of file debugger.cc.

1371 {
1372 for (intptr_t i = 0; i < breakpoint_locations_.length(); i++) {
1373 if (breakpoint_locations_[i] == breakpoint_location) {
1374 breakpoint_locations_.EraseAt(i);
1375 return true;
1376 }
1377 }
1378 return false;
1379}

◆ function()

FunctionPtr dart::CodeBreakpoint::function ( ) const
inline

Definition at line 224 of file debugger.h.

224{ return Code::Handle(code_).function(); }
static Object & Handle()
Definition: object.h:407

◆ HasBreakpointLocation()

bool dart::CodeBreakpoint::HasBreakpointLocation ( BreakpointLocation breakpoint_location)

Definition at line 1360 of file debugger.cc.

1361 {
1362 for (intptr_t i = 0; i < breakpoint_locations_.length(); i++) {
1363 if (breakpoint_locations_[i] == breakpoint_location) {
1364 return true;
1365 }
1366 }
1367 return false;
1368}

◆ HasNoBreakpointLocations()

bool dart::CodeBreakpoint::HasNoBreakpointLocations ( )
inline

Definition at line 229 of file debugger.h.

229 {
230 return breakpoint_locations_.length() == 0;
231 }

◆ IsEnabled()

bool dart::CodeBreakpoint::IsEnabled ( ) const
inline

Definition at line 235 of file debugger.h.

235{ return enabled_count_ > 0; }

◆ OrigStubAddress()

CodePtr dart::CodeBreakpoint::OrigStubAddress ( ) const

◆ pc()

uword dart::CodeBreakpoint::pc ( ) const
inline

Definition at line 226 of file debugger.h.

226{ return pc_; }

◆ ToCString()

const char * dart::CodeBreakpoint::ToCString ( ) const

Definition at line 211 of file debugger.cc.

211 {
212 if (breakpoint_locations_.length() == 0) {
213 return "unlinked breakpoint";
214 }
215
216 char buffer[1024];
217 BufferFormatter f(buffer, sizeof(buffer));
218 // Pick the first, all other should have same script/line number.
219 BreakpointLocation* breakpoint_location = breakpoint_locations_.At(0);
220 String& source_url = String::Handle(breakpoint_location->url());
221 intptr_t line_number = breakpoint_location->line_number();
222
223 f.Printf("breakpoint at %s:%" Pd, source_url.ToCString(), line_number);
225}
Zone * zone() const
Definition: thread_state.h:37
static Thread * Current()
Definition: thread.h:362
char * MakeCopyOfString(const char *str)
Definition: zone.cc:270
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
#define Pd
Definition: globals.h:408

Friends And Related Function Documentation

◆ Debugger

friend class Debugger
friend

Definition at line 275 of file debugger.h.

◆ GroupDebugger

friend class GroupDebugger
friend

Definition at line 276 of file debugger.h.


The documentation for this class was generated from the following files: