Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Breakpoint 1 at 0x4005d0: file main.c, line 13.
- Function "exit" not defined.
- Make breakpoint pending on future shared library load? (y or [n]) Breakpoint 2 (exit) pending.
- (gdb) echo: I typed y
- Starting program: /home/ivuser/Desktop/Learning/GDB_testing/StackErrorTesting/main
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- 14 long array[size]; /* part of the error: given an element size that's smaller than sizeof array*/
- 15 int i = 0;
- 17 srand(time(NULL)); /* seeds the rand() fnc */
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 23 array[i] = rand();
- 22 for(i=0;i < rand() % (sizeof array)/*/(sizeof array[0])*/ /* error: this is num bytes not num elements */; i++){
- 28 sort(array,size);
- 30 return 0;
- 31 }
- 0x00000000004006b8 31 }
- 0x00000000004006b9 31 }
- 0x00000000004006bb 31 }
- 0x00000000004006bd 31 }
- 0x00000000004006be 31 }
- __libc_start_main (main=0x4005bd <main>, argc=1, argv=0x7fffffffe338, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe328) at libc-start.c:321
- 321 libc-start.c: No such file or directory.
- 0x00007ffff7a32f47 321 in libc-start.c
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Kill the program being debugged? (y or n)
- Using echo again: I stepped thru my C file with next, waited until the return then used si (step by one instruction)
- until I reached a point where gdb placed a breakpoint (b 2)
- I then killed the program.
- Now I am creating the two commands, which won't output in the log file. This is what I typed:
- command 1
- Type commands for breakpoint(s) 1, one per line.
- End with a line saying just "end".
- >record
- >continue
- >end
- command 2
- Type commands for breakpoint(s) 2, one per line.
- End with a line saying just "end".
- >run
- >end
- echo: Here I will hit run and the loop should be going until the error shows up.. then I should theoretically be able to reverse step thru the recording but I cannot.
- Starting program: /home/ivuser/Desktop/Learning/GDB_testing/StackErrorTesting/main
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Breakpoint 2, __GI_exit (status=0) at exit.c:104
- 104 exit.c: No such file or directory.
- Breakpoint 1, main () at main.c:13
- 13 uint8_t size = 32;
- Process record: failed to record execution log.
- [process 23854] #1 stopped.
- 0x0000000029f12d3f in ?? ()
- echo: See the recording error? This means when I set a watchpoint on my stack pointer addres and reverse continue, it just goes to my breakpoint 1 (at main).
- Wherever the stack pointer changes to an invalid address, it is beyond the scope of my 'execution log'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement