C multiline macro confuses parser
Stan Cox <[email protected]> Fri, 7 Oct 2016 09:02:24 -0400
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <[email protected]> |
This is an excerpt from a larger gdb debugger source file. A multiline
C macro condition gets the parser confused. cedet/semantic.el says it
is version 2.2. (My emacs lisp debugging skills are quite rusty.)
Given:
// BEGIN C source
// OK uncomment this singleline version and comment out multiline version
// #if !(defined(PT_TEXT_ADDR) || defined(PT_DATA_ADDR) ||
defined(PT_TEXT_END_ADDR))
// !OK multiline version
#if !(defined(PT_TEXT_ADDR) \
|| defined(PT_DATA_ADDR) \
|| defined(PT_TEXT_END_ADDR))
#if defined(__mcoldfire__)
#define PT_TEXT_ADDR 49*4
#elif defined(BFIN)
#define PT_TEXT_ADDR 220
#elif defined(__TMS320C6X__)
#define PT_TEXT_ADDR (0x10000*4)
#endif
#endif
ptid_t
ptid_of_lwp (struct lwp_info *lwp)
{
return ptid_of (get_lwp_thread (lwp));
}
void
lwp_set_arch_private_info (struct lwp_info *lwp,
struct arch_lwp_info *info)
{
lwp->arch_private = info;
}
// END C source
ESC-X bovinate for the multiline version yields:
(("ptid_of" function
(:prototype-flag t :arguments
(("" variable
(:type
("get_lwp_thread" type
(:type "class")
nil nil))
(reparse-symbol arg-sub-list)
#<overlay from 495 to 515 in linux-low-semantic.c>))
:type "int")
nil #<overlay from 486 to 517 in linux-low-semantic.c>)
("arch_private" variable
(:default-value "info" :type "int")
nil #<overlay from 617 to 637 in linux-low-semantic.c>))
ESC-X bovinate for the singleline version yields:
(("ptid_of_lwp" function
(:arguments
(("lwp" variable
(:pointer 1 :type
("lwp_info" type
(:prototype t :type "struct")
nil nil))
(reparse-symbol arg-sub-list)
#<overlay from 458 to 479 in linux-low-semantic.c>))
:type
("ptid_t" type
(:type "class")
nil nil))
(unlink-hook
(semantic--tag-unlink-secondary-overlays)
secondary-overlays
(#<overlay from 438 to 445 in linux-low-semantic.c>)
link-hook
(semantic--tag-link-secondary-overlays)
unlink-copy-hook
(semantic--tag-unlink-copy-secondary-overlays))
#<overlay from 438 to 524 in linux-low-semantic.c>)
("lwp_set_arch_private_info" function
...
#<overlay from 525 to 644 in linux-low-semantic.c>))
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot