Hi Greg and Michael --

Regarding:

> 3) Chapel symbols generally have _chpl appended to them
>   and will be unique'd within your program. So if you had
>   multiple functions called doit, you might have doit3_chpl e.g..

As of version 1.11, this appending of '_chpl' can be disabled via the 
--no-munge-user-idents flag.  As Michael notes, by default, 'chpl' will 
tack a '_chpl' suffix to user identifiers in order to minimize the chances 
that a Chapel identifier will conflict with a C identifier.  This is why 
Michael's breakpoint is on doit_chpl rather than 'doit' in his example 
below. Throwing this flag will disable this munging at the risk of 
slightly increasing the chances of a conflict.  That said, we protect many 
common causes of conflict even when this flag is thrown, and lived for 
years with minimal conflicts, so for most cases, disabling the munging 
shouldn't cause surprises and should improve debugging slightly.


> I've also (a long time ago) done some work in getting stack
> traces for Chapel programs that abnormally exit. In practice,
> I usually just run the program in gdb and break on
> gdbShouldBreakHere() and then ask gdb for a stack trace..

There's also a --gdb flag on Chapel executables that automatically runs 
the binary in gdb and sets this breakpoint as a convenience.


> 1) I get confused about which flags to the compiler cause
>   it to use C line numbers and which Chapel line numbers.
>   You sometimes have to specify --cpp-lines, which might
>   be confusingly named... (it means to add #line directives
>   to the generated C, not to use C line numbers when debugging).

For end-users, --cpp-lines is designed to happen by default when throwing 
-g, so shouldn't need to be thrown.  The reason Michael gets confused is 
that for developers (those who work with CHPL_DEVELOPER on or the --devel 
flag), we don't throw it by default (under the assumption that this is the 
common case for developers).  So, the command line I tend to recommend is 
more like:

        chpl -g --savec=tmp foo.chpl --no-munge-user-idents


-Brad


------------------------------------------------------------------------------
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to