How to set the break point using dbx?


 
Thread Tools Search this Thread
Operating Systems AIX How to set the break point using dbx?
# 1  
Old 04-12-2013
How to set the break point using dbx?

Hi,

I am trying to debug my project using dbx to understand the code and functionality of modules.

I compiled all my C files using gcc -g flag to enable the debug option.
I was able to get in to the debug mode using dbx.
I was able to create breakpoints using stop at line no.
"stop at 1117" " stop at main.c:1147" like this..

I was able to see my break points in status output.

What my problem is after running the command using dbx, it is not stopping the execution at break point, it is completing the command execution.

I did read and followed the dbx usage and debug documentation.

Can some one please explain me, how exactly we can debug the binary using breakpoints.
# 2  
Old 04-13-2013
basically, if it did not stop there, it is probably because logic did not go there.

much slower, but you could try single stepping through the program.

p.s. last time i seriously debugged assembly (> 20 years ago) I used adb. So, hopefully, someone with more hands on will assist after me.
# 3  
Old 04-13-2013
I don't use dbx. But I use gdb a lot. It always works for me. I say "break out1.c:10784" which is equivalent to the dbx "stop at" syntax.

You're on the right direction. You're just making some kind of little mistake. Have you made dbx work anywhere? Has dbx ever worked for you? If not, I would suggest compiling a short test program, and making dbx work in that environment first, before you try with the complex program you are studying.
# 4  
Old 04-15-2013
Hi,
Thanks for your quick replies.

I was able to debug the sample program using dbx, but unable to debug when my program depends on other source files [other C program's].

Is there any other option in debugging when we have source file dependencies?
I already compiled all the C files with -g option, do I need to add any other option?

Thanks in advance.
# 5  
Old 04-15-2013
All the dependencies also need to be compiled with -g if you want the same level of support. Otherwise you are highly dependent on the level of information in, I assume, libraries.

If the dependancies are "stripped" you will, probably, see little more than assembly code. If the dependancies are "commericial" you should not need to debug them. Mainly, your focus will be parameter values passed to a routine, changes to these values when passed by reference, and the function return value.
# 6  
Old 04-15-2013
I agree with other response.

Beyond that, not sure what you mean by "other source files". Yes, you want to use -g option on any files you are compiling. Can you compile the "other source files"? If not, maybe they are not really "source files".
# 7  
Old 04-16-2013
Hi Hanson,

Other source files means, I have C files in my project like sample.c, main.c, cli.c .
I compiled all these files with -g option. but, I am unable to debug using breakpoints.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to create a new mount point with 600GB and add 350 GBexisting mount point? IN AIX

How to create a new mount point with 600GB and add 350 GBexisting mount point Best if there step that i can follow or execute before i mount or add diskspace IN AIX Thanks (2 Replies)
Discussion started by: Thilagarajan
2 Replies

2. Shell Programming and Scripting

How to perform a hexdump using dd from start point to end point?

hi, I would like to ask or is it possible to dump a hex using dd from starting point to end point just like the "xxd -s 512 -l 512 <bin file>" I know the redirect hexdump -C but i can't figure it out the combination options of dd. Hope someone can share their knowledge.. Thanks in... (3 Replies)
Discussion started by: jao_madn
3 Replies

3. Shell Programming and Scripting

BASH: Break line, read, break again, read again...

...when the lines use both a colon and commas to separate the parts you want read as information. The first version of this script used cut and other non-Bash-builtins, frequently, which made it nice and zippy with little more than average processor load in GNOME Terminal but, predictably, slow... (2 Replies)
Discussion started by: SilversleevesX
2 Replies

4. UNIX for Dummies Questions & Answers

How can I set DBX to break on an Access Violation?

I'm trying to debug a service crash, and would like to break on an access violation - is this possible? (0 Replies)
Discussion started by: ctote
0 Replies

5. Programming

dbx - break on access violations

Hey everyone, Is there a way to make dbx break on access violations? (2 Replies)
Discussion started by: ctote
2 Replies

6. Programming

dbx - attach to process, break when crash

Hey everyone, I have a process that is crashing, and I'd like to have some way to see where it crashes. Is this possible? (2 Replies)
Discussion started by: ctote
2 Replies

7. Programming

Dbx Debugger

I have tried lots of stuff but i can't get it working, i have also found a Thread in this Forum about it but it didn't describe how the program has to be run ect. My issue is that i want to run a program with multiple arguments eg. ./myprog arg1 arg2 arg3 arg4 arg5 with dbx, but i cant get... (8 Replies)
Discussion started by: alcatros
8 Replies

8. Shell Programming and Scripting

Set start point in script

Does anyone know of a way to set up some sort of marker in a shell script, from which the script can be restarted.. e.g. MARKER1 check env variable MAX_RETRY if var not set then while true do check var if set go to MARKER1 ... (2 Replies)
Discussion started by: handak9
2 Replies

9. UNIX for Advanced & Expert Users

Fibre connection Point to Point SUN

Anyone know of a guide or instructions for Solaris I got to configure a SBUS HBA to talk to a tape robot. I have done this on a switch but not point to point. just going HBA >>>>> TAPE Fibre simple two nodes Kie (6 Replies)
Discussion started by: kie
6 Replies

10. UNIX for Dummies Questions & Answers

Set up apache to point at my homepage

I have just install apache 1.3.22 on my solaris 2.6 with virtualhost which is working fine but I want to configure my httpd.conf file so that when I type in my url on an internet browsers it goes straight to my home page. eg www.mydomain.com should display my home page at the monent when I type... (4 Replies)
Discussion started by: hassan2
4 Replies
Login or Register to Ask a Question