Hot answers tagged

5 votes

Debug button missing and GNU debugger not working

I had the same problem. The only way I've been able to use the graphical interface is to run debug50 ./programname from the terminal. An alternative would be to use gdb from the terminal which there'...
tamj0rd2's user avatar
  • 183
3 votes
Accepted

I don't have the C GDB Debugger runner option. How do I get it?

CS50 has now released debug50 a more stable version than its predecessor. You can also manually use gdb through the command-line with; gdb OBJECT-FILE (where OBJECT-FILE is a vigenere.o, or just ...
kluvin's user avatar
  • 1,223
3 votes
Accepted

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

To run GDB with arguments in the terminal, use the --args parameter. gdb --args name arg1 arg2 arg3 debug50 (the graphical debugger) is just GDB with a GUI. GDB was originally designed to be run ...
kluvin's user avatar
  • 1,223
3 votes
Accepted

Program and debug50 different results

Declaring the array here int matrix[candidate_count]; allocates the memory for it. But it does not initialize the contents. At the end of the for loop, there is a good chance that matrix[m] has not ...
DinoCoderSaurus's user avatar
2 votes

Do YOU know how to find a seg fault?? Advice to new programmers

Reread the post again, he explains why the seg fault happens. A quick google should suffice too.
x code's user avatar
  • 23
1 vote

error use of undeclared identifer 'name' in practice set 1

First, understand that the "string" data type is a custom creation of the CS50 class. It's not a standard C data type. It's just been implemented to make things easier during the first ...
Cliff B's user avatar
  • 68.4k
1 vote

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

Here's what I do. Use debug50 instead of the command line gdb. If you haven't used that before: Run update50 to be sure you are up to date (the IDE is on version 81 at the moment). Then, here's ...
curiouskiwi's user avatar
  • 18.6k
1 vote
Accepted

debug icon not showing on the top of cs50 ide

The old "debug" button has been removed in favor of a more stable version, the now revised debug50 requires you to run debug50 PROGRAMNAME [ARGUMENTS] in the terminal. Here's a link to the post posted ...
kluvin's user avatar
  • 1,223
1 vote

Debugger hangs on "listening on port 15470"

I had the same problem. What seems to be working for me is running debug50 ./programname from the terminal.
tamj0rd2's user avatar
  • 183
1 vote

Debugger hangs on "listening on port 15470"

Google "cs50 gdb youtube" and you will find two helpful videos explaining how to use the debugger from the command line. It's much more reliable, and has the added benefit of being a tool that will ...
hotwebmatter's user avatar
  • 3,050
1 vote

Debug button missing and GNU debugger not working

Google "cs50 gdb youtube" and you will find two helpful videos explaining how to use the debugger from the command line. It's much more reliable, and has the added benefit of being a tool that will ...
hotwebmatter's user avatar
  • 3,050
1 vote
Accepted

Debugging in Problem Set 7: CS50 Finance

I forgot to answer my own question. Using dump() is better than using print statements
David's user avatar
  • 121
1 vote

Do YOU know how to find a seg fault?? Advice to new programmers

A better way to identify the source of segmentation faults is to compile with -g -fsanitize=undefined -fsanitize=address running the program should then point you to the exact line where the ...
Fuelled_By_Coffee's user avatar
1 vote
Accepted

speller- tried using printf to debug -printf not working

This will (hopefully) explain this specific problem in main and perhaps the overriding problem. The output buffer is not "flushed" until a new line (or explicit flush). The answer provided here ...
DinoCoderSaurus's user avatar
1 vote

Need help debugging

Maybe try <vector.h> and <string.h>? Note the missing .h BTW, how is this related to CS50? I don't believe it's teaching c++
Cliff B's user avatar
  • 68.4k
1 vote
Accepted

PSET7 : "application raised an exception (see log for details)" Theres a log?

There are no other logs. If you cannot repro in your app, this will take a little more sleuthing. The trick would be to find the condition(s) that causes check50 to give TypeError. Since this ...
DinoCoderSaurus's user avatar
1 vote
Accepted

CS50 PSET5 Trie Check- Some words register as mispelt

The problem lies in this block of code: if (trav -> children[c - 97] == NULL) { trav -> children[c - 97] = calloc(1, sizeof(node)); } else { ...
Cliff B's user avatar
  • 68.4k
1 vote
Accepted

Puzzled by Pset3 - find less confortable- sorting output

Whenever an unexpected value, particularly 0, suddenly appears in the sorted list and the largest value disappears, look for code that goes beyond the end of the array. This is a somewhat common ...
Cliff B's user avatar
  • 68.4k
1 vote

pset5 - Load - Debug Error - "Process received SIGSEGV: Segmentation fault"

DinoCoderSaurus is right, you should check any file pointer after fopen for being NULL (that's your current segfault, and use fopen (dictionary, "r");, not a hard-coded path). In theory, that's also ...
Blauelf's user avatar
  • 20.9k
1 vote

pset5 - Load - Debug Error - "Process received SIGSEGV: Segmentation fault"

Attention to detail. What happens if "dictionary/large.text" doesn't exist? (and in a standard installation, it doesn't!). Boom, seg fault. Don't forget to test for success. function takes dictionary ...
DinoCoderSaurus's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible