#GDB keeps thinking that x and y remain the same no matter what i do
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
the debugger thinks it's these two values
when i deleted that, like, a long time ago
i changed the variable names, even.
What does that mean? Like using gcc?
I exited gdb and recompiled it, and got the same result
Did you forget to save the file?
I hope you frist removed the exact path you pass to gdb
and yes, save the file
there's usually no magic, if I got a penny each time someone didn't save file or used different path when testing than the target path for building, I would be soooo rich :)
how do you do that?
have legit no idea what you mean
no i did not
is that windows or linux?
if windows, is that mingw or wsl?
are you running gdb yourself from terminal or is it done via some gui?
i'm running it from windows, but running it on a linux machine virtually (through a secure connection)
how many questions have you seen?
(because I see answer missing)
well, either focused and fast and interactive or I won't be able to help you
it's mainly because i don't know the answer to some of your questions, mainly whether its mingw or wsl
i assume wsl is a linux compiler
and mingw is a windows compiler
if this is a virtual machine
it is
the console on my actual computer (not the linux one) or within the virtual machine?
because the answer is within the virtual machine
that's what I would normally guess (even though technicaly it would be possible to do it otherwise)
what exact command do you use to run gdb?
gdb -tui (once i'm within the directory of the c file)
after using gcc of course
gcc -g test.c (what i use to compile)
so how do you then choose executable to debug?
file test
yes, the default name is a.out, so either you debug that, or you wite gcc -g test.c -o test
ah
generally it is convenient to know commands like ls -l or stat to be able to see what's the file date, or even ls -lt to see files sorted by date, and I was going into direction of telling you to remove test like rm test, but as you have shown already you are not recompiling that, that's no longer important
you see, as always, program not recompiled
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity
i'm also literally going to put this in my class notes so i don't forget again (the literal screenshot of this convo)