Browse Source

small tweaks

pull/2/head
Fernando Trias 4 years ago
parent
commit
b0f00d16fd
  1. 4
      README.md
  2. 1
      TeensyDebug.cpp
  3. 2
      TeensyDebug.h
  4. 2
      gdbstubs.cpp

4
README.md

@ -83,7 +83,7 @@ After compiling and uploading this program, Teensy will have two serial ports. O
You also need to find the GDB executable that came with Teensyduino. On the Mac it is located in `/Applications/Teensyduino.app/Contents/Java/hardware//tools/arm/bin/arm-none-eabi-gdb`.
Next, find the ELF file created. Arduino puts it in a temporary directory, but forunately, it is the same directory for the duration of Arduino. If you look at the output, you should see multiple mentions of a file ending with ".elf". For example: `/var/folders/j1/8hkyfp_96zl_lgp19b19pbj80000gp/T/arduino_build_133762/breakpoint_test.ino.elf`
Next, find the ELF file created. Arduino puts it in a temporary directory, but forunately, it is the same directory for the duration of Arduino. If you look at the output, you should see multiple mentions of a file ending with ".elf". For example: `/var/folders/j1/8hkyfp_96zl_lgp19b19pbj80000gp/T/arduino_build_133762/breakpoint_test.ino.elf`.
Running GDB yields:
@ -146,6 +146,8 @@ This is how it works with Teensy.
6. On the Teensy 3.2, we could as well use the Flash Patch Block to set and remove SVC calls using patching. Thus, you can dynamically set breakpoints in flash. Teensy 4 doesn't support this, but since it places code in RAM, that's probably not a big deal.
7. It will take over the SVC, software and all fault interrupts. The software interrupt will be "chained" so it will process it's own interrupts and any other interrupts will be sent to the original interrupt handler. SVC should be chained as well in the future.
Future considerations
---------------------------------------------

1
TeensyDebug.cpp

@ -19,6 +19,7 @@ https://github.com/turboscrew/rpi_stub
https://www.embecosm.com/appnotes/ean4/embecosm-howto-rsp-server-ean4-issue-2.html
https://github.com/redox-os/binutils-gdb/blob/master/gdb/arm-tdep.c
https://github.com/redox-os/binutils-gdb/blob/master/gdb/stubs/i386-stub.c
https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Protocol.html#Remote-Protocol
*/

2
TeensyDebug.h

@ -8,7 +8,7 @@
#endif
// If this is used internally, not need to remap
#ifndef DEBUG_INTERNAL
#ifndef GDB_DEBUG_INTERNAL
#ifdef HAS_FP_MAP
// rename the original setup() because we need to hijack it
#define setup setup_main

2
gdbstubs.cpp

@ -11,7 +11,7 @@
#include <Arduino.h>
#define DEBUG_INTERNAL
#define GDB_DEBUG_INTERNAL
#include "TeensyDebug.h"

Loading…
Cancel
Save