Author Topic: Debug U-boot support?  (Read 16514 times)

Offline jinxin16897123

  • Multiple posting newcomer
  • *
  • Posts: 12
Debug U-boot support?
« on: November 06, 2013, 03:22:32 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debug U-boot support?
« Reply #1 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.
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!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6036
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debug U-boot support?
« Reply #2 on: November 06, 2013, 09:34:00 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.

Offline osdt

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Debug U-boot support?
« Reply #3 on: November 06, 2013, 02:46:30 pm »
... 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
« Last Edit: November 06, 2013, 03:14:05 pm by osdt »

Offline jinxin16897123

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Debug U-boot support?
« Reply #4 on: November 07, 2013, 04:20:41 am »
Quote
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.
U-boot is build by using make command, not using codeblocks.
I just want to use codeblocks for debug ,not compile.

Offline jinxin16897123

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Debug U-boot support?
« Reply #5 on: November 07, 2013, 04:21:42 am »
Quote
1. 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.
« Last Edit: November 07, 2013, 07:23:44 am by jinxin16897123 »

Offline jinxin16897123

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Debug U-boot support?
« Reply #6 on: November 08, 2013, 03:19:14 am »
I've tried , It couldn't open any source file.

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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6036
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debug U-boot support?
« Reply #7 on: November 08, 2013, 03:33:40 am »
Quote
could 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.
Code
gcc file1.c
Now, when debugging your target on another computer, run the gdb command like:
Code
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.

Offline jinxin16897123

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Debug U-boot support?
« Reply #8 on: November 09, 2013, 07:44:55 am »
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.