How does a debugger like gdb work to set a breakpoint through JTAG?
Asked Answered
G

3

11

i'm working on debugging with gdb. i wanted to know how gdb works internally to set a brekpoint on an embedded processor through JTAG.

Groff answered 1/4, 2012 at 13:38 Comment(1)
possible duplicate of General JTAG working flow in an embedded development system?Collotype
R
6

It either programs a hardware breakpoint register or places a software breakpoint by replacing the instruction at the breakpoint with an instruction that will cause an exception.

Retrieval answered 2/4, 2012 at 9:47 Comment(0)
F
1

It is different for every processor, you have to look up the jtag debugger details for the specific processor. not just processor family necessarily but specific processor. The datasheets/users guides, if available, are normally available from the chip vendor or core vendor depending on the product.

Fijian answered 2/4, 2012 at 2:36 Comment(2)
what i want to know is that after connecting my board to Pc with a jtag cable, if i type for example "bp 25" with GDB , what happens exatly after for that command in order to be executed with my embedded processor (Microblaze) through JTAG ?Groff
you have to look up that processor and the jtag commands, it could be a few to a few thousand different commands that happen to implement that one thing. A dozen different ways processors handle such a command, etc. If you dont want to look up the datasheet then look in the gdb soruces, gdb is open source, the answers to your questions are all right there in open documents and software. Re-build gdb, add some printfs, dig down to the code of interest.Fijian
M
0

The few times I've used GDB in conjunction with a JTAG unit, GDB communicated over the JTAG by using a gdbserver program that handled the details of the JTAG. For example, using an OpenOCD JTAG unit: http://openocd.sourceforge.net/doc/html/GDB-and-OpenOCD.html

This essentially means that GDB doesn't know much of anything about the JTAG unit - it relies on the gdbserver interface and that server then does whatever it needs to behind the scenes to do what GDB requests.

Monogenic answered 2/4, 2012 at 14:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.