0

I'm trying to write a small os kernel and got an General Protection Fault at runtime. By logging the qemu output, I figured out, that the following assembly is responsible:

10592e: 48 c7 05 a7 5c 02 00 movq $0x12b5a0,0x25ca7(%rip) # 12b5e0 <watch+0x40>

Can someone tell me, what the <watch+0x40> stand for? I think watch means my Watch class, but what is the +0x40?

jagemue
  • 363
  • 4
  • 16
  • 1
    No, `watch` would refer to a global variable named `watch` or maybe a function with that name. The `watch+0x40` means that the instruction is storing the value at address of `watch` plus 64 (0x40). If `watch` is big enough then that location might be a part of it. Otherwise it's storing the value in some unnamed object that lies beyond `watch` in memory. – Ross Ridge Apr 22 '17 at 23:21
  • It is very likely storing it in a member variable of the `Watch` class. Hard to say for sure without seeing more code. Why didn't you post a [MCVE]? – Cody Gray - on strike Apr 23 '17 at 12:53

0 Answers0