Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiledb incorrectly strip quotes. #71

Open
peter50216 opened this issue Mar 18, 2019 · 2 comments
Open

compiledb incorrectly strip quotes. #71

peter50216 opened this issue Mar 18, 2019 · 2 comments

Comments

@peter50216
Copy link

Version: using master at commit 88ec08e
Found this while trying to build kernel with compiledb.

> cat a.log
gcc -DKBUILD_MODNAME='"swap"' ./swap.c

> compiledb --parse a.log
## Processing build commands from a.log
## Writing compilation database with 1 entries to compile_commands.json
## Done.

> cat compile_commands.json
[
 {
  "directory": "/tmp",
  "arguments": [
   "gcc",
   "-DKBUILD_MODNAME=swap",
   "./swap.c"
  ],
  "file": "./swap.c"
 }
]

The single quotes in the argument disappear.

@phil-blain
Copy link

I noticed the same thing building Git (compiledb make).

@drmikehenry
Copy link

This seems to be an issue with bashlex, e.g.:

In [1]: import bashlex

In [2]: bashlex.parse("""gcc -DVERSION='"1.2.3.4"'""")
Out[2]: [CommandNode(parts=[WordNode(parts=[] pos=(0, 3) word='gcc'), WordNode(parts=[] pos=(4, 25) word='-DVERSION=1.2.3.4')] pos=(0, 25))]

This might be related to idank/bashlex#26 and/or idank/bashlex#56.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants