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

A syntax error #27

Open
aliounis opened this issue Jul 8, 2014 · 3 comments
Open

A syntax error #27

aliounis opened this issue Jul 8, 2014 · 3 comments

Comments

@aliounis
Copy link

aliounis commented Jul 8, 2014

Hello,

I am not sure if this is the proper place to post this but I will give it a show. I am trying to use this gdbinit file while debugging some fortran code compiled by gfortran. I have noticed that I receive an error for just about everything when using this file though. For instance, when there is a breakpoint or an error in the execution of the file being debugged I get the following error:

A syntax error in expression, near `= 1'.

After messing around it seems that the issue is in the comparisons within hook-stop and within context. As I commented out the if comparisons I was able to push the error from one if to the next (ie it went from "A syntax error in expression, near = 1'." to "A syntax error in expression, near> 0'." which is the next if statement;

Any clues as to why this is happening. I have checked that all of the variables are still active by calling printf "%i \n", $SHOW_CONTEXT and so on from within gdb and they are.

I am using gdb 7.7.1 on Mac OSX 10.9.3

Thanks for your help!

I will also paste this question to stack overflow

@gdbinit
Copy link
Owner

gdbinit commented Jul 9, 2014

Hi,

I have no idea about the impact of this into debugging fortran. Are you debugging assembly code or fortran code? This gdbinit is for assembly code.
Debugging gdb scripts is essentially a matter of disabling stuff and find out where it errors. It's royal pain but I don't know any other method for it.

@aliounis
Copy link
Author

Hey, thanks for the response.

I was debugging fortran and perhaps this was part of the issue; however, I did as you said and the exact issue I am having is coming from the comparisons for the if statements. If I comment out the if statements one at a time the error progresses (ie it goes from saying there is an error with "= 1" to saying there is an error with "> 0".

@mjjq
Copy link

mjjq commented Jan 7, 2025

I know this issue is nearly a decade old, but for anyone else who's encountered this I suspect allounis was using C++ conditional operators (e.g. ==, >, <) instead of Fortran operators (.eq., .gt., .lt.), which is why they were seeing the syntax error.

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