Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'corrupt stack?' warning in GDB backtrace #1665

Merged
merged 2 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Sming/Makefile-rboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ RBOOT_E2_SECTS ?= .text .data .rodata
RBOOT_E2_USER_ARGS ?= -quiet -bin -boot2
# GDB path
GDB ?= $(ESP_HOME)/xtensa-lx106-elf/bin/xtensa-lx106-elf-gdb
# File containing boot ROM debug symbols for GDB
BOOTROM_ELF := bootrom.elf

## COM port parameters
# Default COM port speed (generic)
Expand Down Expand Up @@ -540,7 +542,11 @@ endef

.PHONY: all checkdirs spiff_update spiff_clean clean kill_term terminal gdb

all: $(USER_LIBDIR)/lib$(LIBSMING).a checkdirs $(LIBMAIN_DST) $(RBOOT_BIN) $(RBOOT_ROM_0) $(RBOOT_ROM_1) $(SPIFF_BIN_OUT) $(FW_FILE_1) $(FW_FILE_2)
all: $(USER_LIBDIR)/lib$(LIBSMING).a checkdirs $(LIBMAIN_DST) $(RBOOT_BIN) $(RBOOT_ROM_0) $(RBOOT_ROM_1) $(SPIFF_BIN_OUT) $(FW_FILE_1) $(FW_FILE_2) $(BUILD_BASE)/$(BOOTROM_ELF)

# File contains boot rom symbols required by GDB, put it somewhere easy to find
$(BUILD_BASE)/$(BOOTROM_ELF):
cp $(SMING_HOME)/gdb/$(BOOTROM_ELF) $(BUILD_BASE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess bootrom.elf should be included in this PR.


$(RBOOT_BIN):
$(MAKE) -C $(THIRD_PARTY_DIR)/rboot RBOOT_GPIO_ENABLED=$(RBOOT_GPIO_ENABLED) RBOOT_SILENT=$(RBOOT_SILENT)
Expand Down
4 changes: 4 additions & 0 deletions Sming/gdb/gdbcmds
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ mem 0x60000000 0x60001fff rw
# The target object file so GDB knows where to get symbol information
file out/build/app_0.out

# GDB needs to know about ROM functions in order to create a full stack trace
# See https://github.com/jcmvbkbc/esp-elf-rom
add-symbol-file out/build/bootrom.elf 0x40000000 -readnow

# Change the following to your serial port and baud
#set serial baud 115200
#target remote /dev/ttyUSB0
Expand Down