Internal change

PiperOrigin-RevId: 244881751
Change-Id: I3f3200c4d85906058ac17ed941e69ea22d9a4090
This commit is contained in:
Wiktor Garbacz 2019-04-23 10:41:28 -07:00 committed by Copybara-Service
parent 0fd468be7c
commit 63006c1476
4 changed files with 12 additions and 9 deletions

View File

@ -23,8 +23,8 @@
namespace sapi {
::sapi::Status RPCChannel::Call(const FuncCall& call, uint32_t tag, FuncRet* ret,
v::Type exp_type) {
::sapi::Status RPCChannel::Call(const FuncCall& call, uint32_t tag,
FuncRet* ret, v::Type exp_type) {
absl::MutexLock lock(&mutex_);
if (!comms_->SendTLV(tag, sizeof(call),
reinterpret_cast<const uint8_t*>(&call))) {

View File

@ -51,9 +51,10 @@ class CommsTest : public ::testing::Test {
timespec ts1, ts2;
CHECK_NE(clock_gettime(CLOCK_REALTIME, &ts1), -1);
CHECK_NE(clock_gettime(CLOCK_REALTIME, &ts2), -1);
snprintf(sockname_, sizeof(sockname_), "comms-test-%u-%u-%u-%u",
static_cast<uint32_t>(ts1.tv_sec), static_cast<uint32_t>(ts1.tv_nsec),
static_cast<uint32_t>(ts2.tv_sec), static_cast<uint32_t>(ts2.tv_nsec));
snprintf(
sockname_, sizeof(sockname_), "comms-test-%u-%u-%u-%u",
static_cast<uint32_t>(ts1.tv_sec), static_cast<uint32_t>(ts1.tv_nsec),
static_cast<uint32_t>(ts2.tv_sec), static_cast<uint32_t>(ts2.tv_nsec));
LOG(INFO) << "Sockname: " << sockname_;
// Comms channel using a descriptor (initialized with a file descriptor).
@ -406,8 +407,9 @@ class SenderThread {
SenderThread(Comms* comms, size_t rounds) : comms_(comms), rounds_(rounds) {}
void operator()() {
for (size_t i = 0; i < rounds_; i++) {
ASSERT_THAT(comms_->SendBytes(reinterpret_cast<const uint8_t*>("Test"), 4),
IsTrue());
ASSERT_THAT(
comms_->SendBytes(reinterpret_cast<const uint8_t*>("Test"), 4),
IsTrue());
}
}

View File

@ -295,7 +295,7 @@ buffer.Create(1ULL << 20); // 1 MiB
s2.RunAsync();
comms->SendFD(buffer.GetFD());
auto result = s2.AwaitResult();
uint8* buf = buffer.buffer(); // As modified by sandboxee
uint8_t* buf = buffer.buffer(); // As modified by sandboxee
size_t len = buffer.size();
```
@ -307,7 +307,7 @@ int fd;
comms.RecvFD(&fd);
sandbox2::Buffer buffer;
buffer.Setup(fd);
uint8 *buf = buffer.GetBuffer();
uint8_t *buf = buffer.GetBuffer();
memset(buf, 'X', buffer.GetSize()); /* work with the buffer */
```

View File

@ -46,6 +46,7 @@ std::string DemangleSymbol(const std::string& maybe_mangled) {
}
return maybe_mangled;
}
std::string GetSymbolAt(const std::map<uint64_t, std::string>& addr_to_symbol,
uint64_t addr) {
auto entry_for_next_symbol = addr_to_symbol.lower_bound(addr);