Skip to content

Commit e68b5cc

Browse files
committed
Address David's remaining feedback
1 parent 16122d3 commit e68b5cc

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

lldb/docs/resources/lldbgdbremote.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,16 +2000,19 @@ correctly.
20002000
20012001
## qWasmCallStack
20022002
2003-
Get the Wasm callback for the given thread id. This returns a hex-encoding list
2004-
of 64-bit addresses for the frame PCs. To match the Wasm specification, the
2005-
addresses are encoded in little endian byte order.
2003+
Get the Wasm call stack for the given thread id. This returns a hex-encoded
2004+
list of PC values, one for each frame of the call stack. To match the Wasm
2005+
specification, the addresses are encoded in little endian byte order, even if
2006+
the endian of the Wasm runtime's host is not little endian.
20062007
20072008
```
20082009
send packet: $qWasmCallStack:202dbe040#08
20092010
read packet: $9c01000000000040e501000000000040fe01000000000040#
20102011
```
20112012
2012-
**Priority to Implement:** Only required for WebAssembly support.
2013+
**Priority to Implement:** Only required for Wasm support. This packed is
2014+
supported by the [WAMR](https://github.com/bytecodealliance/wasm-micro-runtime)
2015+
and [V8](https://v8.dev) Wasm runtimes.
20132016
20142017
## qWatchpointSupportInfo
20152018

lldb/source/Plugins/Process/wasm/ProcessWasm.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ LLDB_PLUGIN_DEFINE(ProcessWasm)
2424

2525
ProcessWasm::ProcessWasm(lldb::TargetSP target_sp, ListenerSP listener_sp)
2626
: ProcessGDBRemote(target_sp, listener_sp) {
27-
// Always use Linux signals for Wasm process.
28-
m_unix_signals_sp = UnixSignals::Create(ArchSpec{"wasm32-unknown-wasi-wasm"});
27+
assert(target_sp);
28+
// Wasm doesn't have any Unix-like signals as a platform concept, but pretend
29+
// like it does to appease LLDB.
30+
m_unix_signals_sp = UnixSignals::Create(target_sp->GetArchitecture());
2931
}
3032

3133
void ProcessWasm::Initialize() {

lldb/source/Plugins/Process/wasm/ProcessWasm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace wasm {
1717
/// Each WebAssembly module has separated address spaces for Code and Memory.
1818
/// A WebAssembly module also has a Data section which, when the module is
1919
/// loaded, gets mapped into a region in the module Memory.
20-
enum WasmAddressType { Memory = 0x00, Object = 0x01, Invalid = 0x03 };
20+
enum WasmAddressType : uint8_t { Memory = 0x00, Object = 0x01, Invalid = 0xff };
2121

2222
/// For the purpose of debugging, we can represent all these separated 32-bit
2323
/// address spaces with a single virtual 64-bit address space. The

lldb/source/Plugins/Process/wasm/UnwindWasm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class WasmGDBRemoteRegisterContext : public GDBRemoteRegisterContext {
2828
false) {
2929
// Wasm does not have a fixed set of registers but relies on a mechanism
3030
// named local and global variables to store information such as the stack
31-
// pointer.
31+
// pointer. The only actual register is the PC.
3232
PrivateSetRegisterValue(0, pc);
3333
}
3434
};

0 commit comments

Comments
 (0)