[antlr-interest] AntlrWorks, remote debugging w/ C target fails

Mark Ruvald wabsie at gmail.com
Mon Mar 1 05:08:02 PST 2010


Hello,

A) From what I can read online, remote debugging in AntlrWorks should work
OK with other target languages (like C) - right?
B) ... then howcome this doesn't work:

1) I download examples-v3.tar.gz, expand it and go to (for instance)
C/dynamic-scope.
2) Run antlr: java org.antlr.Tool -debug T.g
3) Compile: gcc -o T TLexer.c TParser.c main.c -I. -L/usr/local/lib
-lantlr3c
4) and run: strace ./T
Of course strace doesn't chang anything, and I can see T executable listens
correctly at port 49100.

5) I open up AntlrWorks, open the T.g grammar file.
6) I select the "program" rule (ie. the root rule).
7) Execute: Run -> Debug remote, connect at localhost:49100.
(T executable accepts connection OK)

8) The very first time I single step, ./T ends with strace printing:
[.. Omitting ..]
send(4, "enterRule T.g program\n", 22, 0) = 22
recv(4, "a", 1, 0)                      = 1
recv(4, "c", 1, 0)                      = 1
recv(4, "k", 1, 0)                      = 1
recv(4, "\n", 1, 0)                     = 1
send(4, "terminate\n", 10, 0)           = 10
munmap(0xb7767000, 151552)              = 0
exit_group(0)                           = ?

9) Naturally nothing gets printed in the parse tree in AntlrWorks.???


I have tried with Java/dynamic-scope - everything works there.
What am I doing wrong?

best regards
-- Mark Ruvald.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


More information about the antlr-interest mailing list