Questions tagged [gdb]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
712 views

How to view global variable state in GDB?

I'm only seeing local variables and their corresponding values in the GDB. Is there any way I can see the global variables as well?
1
vote
1answer
1k views

How can I debug in Python?

I am trying to use gdb on a program in python, but it doesn't seem to work the same way it does with programs in c. I tried looking at a few links here: https://sourceware.org/gdb/onlinedocs/gdb/...
0
votes
1answer
33 views

Pset6: Having Issues Running Server.C

I'm trying to debug server.c with gdb, but I can't figure out how to run server.c. The program compiles correctly, but when I use gdb ./server and then run public, server.c runs into an infinite loop....
0
votes
1answer
2k views

GDB “No such file or directory” error

I'm trying to run the version of GDB that has the nice user interface (NOT the command-line version of GDB) in the CS50 IDE. I have used this version in the past, but suddenly it's not working for me....
0
votes
1answer
63 views

GDB Breakpoints COnfusion in CS50 IDE

I am trying to make a breakpoint at line 33. WHen I run, the code runs through past line 33, however. Thanks,
0
votes
1answer
55 views

Pset6 - Error With Using GDB

I have been trying to use GDB to find errors in my code. I went through the steps @MARS gave me as an answer to one of my questions. However, when I tried to list the values of my variables by using ...
0
votes
1answer
36 views

Pset6 - Help testing in gdb

In pset6, the material says that you can check your code after attempting the functions lookup and parse using "check50 2015.fall.pset6.server1 server.c", which I have done and get back several errors....
1
vote
1answer
64 views

Pset3 Move GDB Problem

I am stuck on the move part of fifteen and trying to learn how to use GDB. My thought process for moving is to search for the "tile" and if the tile is adjacent to the "_" then switch. during GDB, i ...
0
votes
1answer
8k views

How do you pass arguments into GDB argv[1] argv[2]?

I need some clarifications on how GDB works in the IDE environment on cloud9 Is there two things different types of debuggers that the IDE environment? Debugger, through debug command input which ...
0
votes
1answer
167 views

Pset6: How to debug load() and indexes()?

Every time comes the debugging part with the GDB, I feel quite lost. To a novice like me, GDB is not so handy compared with debuggers in IDEs of other languages and the graphic debugger is not working....
0
votes
2answers
58 views

how to pass command line arguements in gdb

I am doing pset 4 whodunnit project. I just can't get the cs50 debugger to run and after reading other posts have given up on it and switched to the gdb debugger but I can't work out how to pass ...
1
vote
1answer
61 views

Using gdb for load function in speller

I am trying to figure out if all my words of the dictionary are uploaded in my declared node* hashtable[100]but when I am using gdb its just giving me the hexadecimal address of the nodes, be it a ...
0
votes
1answer
83 views

Where to link libraries to the debugger in ide.cs50.io?

I need to debug a program that uses the crypt library, so I have to use -lcrypt, but the debugger automatically uses make, and I don't know how to tell him to use clang with arguments. So here I ...
0
votes
1answer
245 views

pset 6 pointer contains incomplete sequence

When I click on cat.jpg I get the correct image and my server returns "HTTP/1.1 200 OK" Check50 gives me an error, though. When I step through the program in gdb and print *content just before ...
0
votes
1answer
110 views

pset6 parse: char* pointers are right in parse but return wrong value

I am having trouble with this pset and I am using gdb to step through the function. Should I worry about the following observations or should I ignore them and assume my problems are from something ...
0
votes
0answers
247 views

gdb server issues, unable to run GDB

I'm unable to run gdb. After break main and after i type run, i get the below error and nothing happens. Error: Error disabling address space randomization: Operation not permitted I tried running ...
0
votes
1answer
79 views

How to pipe PRNg into find.c debug GUI?

I searched through both GBD shorts, but couldn't figure out how the pseude-random numbers can be accessed from within, or piped into, the graphical debugger!? If it`s simply not possible, please let ...
1
vote
2answers
113 views

How to use GDB at not main program?

As title. I know we can use gdb to execute file. But how to use GDB if the program have multiple .c files?
0
votes
1answer
145 views

pset4 resize segmentation fault

my resize compiles, but gives a segmentation fault immediately when run. I've worked on updating the file headers, I have yet to proceed to writing the bytes for the pixels. When running GDB line by ...
0
votes
1answer
573 views

Debugging a program using command line arguments

When I start debugging a program it automatically runs it without any command line arguments. How am I supposed to run it if I want to use some command line arguments?
0
votes
1answer
85 views

pset5 Load has garbage values in GDB

Code for load is below. When I go to GDB and print new->word a couple steps after the while statement (with the fscanf), it gives the following: "\000\000\000\000\203\212\343\267\003\000\000\000\204\...
1
vote
1answer
214 views

pset5 load function segfault do not show in gdb

I cannot figure what's wrong with the code, it gives me a segfault, but runs in valgrind and in gdb. So far, i only wrote the load function, so anything else is still empty. #include <stdbool....
1
vote
1answer
328 views

PSET5 - Issues with initialization of pointers in LOAD function

I'm still trying to debug my load function, I rewrite my code again and again but with no result... I know we need to have specific question, but now I just have so many questions. So, I'll go with ...
0
votes
1answer
201 views

