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

How can I debug the program using GDB? #59

Open
yichuan66 opened this issue May 19, 2019 · 1 comment
Open

How can I debug the program using GDB? #59

yichuan66 opened this issue May 19, 2019 · 1 comment

Comments

@yichuan66
Copy link

I tried to debug the program using GDB and VS Code, but since the code uses escape sequences on Terminal for display, it can interfere with GDB output. For example, when a program calls write(1, "\x1b[6n" , 4) GDB will just hang there and not continue. How can I debug in this case? Thanks!

@EyLinGer
Copy link

  1. You should compile the 'kilo.c' file with -g option if you are using gcc compiler.
  2. Type command gdb kilo
  3. (gdb)set args <filename>
  4. (gdb)run
  5. Kill process which named 'kilo' by your task manager or by typing command in your terminal.
  6. Now you can do things like print E to see the data in it.

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