Author Topic: MSP430 linux toolchain with C::B  (Read 35349 times)

Offline ywi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: MSP430 linux toolchain with C::B
« Reply #15 on: May 14, 2012, 08:21:44 pm »
The latest nightly debugger plugin passes command "run" instead of "continue" when the run/continue button is pressed:

Code
Debugger name and version: GNU gdb (GDB) 7.2

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]No symbol "disassembly" in current context.
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory /projects/test/
[debug]>>>>>>cb_gdb:
[debug]> directory /projects/
[debug]>>>>>>cb_gdb:
[debug]> tty /dev/pts/3
[debug]Queued:[tty /dev/pts/3]
[debug]>>>>>>cb_gdb:

Continuing...

[debug]> run
[debug]Don't know how to run.  Try "help target".
[debug]>>>>>>cb_gdb:

Starting the debuggee failed: Don't know how to run.  Try "help target".

[debug]> quit

Debugger finished with status 0

For burning the flash, gdb send specific commands (erase, load, ...) to the debugger proxy, which is himself connected to a programmer.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MSP430 linux toolchain with C::B
« Reply #16 on: May 14, 2012, 11:08:11 pm »
For the burning: Then you need to put the commands in a file and then use the source command in combination with the 'do not run mode'.

For the run command: I see no remote debugging commands, so I guess you've not set them and you're in native/local debugging mode, thus run is the normal command to use.
(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 ywi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: MSP430 linux toolchain with C::B
« Reply #17 on: May 14, 2012, 11:23:21 pm »
Yes, I already used successfully a file at gdb start to run particular commands. But still sometimes gdb is launched and reprogramming the flash is not necessary. How to distinguish between both? Usually tools working on remote targets have separate buttons for connect to target and burn.

For your second comment, could you give me some details on where to set "native" and "remote" specific mode parameters?

Thx.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MSP430 linux toolchain with C::B
« Reply #18 on: May 15, 2012, 10:09:14 am »
Yes, I already used successfully a file at gdb start to run particular commands. But still sometimes gdb is launched and reprogramming the flash is not necessary. How to distinguish between both? Usually tools working on remote targets have separate buttons for connect to target and burn.
Do you see the edit box at the bottom of the debugger's log?
There you can enter commands, so if you're in do-not-run mode you can start gdb then if necessary you can execute the source command manually and then you can start debugging.
Isn't this what you want?

For your second comment, could you give me some details on where to set "native" and "remote" specific mode parameters?
I already have shown you - in the project -> properties -> debugger -> remote...
(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 ywi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: MSP430 linux toolchain with C::B
« Reply #19 on: May 15, 2012, 12:15:50 pm »
OK, I have all information on the configuration possibilities of the debugger. It can partially cover remote debugging needs. As I mentioned, sometimes gdb is launched and reprogramming the flash is not necessary, so a separate toolbar button to burn the flash would be a plus.

Could you help me on the registry window problem? Here is the information printed with command "info registers":

Code
pc/r0: a702  sp/r1: 2bb0  sr/r2: 001b     r3: 0000  
fp/r4: ffff     r5: 5a0c     r6: ffb4     r7: ffff 
   r8: ffff     r9: ffff    r10: ffb4    r11: ffff 
  r12: 0001    r13: 0000    r14: 0340    r15: 0000


Thanks.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MSP430 linux toolchain with C::B
« Reply #20 on: May 15, 2012, 12:36:23 pm »
I guess you have to set the proper disassembly flavor.
See here: http://forums.codeblocks.org/index.php/topic,16336.msg110619.html#msg110619
I don't know what is the correct/proper disassembly flavor, read the manual of you gdb about it.

If not you'll have to modify the cpu registers parser and provide a patch.
(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 ywi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: MSP430 linux toolchain with C::B
« Reply #21 on: May 16, 2012, 01:24:10 pm »
OK. Thx for this overview of the debugger configuration possibilities.

Offline ywi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: MSP430 linux toolchain with C::B
« Reply #22 on: May 18, 2012, 05:43:59 pm »
Is there any simple codeblocks plugin example (ideally a toolbar with just one button that when pushed calls a shell command) ? It will be quite easy to build a remote connect and flash burn contrib plugin out of it.

Thanks.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: MSP430 linux toolchain with C::B
« Reply #23 on: May 18, 2012, 06:38:09 pm »
(ideally a toolbar with just one button that when pushed calls a shell command) ? It will be quite easy to build a remote connect and flash burn contrib plugin out of it.
For such purposes, there is the Tools / Tools+ plugin that can do such quite handy. No need for another plugin.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ywi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: MSP430 linux toolchain with C::B
« Reply #24 on: May 18, 2012, 07:42:30 pm »
Well, that's great, thanks. Would be nice this menu to create its own toolbar.

Offline ywi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: MSP430 linux toolchain with C::B
« Reply #25 on: May 18, 2012, 08:50:05 pm »
I come back to a request for monitoring specific remote registers (not only the remote CPU registers). What I basically need is to be able to load at C::B start a memory map description file of volatile variables that gdb will have to update at each step/bkp. Any suggestions?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: MSP430 linux toolchain with C::B
« Reply #26 on: May 18, 2012, 11:01:01 pm »
I come back to a request for monitoring specific remote registers (not only the remote CPU registers). What I basically need is to be able to load at C::B start a memory map description file of volatile variables that gdb will have to update at each step/bkp. Any suggestions?
Use the debugger initialisation commands and (if needed) the debugger console for that purpose.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ywi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: MSP430 linux toolchain with C::B
« Reply #27 on: May 19, 2012, 07:23:20 pm »
This is not quite convenient. It should behave like a watch, i.e read and display automatically the list of remote registers (addresses). GDB should execute command "x/b <addr>" for every address of the registers address list when a bkp/step is reached.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MSP430 linux toolchain with C::B
« Reply #28 on: May 19, 2012, 07:34:09 pm »
I guess you can use python enabled gdb and use some fancy python scripts...
(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 ywi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: MSP430 linux toolchain with C::B
« Reply #29 on: May 19, 2012, 08:14:29 pm »
That is an interesting option indeed, but maybe too fancy for me for the moment. Is there any possibility to pass commands to the GDB launched by C::B by an external shell command?