Skip to content

Commit 9da3c3e

Browse files
committed
Fix @bdjett's issue debugging apps without all sections.
1 parent de33957 commit 9da3c3e

File tree

1 file changed

+7
-1
lines changed
  • pebble_tool/commands/sdk/project

1 file changed

+7
-1
lines changed

pebble_tool/commands/sdk/project/debug.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import absolute_import, print_function, division
22
__author__ = 'katharine'
33

4+
from six import iteritems
5+
46
import os
57
import signal
68
import subprocess
@@ -65,11 +67,15 @@ def __call__(self, args):
6567

6668
offsets = self._find_real_app_section_offsets(base_address, app_elf_path)
6769

70+
add_symbol_file = 'add-symbol-file "{elf}" {text} '.format(elf=app_elf_path, **offsets)
71+
del offsets['text']
72+
add_symbol_file += ''.join('-s .{} {}'.format(k, v) for k, v in iteritems(offsets))
73+
6874
gdb_commands = [
6975
"set charset US-ASCII", # Avoid a bug in the ancient version of libiconv apple ships.
7076
"target remote :{}".format(gdb_port),
7177
"set confirm off",
72-
'add-symbol-file "{elf}" {text} -s .data {data} -s .bss {bss}'.format(elf=app_elf_path, **offsets),
78+
add_symbol_file,
7379
"set confirm on",
7480
"break app_crashed", # app crashes (as of FW 3.10) go through this symbol for our convenience.
7581
'echo \nPress ctrl-D or type \'quit\' to exit.\n',

0 commit comments

Comments
 (0)