mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
fix: expand RTT debugger compatibility
This commit is contained in:
+3
-3
@@ -35,8 +35,8 @@ func Monitor(executable, port string, config *compileopts.Config) error {
|
||||
// Use the RTT interface, which is documented (in part) here:
|
||||
// https://wiki.segger.com/RTT
|
||||
|
||||
// Try to find the "machine.rttSerialInstance" symbol, which is the RTT
|
||||
// control block.
|
||||
// Try to find the "_SEGGER_RTT" symbol (machine.rttSerialInstance)
|
||||
// symbol, which is the RTT control block.
|
||||
file, err := elf.Open(executable)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not open ELF file to determine RTT control block: %w", err)
|
||||
@@ -48,7 +48,7 @@ func Monitor(executable, port string, config *compileopts.Config) error {
|
||||
}
|
||||
var address uint64
|
||||
for _, symbol := range symbols {
|
||||
if symbol.Name == "machine.rttSerialInstance" {
|
||||
if symbol.Name == "_SEGGER_RTT" {
|
||||
address = symbol.Value
|
||||
break
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import (
|
||||
)
|
||||
|
||||
// This symbol name is known by the compiler, see monitor.go.
|
||||
//
|
||||
//go:linkname rttSerialInstance _SEGGER_RTT
|
||||
var rttSerialInstance rttSerial
|
||||
|
||||
var Serial = &rttSerialInstance
|
||||
|
||||
Reference in New Issue
Block a user