Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #8397 > unrolled thread
| Started by | Ilias Abrams <iliasabrams@gmail.com> |
|---|---|
| First post | 2018-03-06 08:28 -0800 |
| Last post | 2018-03-06 19:04 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.programming
ARM - Assembly GNU Debugger Output Help Ilias Abrams <iliasabrams@gmail.com> - 2018-03-06 08:28 -0800
Re: ARM - Assembly GNU Debugger Output Help Wouter Verhelst <w@uter.be> - 2018-03-06 19:04 +0100
| From | Ilias Abrams <iliasabrams@gmail.com> |
|---|---|
| Date | 2018-03-06 08:28 -0800 |
| Subject | ARM - Assembly GNU Debugger Output Help |
| Message-ID | <1bb30a5f-1614-41a6-891b-67b42e00c16e@googlegroups.com> |
Hi guys, I was wondering, I am running a simple Assembly example with GNU Debugger (GDB) on a RPI (ARM architecture). When I execute the command "info registers" I take the following output. (gdb) info registers r0 0x1 1 r1 0x7efff7b4 2130704308 r2 0x7efff7bc 2130704316 r3 0x10408 66568 r4 0x1042c 66604 r5 0x0 0 r6 0x102e0 66272 r7 0x0 0 r8 0x0 0 r9 0x0 0 r10 0x76fff000 1996484608 r11 0x0 0 r12 0x7efff6e0 2130704096 sp 0x7efff660 0x7efff660 lr 0x76e8f678 1994978936 pc 0x10408 0x10408 <main> cpsr 0x60000010 1610612752 From the output I can see that some register's values are memory addresses. Am I correct? If I type then the following command I take this output: (gdb) x $r3 0x10408 <main>: 0xe3a00000 (gdb) x $r1 0x7efff7b4: 0x7efff8d3 (gdb) x $r2 0x7efff7bc: 0x7efff8e3 This means that the value of the R3 for example points to another memory address location? I am confused, the value of a register is the address that shows at the info field or the address that points to? Any help to understand this? Also, Is any general rule that declares which values of which registers are addresses or actual values like 3,4 and so on?
[toc] | [next] | [standalone]
| From | Wouter Verhelst <w@uter.be> |
|---|---|
| Date | 2018-03-06 19:04 +0100 |
| Message-ID | <vq13ne-4th.ln1@gangtai.grep.be> |
| In reply to | #8397 |
On 06-03-18 17:28, Ilias Abrams wrote: > Hi guys, I was wondering, I am running a simple Assembly example with GNU Debugger (GDB) on a RPI (ARM architecture). When I execute the command "info registers" I take the following output. > > (gdb) info registers > r0 0x1 1 > r1 0x7efff7b4 2130704308 > r2 0x7efff7bc 2130704316 > r3 0x10408 66568 > r4 0x1042c 66604 > r5 0x0 0 > r6 0x102e0 66272 > r7 0x0 0 > r8 0x0 0 > r9 0x0 0 > r10 0x76fff000 1996484608 > r11 0x0 0 > r12 0x7efff6e0 2130704096 > sp 0x7efff660 0x7efff660 > lr 0x76e8f678 1994978936 > pc 0x10408 0x10408 <main> > cpsr 0x60000010 1610612752 > > From the output I can see that some register's values are memory addresses. Am I correct? Probably some are, yes, but it's impossible to say. A general-purpose register holds a number. What the meaning of that number is, depends on the code that's running on the processor. It may be a memory address, but it may just as well be a numeric value that the code running on the processor is doing some calculations on. There are a few special-purpose registers (such as the stack pointer (sp) and program counter (pc)) which by virtue of their function must point to a memory address if the system is going to be doing anything useful; but beyond that, in order to interpret the value of the registers you need to inspect the code. Try using the "disassemble" command. By default, that will give a disassembled view of the function which the program is "currently" executing, which should give you some hint as to what the values mean. Beyond that, your guess is as good as mine.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.programming
csiph-web