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

Invalid escape sequence #3

Open
gil-n opened this issue Jan 12, 2017 · 2 comments
Open

Invalid escape sequence #3

gil-n opened this issue Jan 12, 2017 · 2 comments

Comments

@gil-n
Copy link

gil-n commented Jan 12, 2017

hi,

I'm getting an MI parse error: message:"Invalid escape sequence" when calling: evalExpression("(ptr->data)" )

GDB return the following string: "17^done,value="0x5d2310 '\253' <repeats 16 times>"
The problem is that string contains invalid js escape sequence with \253 which causing the MI parser to fail.

A possible fix: modify GDB.prototype._line_output_handler function by adding:
line = line.replace('\'', '\\')

Thanks,
Gil

@gsmcmullin
Copy link
Owner

Hi Gil

What version of GDB are you testing with? GDB should send out escaped strings.
This is what I get here:

5-data-evaluate-expression --thread 1 --frame 0 teststr
5^done,value="0x400574 '\\253' <repeats 16 times>"
(gdb) 

@gil-n
Copy link
Author

gil-n commented Jan 16, 2017

I'm using: GNU gdb (GDB) 7.10.1
This is the line value: 36^done,value="0x7a22d0 '\253' <repeats 16 times>"

The code runs on windows, i can also test on linux and let you know.
Now i use the code: line = line.replace(/\\(\d)/, '\\\\$1')

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

2 participants