Skip to content

Commit 5fbe7ae

Browse files
committed
Update dependencies
1 parent 3b03deb commit 5fbe7ae

File tree

12 files changed

+617
-523
lines changed

12 files changed

+617
-523
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
import lldb
6+
7+
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
8+
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
9+
base = frame.register["x0"].GetValueAsAddress()
10+
page_len = frame.register["x1"].GetValueAsUnsigned()
11+
12+
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
13+
# first page to see if handled it correctly. This makes diagnosing
14+
# misconfiguration (e.g. missing breakpoint) easier.
15+
data = bytearray(page_len)
16+
data[0:8] = b'IHELPED!'
17+
18+
error = lldb.SBError()
19+
frame.GetThread().GetProcess().WriteMemory(base, data, error)
20+
if not error.Success():
21+
print(f'Failed to write into {base}[+{page_len}]', error)
22+
return
23+
24+
def __lldb_init_module(debugger: lldb.SBDebugger, _):
25+
target = debugger.GetDummyTarget()
26+
# Caveat: must use BreakpointCreateByRegEx here and not
27+
# BreakpointCreateByName. For some reasons callback function does not
28+
# get carried over from dummy target for the later.
29+
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
30+
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
31+
bp.SetAutoContinue(True)
32+
print("-- LLDB integration loaded --")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
command script import --relative-to-command-file flutter_lldb_helper.py

lib/backend/database/helper.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ import 'dart:io';
22

33
import 'package:files/backend/database/model.dart';
44
import 'package:files/backend/providers.dart';
5+
import 'package:isar_community/isar.dart';
56

67
class EntityStatCacheHelper {
78
Future<EntityStat> get(String path) async {
89
final stat = isar.entityStats.where().pathEqualTo(path).findFirstSync();
910

1011
if (stat == null) {
11-
final fetchedStat = EntityStat.fromStat(
12-
path,
13-
await FileStat.stat(path),
14-
);
12+
final fetchedStat = EntityStat.fromStat(path, await FileStat.stat(path));
1513
await set(fetchedStat);
1614
return fetchedStat;
1715
}

lib/backend/database/model.dart

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import 'dart:io';
22

33
import 'package:files/backend/providers.dart';
44
import 'package:flutter/foundation.dart';
5-
import 'package:isar/isar.dart';
6-
7-
export 'package:isar/isar.dart';
5+
import 'package:isar_community/isar.dart';
86

97
part 'model.g.dart';
108

@@ -23,15 +21,15 @@ class EntityStat with ChangeNotifier {
2321
});
2422

2523
EntityStat.fromStat(String path, FileStat stat)
26-
: this.fastInit(
27-
path: path,
28-
changed: stat.changed,
29-
modified: stat.modified,
30-
accessed: stat.accessed,
31-
type: EntityType.fromDartIo(stat.type),
32-
mode: stat.mode,
33-
size: stat.size,
34-
);
24+
: this.fastInit(
25+
path: path,
26+
changed: stat.changed,
27+
modified: stat.modified,
28+
accessed: stat.accessed,
29+
type: EntityType.fromDartIo(stat.type),
30+
mode: stat.mode,
31+
size: stat.size,
32+
);
3533
Id? id;
3634

3735
@Index(unique: true, type: IndexType.hash)

0 commit comments

Comments
 (0)