0

I am trying to learn assembly and I am using Ubuntu, I want to see the value of a label using GDB. Issue is that the label is one byte big and I cant cast it as just "p (byte)'label_name' ". And GDB does not seem to work if i dont tell it what the label size is.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
bb_tson
  • 3
  • 1

1 Answers1

1

p (char)label_name works for me. GDB commands use C type names. (Showing it as a number and the ASCII character it represents for char. C doesn't have a separate type for 8-bit integer).

C doesn't have a type called byte, so (byte)foo is an error.

As Jester says, x /b &label_name might be what you want to eXamine memory, especially if you want to see multiple bytes starting from a certain point.

Within GDB, help x and help p will show details on how to use it.

Related:

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847