2

When I debug with GDB a Linux process I put a breakpoint in function

b 0xabcd

This function got an register r1 as argument and in the end of function it will store a value that I want to print

What is the right way to save the address of that register and print it on the end of function?

Polo1990
  • 89
  • 3

1 Answers1

0

What is the right way to save the address of that register

Registers don't have an address (they aren't in memory, that's what makes them registers to begin with), so you can't.

and print it on the end of function?

See this answer on how to print the result of function execution. You would need to modify the example a bit from x86_64 to arm.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362