I'm debugging a program right now that has a few files: arr.h is the header file for a list class, which creates an array of linked lists (generated randomly). Howard.cpp is the implementation file, and main.cpp is where I put the main function that calls functions on objects of the list class. it includes list.h. I'm getting a seg fault for one of my functions (implemented within Howard.cpp). I entered GDB. When the seg fault occurs, I know to enter "where" or "list" to get the function calls that led up to the seg fault. In this case, when I get to the function where the seg fault occurred (frame 0), I want to see the variables and what their values are in that function. However, when I try to step into that specific function, or type "info locals," I get the message that there is "No symbol table info available." I know this is not true, but I cannot figure out how to be able to see the line where it failed. Additionally, any line information regarding that function/file will not display. I think it has something to do with the error being in a function in a file that is not the executable one; but what can I do about this? If this question is confusing at all, feel free to ask me for clarification. I'm pretty new at all this.
This is on a linux terminal environment that was created by the professor of my class and meant for practicing linked lists and recursion.
Ok, I'm going to include an example here:
I have a function that recursively copies an array of linked lists in reverse. The recursive function is called table::reverse_table(node *&,node *,node *). I have debugged it to the point where I know that there is no problem with the stopping point. When the program segfaults, I'll enter "where," and it will output:
#0 0x0000000000400e6e in table::reverse_table(node*&, node*, node*) ()
#1 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#2 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#3 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#4 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#5 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#6 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#7 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#8 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#9 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#10 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#11 0x0000000000400df1 in table::reverse_table(node*&, node*, node*) ()
#12 0x0000000000400f87 in table::reverse_table(table&, int, int) ()
#13 0x0000000000400fe7 in table::reverse_table(table&) ()
#14 0x0000000000401087 in main ()
Then, when I type "frame 0," it displays:
#0 0x0000000000400e6e in table::reverse_table(node*&, node*, node*) ()
When I type "info locals," then "No symbol table info available" is displayed. I can't get any information about where in the function the segfault occurred, either; GDB seems to not have that information. Is there something that I need to do to include it while debugging?