-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from kivancsikert/small-fixes
Various small fixes and debugging improvements
- Loading branch information
Showing
13 changed files
with
210 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/.vscode/* | ||
!/.vscode/launch.json | ||
|
||
*.log | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "gdbtarget", | ||
"request": "attach", | ||
"name": "Eclipse CDT GDB Adapter" | ||
}, | ||
{ | ||
"type": "espidf", | ||
"name": "Launch", | ||
"request": "launch" | ||
}, | ||
{ | ||
"name": "Wokwi GDB", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/build/ugly-duckling.elf", | ||
"cwd": "${workspaceFolder}", | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "${command:espIdf.getToolchainGdb}", | ||
"miDebuggerServerAddress": "localhost:3333" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import re | ||
import subprocess | ||
import sys | ||
|
||
# Define regex patterns for the two formats | ||
PATTERN1 = r"caller ((?:0x[0-9a-fA-F]+:)+0x[0-9a-fA-F]+)" | ||
PATTERN2 = r"Backtrace: ((?:0x[0-9a-fA-F]+:[0-9a-fA-F]+ ?)+)" | ||
|
||
def parse_and_run_addr2line(line): | ||
# Print the input line | ||
print(f"Input: {line.strip()}") | ||
|
||
# Check for the first format | ||
match1 = re.search(PATTERN1, line) | ||
if match1: | ||
addresses = match1.group(1).split(":") | ||
process_addresses(addresses) | ||
|
||
# Check for the second format | ||
match2 = re.search(PATTERN2, line) | ||
if match2: | ||
pairs = match2.group(1).split() | ||
addresses = [pair.split(":")[0] for pair in pairs] | ||
process_addresses(addresses) | ||
|
||
def process_addresses(addresses): | ||
# Prepare the addr2line command | ||
cmd = ["xtensa-esp32-elf-addr2line", "-f", "-e", "build/ugly-duckling.elf"] + addresses | ||
try: | ||
# Run the addr2line command | ||
result = subprocess.run(cmd, text=True, capture_output=True) | ||
# Split output into lines | ||
lines = result.stdout.strip().splitlines() | ||
# Process lines in pairs | ||
for i in range(0, len(lines), 2): | ||
function_name = lines[i].strip() if i < len(lines) else "unknown" | ||
source_info = lines[i + 1].strip() if i + 1 < len(lines) else "unknown" | ||
print(f" -- {source_info} -- {function_name}") | ||
except Exception as e: | ||
print(f"Error running addr2line: {e}") | ||
|
||
def main(): | ||
try: | ||
# Read lines from standard input | ||
for line in sys.stdin: | ||
parse_and_run_addr2line(line) | ||
except KeyboardInterrupt: | ||
print("\nTerminated by user.") | ||
except EOFError: | ||
print("\n") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
## IDF Component Manager Manifest File | ||
dependencies: | ||
espressif/arduino-esp32: "^3.1.0-RC1" | ||
espressif/mdns: "^1.4.0" | ||
bblanchon/arduinojson: "^7.2.0" | ||
## Required IDF version | ||
espressif/arduino-esp32: "3.1.0-rc1" | ||
espressif/mdns: "1.4.2" | ||
bblanchon/arduinojson: "7.2.1" | ||
idf: | ||
version: ">=5.3.1,<5.4.0" | ||
# # Put list of dependencies here | ||
# # For components maintained by Espressif: | ||
# component: "~1.0.0" | ||
# # For 3rd party components: | ||
# username/component: ">=1.0.0,<2.0.0" | ||
# username2/component2: | ||
# version: "~1.0.0" | ||
# # For transient dependencies `public` flag can be set. | ||
# # `public` flag doesn't have an effect dependencies of the `main` component. | ||
# # All dependencies of `main` are public by default. | ||
# public: true | ||
version: "5.3.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.