News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Debug U-boot support?

Started by jinxin16897123, November 06, 2013, 03:22:32 AM

Previous topic - Next topic

jinxin16897123

Currently ,  to debug a target , the prerequisite is build, is there gona to support debug only project? ie. u-boot; I'll be appreciate if you could add  a feature : the source file was located in /home/Tom/project/u-boot.201301 in computer A, this location was mapped to another computer B at z:/u-boot.201301, I'm gona debug it at computer B, it was built in computer A, could you open z:/u-boot.201301/file1.c instead of /home/Tom/project/u-boot.201301/file1.c while debugging?
Thank you very much.

oBFusCATed

Answers:
1. There is an option to prevent auto building: Settings -> Debugger ->  Common -> Auto build project if it is not up to date.
2. Probably you can try to set the directory in the initial commands, using the "set directory" gdb command, but I'm not sure it will work.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

ollydbg

Quote from: oBFusCATed on November 06, 2013, 08:21:45 AM
Answers:
1. There is an option to prevent auto building: Settings -> Debugger ->  Common -> Auto build project if it is not up to date.
This is the way I debug GDB under C::B. (I build GDB under MSYS shell).
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

osdt

#3
Quote from: jinxin16897123 on November 06, 2013, 03:22:32 AM
... I'll be appreciate if you could add  a feature : the source file was located in /home/Tom/project/u-boot.201301 in computer A, this location was mapped to another computer B at z:/u-boot.201301, I'm gona debug it at computer B, it was built in computer A, could you open z:/u-boot.201301/file1.c instead of /home/Tom/project/u-boot.201301/file1.c while debugging?

C::B uses full file paths on compile by default and they are embedded in the debugee. To use relative file paths goto (global) 'Settings->Compiler->Other settings->Advanced options...->Others' and uncheck 'Use full paths for source files'. Rebuild the project and you're done.

- osdt

jinxin16897123

QuoteC::B uses full file paths on compile by default and they are embedded in the debugee. To use relative file paths goto (global) 'Settings->Compiler->Other settings->Advanced options...->Others' and uncheck 'Use full paths for source files'. Rebuild the project and you're done.
U-boot is build by using make command, not using codeblocks.
I just want to use codeblocks for debug ,not compile.

jinxin16897123

#5
Quote1. There is an option to prevent auto building: Settings -> Debugger ->  Common -> Auto build project if it is not up to date.
This seems to solve the 1st question. thanks.
I'm trying the 2rd problem.

jinxin16897123

I've tried , It couldn't open any source file.

Would you like to add feature which debug u-boot ?
thanks.

ollydbg

Quotecould you open z:/u-boot.201301/file1.c instead of /home/Tom/project/u-boot.201301/file1.c while debugging
When you build the file under /home/Tom/project/u-boot.201301/file1.c, let the compiler build with  relative path, e.g.
gcc file1.c
Now, when debugging your target on another computer, run the gdb command like:

directory z:/u-boot.201301

This will let the GDB to search a file named "file1.1" on the folder "z:/u-boot.201301".

I think you should make a simple example on the command line firstly, if it works, then you can switch to using C::B instead, that will not be hard.

EDIT: do you use the same GDB? Can you debug the target in either computer A or computer B?


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

jinxin16897123

Thanks. I've add an option to arm-none-eabi-gcc :
-fdebug-prefix-map=/home/Tom/project=Z:

this options seems good.

Thank you very much.