O'Reilly logo

The Art of Debugging with GDB and DDD by Peter Jay Salzman, Norman Matloff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Assembly Language

GDB and DDD can be extremely useful in debugging assembly language code. There are a number of special considerations to keep in mind, which will be described in this section.

Take as an example the code in file testff.s:

 1 # the subroutine findfirst(v,w,b) finds the first instance of a value v 2 # in a block of w consecutive words of memory beginning at b, returning 3 # either the index of the word where v was found (0, 1, 2, ...) or -1 if 4 # v was not found; beginning with _start, we have a short test of the 5 # subroutine 6 7 .data # data segment 8 x: 9 .long 1 10 .long 5 11 .long 3 12 .long 168 13 .long 8888 14 .text # code segment 15 .globl _start # required 16 _start: # required to use this label unless special action taken ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required