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

Jim Idle jimi at temporal-wave.com
Mon Mar 1 10:05:34 PST 2010


I think that the C debugging is out of sync and I need to get it back in to sync. To be honest I find that the C debugger gives me more information, though it isn't as convenient of course.

jim

-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Mark Ruvald
Sent: Monday, March 01, 2010 5:08 AM
To: antlr-interest at antlr.org
Subject: [antlr-interest] AntlrWorks, remote debugging w/ C target fails

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?

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address





More information about the antlr-interest mailing list