Skip to main content
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
1 vote

How to view global variable state in GDB?

Type the variable name in the Watch Expressions section at the top.
MARS's user avatar
  • 5,169
1 vote
Accepted

GDB "No such file or directory" error

What does it say in the new terminal window after "Runner:"? I suspect it says "Shell Command" or "Auto". A ".c" file cannot run in the shell. Has it been a while since you tried this? There used to ...
DinoCoderSaurus's user avatar
1 vote
Accepted

Pset6 - Error With Using GDB

We have a serious problem at the very beginning. char* method_str = ""; I guess you want to write a blank, so write it for real. The lack of white space can cause segfault, or a strange behavior of ...
MARS's user avatar
  • 5,169
1 vote
Accepted

Pset6 - Help testing in gdb

Nevermind. I figured it out by rereading the course material and an answer to a previous question. Here is how: 1) type "gdb ./server" in your terminal window. 2) type "break parse" a the (gdb) ...
Flesheaters's user avatar
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.7k
1 vote

how to pass command line arguements in gdb

I couldn't get the hang of the ide50 debugger either. Launch gdb like: gdb whodunit Then to run: r file1.bmp file2.bmp In case you have more gdb related questions in the future, I use this site, ...
Sally Milson's user avatar
1 vote
Accepted

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

Notice the difference between the declaration of abs_path/query in main char abs_path[LimitRequestLine + 1]; char query[LimitRequestLine + 1]; vs. the declaration in parse. bool parse(const char* ...
DinoCoderSaurus's user avatar
1 vote
Accepted

How to pipe PRNg into find.c debug GUI?

I don't think anyone has figured that one out. It may not be possible, but I would be happy for someone to prove me wrong. OTOH, why do you want to work with so much input data in the debugger? ...
Cliff B's user avatar
  • 69k
1 vote

How to use GDB at not main program?

For my example, "mainP.c" will be our main program, and "secondP.c" will be your secondary file. I am assuming your "mainP" calls "secondP" at some time during the execution of the program. This is ...
Useful_Investigator's user avatar
1 vote

killing all inferior GDB Get's stuck

If you have been using breakpoints, and you don't want to continue using the same breakpoint use the command delete and all of your breakpoints will be deleted. If you only want to delete 1 breakpoint,...
Jon's user avatar
  • 23
1 vote

GDB: run a for loop x number of times

You can also use continue <n> to break only the Nth time the current breakpoint is hit, see also: https://stackoverflow.com/questions/2956889/how-to-make-a-gdb-breakpoint-only-break-after-the-...
Ciro Santilli OurBigBook.com's user avatar

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