Skip to content

Commit 0e2adcb

Browse files
Clean up GDB include and library dir
Replace GDBstub.h with the version in the internal/ directory, and adjust stub code accordingly. This way, only one copy of a file called "GDBstub.h" will exist. Update the gdbcommands and replace the obsolete ESPRESSIF readme with @kylefleming's version since we're mainly doing serial, not TCP, connected debugging. Bump the library rev. number since this is a pretty big functionality change. Minor documentation tweak.
1 parent bb37b27 commit 0e2adcb

File tree

9 files changed

+59
-97
lines changed

9 files changed

+59
-97
lines changed

doc/gdb.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ Now, connect to the running ESP8266:
257257
258258
Don't worry that GDB doesn't know what is at our present address, we broke
259259
into the code at a random spot and we could be in an interrupt, in the
260-
ROM, or elsewhere. The important bit is that we're not connected and
260+
ROM, or elsewhere. The important bit is that we're now connected and
261261
two things will now happen: we can debug, and the app's regular serial
262-
output will be displayed.
262+
output will be displayed on the GDB console..
263263

264264
Continue the running app to see the serial output:
265265

File renamed without changes.

libraries/GDBStub/README.rst

Lines changed: 0 additions & 49 deletions
This file was deleted.

libraries/GDBStub/gdbcmds

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# ESP8266 HW limits the number of breakpoints/watchpoints
12
set remote hardware-breakpoint-limit 1
23
set remote hardware-watchpoint-limit 1
3-
target remote :9980
4+
# Some GDBstub settings
5+
set remote interrupt-on-connect on
6+
set remote kill-packet off
7+
set remote symbol-lookup-packet off
8+
set remote verbose-resume-packet off
9+
# The memory map, so GDB knows where it can install SW breakpoints
10+
mem 0x20000000 0x3fefffff ro cache
11+
mem 0x3ff00000 0x3fffffff rw
12+
mem 0x40000000 0x400fffff ro cache
13+
mem 0x40100000 0x4013ffff rw cache
14+
mem 0x40140000 0x5fffffff ro cache
15+
mem 0x60000000 0x60001fff rw
16+
# Change the following to your sketch's ELF file
17+
file /path/to/sketch.ino.elf
18+
# Change the following to your serial port and baud
19+
set serial baud 115200
20+
target remote /dev/ttyUSB0

libraries/GDBStub/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "GDBStub",
3-
"version": "0.2",
3+
"version": "0.3",
44
"keywords": "gdb, debug",
55
"description": "GDB server stub helps debug crashes when JTAG isn't an option.",
66
"repository":

libraries/GDBStub/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=GDBStub
2-
version=0.2
2+
version=0.3
33
author=Jeroen Domburg
44
maintainer=Ivan Grokhotkov <[email protected]>
55
sentence=GDB server stub by Espressif

libraries/GDBStub/src/GDBStub.h

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,40 @@
11
#ifndef GDBSTUB_H
22
#define GDBSTUB_H
33

4-
extern "C" void gdbstub_init();
4+
#include <stdbool.h>
5+
#include <stdint.h>
6+
#include <stddef.h>
57

6-
#endif //GDBSTUB_H
8+
#include "internal/gdbstub-cfg.h"
9+
10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
14+
void gdbstub_init();
15+
16+
//Indicates whether gdbstub will attach to these or not
17+
//Useful for other uart libs to avoid conflicts
18+
bool gdbstub_has_putc1_control();
19+
bool gdbstub_has_uart_isr_control();
20+
21+
#if GDBSTUB_REDIRECT_CONSOLE_OUTPUT
22+
void gdbstub_set_putc1_callback(void (*callback)(char));
23+
#endif
24+
25+
void gdbstub_write_char(char c);
26+
void gdbstub_write(const char* buf, size_t size);
27+
28+
#if GDBSTUB_CTRLC_BREAK && !GDBSTUB_FREERTOS
29+
void gdbstub_set_uart_isr_callback(void (*callback)(void*, uint8_t), void* arg);
30+
31+
//Override points for enabling tx and rx pins for uart0
32+
void gdbstub_hook_enable_tx_pin_uart0(uint8_t pin);
33+
void gdbstub_hook_enable_rx_pin_uart0(uint8_t pin);
34+
#endif
35+
36+
#ifdef __cplusplus
37+
}
38+
#endif
39+
40+
#endif

libraries/GDBStub/src/internal/gdbstub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* License: ESPRESSIF MIT License
88
*******************************************************************************/
99

10-
#include "gdbstub.h"
10+
#include <GDBStub.h>
1111
#include <stddef.h>
1212
#include "ets_sys.h"
1313
#include "eagle_soc.h"

libraries/GDBStub/src/internal/gdbstub.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)