wdb debugger


 
Thread Tools Search this Thread
Top Forums Programming wdb debugger
# 1  
Old 12-03-2001
wdb debugger

Hi all,
is it possible to skip a function with the wdb debugger ?
could be helpful instead of compiling the whole bunch again
does someone know how to do this ?

thx

Sven
# 2  
Old 12-03-2001
As I understand it, wdb is just a front-end to gdb. If so, you can "jump" past any function easily. For example, if you are debugging the following code:

Code:
printf("hello, world\n");
this_is_my_function();
printf("goodbye, world\n");

as you are stepping through the code -- lets say you are at line 1 -- you can enter "jump 3" to jump immediately to line 3 thereby skipping line 2 and the function call entirely. If you want to automatically skip a function as the program runs (with no input needed), you might give the following commands to the debugger:

Code:
break this_is_my_function
commands
return
continue
end

That would tell gdb to stop at the specified function, and automatically execute the commands "return" and "continue" which would have the same effect as skipping the function entirely.
# 3  
Old 12-05-2001
Quote:
Originally posted by PxT
As I understand it, wdb is just a front-end to gdb. If so, you can "jump" past any function easily. For example, if you are debugging the following code:

Code:
printf("hello, world\n");
this_is_my_function();
printf("goodbye, world\n");

as you are stepping through the code -- lets say you are at line 1 -- you can enter "jump 3" to jump immediately to line 3 thereby skipping line 2 and the function call entirely. If you want to automatically skip a function as the program runs (with no input needed), you might give the following commands to the debugger:

Code:
break this_is_my_function
commands
return
continue
end

That would tell gdb to stop at the specified function, and automatically execute the commands "return" and "continue" which would have the same effect as skipping the function entirely.

And how do i get the line number ? where im currently at ?
# 4  
Old 12-05-2001
In gdb as you step through the code the line numbers are displayed. You can type "l" or "list" to see a block of code around the current line. You can type "bt" or "backtrace" to see the function stack.
# 5  
Old 12-07-2001
thx helped very much
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. Programming

Alternative debugger to GNU insight debugger

GNU insight debugger is not available now a days and it is required to debug/inspect assembly code as written in the book Assembly Language Programming step by step in Linux so my question is; is there any alternative to insight that I can use instead of insight in which I can get the same... (5 Replies)
Discussion started by: vectrum
5 Replies

2. Programming

How to debug with wdb debugger a cobol program?

Hi Forum, i have such a question. I have a cobol program which is calling a C program and in that C program i get a core dump:(. I want to investigate what is the issue using WDB debuger, but a dont see the code from COBOL program in the debuger, when i run the debugger with the exe!!! ... (2 Replies)
Discussion started by: vovan
2 Replies
Login or Register to Ask a Question