SDCC symbol files in OpenMSX debugger.

By DamnedAngel

Expert (87)

DamnedAngel's picture

26-08-2018, 00:46

Hi all,

I am using SDCC, but I haven't succeded loading symbols (either from .map files and from .sym files) in OpenMSX debugger. Is there an easy way of doing so?

best,

Login or register to post comments

By DamnedAngel

Expert (87)

DamnedAngel's picture

02-11-2018, 13:11

Folks,
answering my own question, to whom it may concern:
I built a python script which builds the symbol file from the map file. It goes like this:

import string
import sys

def is_hex(s):
	try:
		int(s, 16)
		return True
	except ValueError:
		return False

f1 = open(sys.argv[1] + '\\' + sys.argv[2] + '_.sym','w')

with open(sys.argv[1] + '\\' + sys.argv[2] + '.map','r') as f2:
	for line in f2:
		line1 = line.strip()
		words = line1.split()
		if len(words) > 1:
			if is_hex(words[0]):
				f1.write(words[1] + ': equ ' + words[0] + "H\n")

f2.close()
f1.close()

exit()

Be free to use it anyway you please. If you feel generous and compelled enough to share your enhancements, please post below Smile.

By Giangiacomo Zaffini 2

Expert (79)

Giangiacomo Zaffini 2's picture

02-11-2018, 13:44

Ok, I don't even known how to use openMSX debugger in the first plase, but since I use SDCC and openMSX since years, I take note of this and kindly thank You.

By Wolverine_nl

Paladin (992)

Wolverine_nl's picture

02-11-2018, 14:24

thank you for this DamnedAngel Big smile

By DamnedAngel

Expert (87)

DamnedAngel's picture

02-11-2018, 14:52

Giangiacomo Zaffini 2 wrote:

Ok, I don't even known how to use openMSX debugger in the first plase, but since I use SDCC and openMSX since years, I take note of this and kindly thank You.

  1. Run OpenMSX.
  2. Run OpenMSX Debugger.
  3. In OMD:
  4. a) select System|Connect
  5. b) [Optional] System|Symbol Manager|Add (here goe the output of the python script, or any other compatible symbol file)
  6. c) Add breakpoints anywhere you please.
  7. d) Use as any other step-by-step debugger you are used with.

[]s

By DamnedAngel

Expert (87)

DamnedAngel's picture

02-11-2018, 14:53

Wolverine_nl wrote:

thank you for this DamnedAngel Big smile

You are all very welcome.
This is a shy fraction of retribution for all support this community has already given me.

By Manuel

Ascended (14790)

Manuel's picture

03-11-2018, 00:10

If you can make a conversion script, then perhaps you can also make a parser so that the symbol table can load them... see https://github.com/openMSX/debugger/blob/master/src/SymbolTa... - it's probably not that hard.

My MSX profile