PSET5 - CHECK returning… nothing?

I have one more questions about SPELLER. I've completed all my codes for load, check, size and unload. I'm now trying to debug all of them. It appears I have an error with my check function, which one ...
0
votes
1answer
364 views

Segmentation fault when using GDB to debug breakout

When I run GDB on pset3 breakout, this is what I get. How can I tell what is causing the segmentation fault & where it is? If I enter list, i get 1 dl-debug.c: No such file or directory
2
votes
1answer
387 views

killing all inferior GDB Get's stuck

I've been trying to figure out the in and out of copy.c and looking at the program through GDB. However, even though I want to perhaps see all (or most) of the step till the end the GDB keeps on ...
1
vote
1answer
130 views

Check function skipping the check and returning all words as misspelled

Hello my check function keeps returning false for all of the words. I ran it through gdb: Some prints i did in gdb print thisNode (node *) 0x804c170 print thisNode->word $2 = "elephant\n", '\000' ...
0
votes
1answer
44 views

Segmentation fault in check functon

I am getting a segmentation fault in a while loop for my check function. I don't know why it is happening and need some help understanding my error. This is my function: bool check(const char* word) ...
0
votes
1answer
667 views

gdb piping not working

when I am trying to debug the pset3 binary search, I want to use generate to have large numbers to test because my program works fine when I manually enter the values, but only for large values (i.e. ...
1
vote
2answers
5k views

GDB: run a for loop x number of times

I'm running a program in gdb and I have a for loop that I want to run 32,000 times within that program. I don't want to finish the loop which would run a complete 159,000 times. There's a specific ...
0
votes
1answer
292 views

Determining location of file pointer in ascending bytes with GDB

I tried to print the location of the file pointer in GDB: Unfortunately this was so information intensive it was useless. I stumbled across ftell and hard coded it into my program: and it was much ...
0
votes
2answers
9k views

pset 3 GDB: “no executable file specified”

I've been working my way through CS50 and I'm having a problem I hope someone can help me with. I can't get GDB to function at all, and I think it might be a problem with startup - when I type "gdb" ...
0
votes
3answers
34 views

Location of pointer as opposed to location pointed to?

I'm taking CS50 via edx. One of the videos dealing with pointers (can't find it now) runs a program called noswap (under GDB) that highlights how C uses copies of variables (in this case, int a and ...
0
votes
2answers
590 views

Variable optimized out eventhough it will be used later

When trying to debug my implementation of server.c, asking gdb to print out the variable line results in a <optimized out>. (gdb) p line (gdb) <optimized out> After doing a bit of ...
1
vote
2answers
3k views

How to jump to a specific line in gdb

How to jump to a specific line in gdb? use the command jump?
0
votes
1answer
85 views

<value optimized> GDB self optimizing everything

I am currently doing sort in pset3, when I make and then run gdb on find to sort and see the sorted haystack then every time I print out the value of haystack, gdb spits value optimized out. I have -...
0
votes
1answer
960 views

Why won't GDB work with my breakout draft?

My breakout program runs (sort of) with a few bugs. When I try to use gdb to help fix them, I get this: (gdb) break main Breakpoint 1 at 0x804a0e3 (gdb) run Starting program: /home/jharvard/Dropbox/...
1
vote
1answer
234 views

Debugging sort code

I've been trying to write code for the sort function. It's not working properly and going through gdb isn't helping. When trying to sort 5 numbers, it seemed to go fine in gdb, but still printed out ...
0
votes
1answer
254 views

pset6 load seg faulting when accessing malloc'd node

I need some guidance on where I'm going wrong here. GDB runs fine until I try to access the "next" property of a node to see if it's NULL. Am I just confusing how the node structure works? My ...
1
vote
1answer
444 views

fifteen.c : printf() not printing anything to the screen

To check the execution sequence of the code, I have added printf statement just below the main(): int main(int argc, string argv[]) { // greet player printf("abc \n"); greet(); ...
8
votes
1answer
4k views

How to Check Sort Function with GDB

I've implemented my sort function in helpers.c and I have no clue as to how to check if it does actually sort. I've tried to call on the printf function so it can print out the sorted array, but find....
-1
votes
1answer
141 views

Importance of Debuggers

I came across a strange statement at quora, where someone wrote If available, learn to use its debugger. Although it is a good thing to learn how to debug without the integrated debugger, through ...
8
votes
1answer
3k views

Surprise with GDB way of reading bfType BMP headers

Why if i check with the xxd an image eg. small.bmp the bfType is 0x424d and when you run copy in GDB the value of bf.bfType is 19778 and the program "copy" in line 55 check with 0x4d42. Is it reading ...
1
vote
1answer
251 views

Why doesn't GDB work?

I'm trying to use GDB for the first time but I doesn't even start running. When I try to run GDB ./fifteen I just get bash: GDB: command not found I have tried updating the appliance and it still ...
0
votes
2answers
119 views

GDB stops at GetInt()

I tried using GDB for my Game of Fifteen but I can't get to the part of functions move and won because GDB stops when command line asks for tile to move. This has something to do with GetInt. GDB ...
0
votes
3answers
122 views

How Do We Download the Resources for Section 3?

I saw in the section 3 that for the regular cs50 class they had emailed the gdb file to them . I am taking the edx version so where do i download gdb from?