Skip to content

Instantly share code, notes, and snippets.

@master-q
Created July 28, 2012 11:44
Show Gist options
  • Save master-q/3192949 to your computer and use it in GitHub Desktop.
Save master-q/3192949 to your computer and use it in GitHub Desktop.
ZCMain_main_infoからstg_ap_p_fastが呼ばれる前にスタックトップから2番目に置かれるのはstg_CAF_BLACKHOLE_infoへのポインタのポインタ
(gdb) b stg_ap_p_fast
Breakpoint 1 at 0x6b1470
(gdb) run +RTS -V0
Starting program: /home/kiwamu/src/DiveIntoRTS/Main +RTS -V0
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, 0x00000000006b1470 in stg_ap_p_fast ()
(gdb) info registers rbp
rbp 0x7ffff6c05370 0x7ffff6c05370
(gdb) x 0x7ffff6c05370
0x7ffff6c05370: 0x006a8f98
(gdb)
0x7ffff6c05374: 0x00000000
(gdb)
0x7ffff6c05378: 0xf6c04000
(gdb)
0x7ffff6c0537c: 0x00007fff
(gdb) x 0x006a8f98
0x6a8f98 <stg_bh_upd_frame_info>: 0xfffe43e9
(gdb) x 0x00007ffff6c04000
0x7ffff6c04000: 0x006a65f8
(gdb) x 0x006a65f8
0x6a65f8 <stg_CAF_BLACKHOLE_info>: 0xfffee3e9
@master-q
Copy link
Author

 cg9:
     I64[Sp - 16] = stg_bh_upd_frame_info;
     I64[Sp - 8] = Hp - 8; # <= ココではポインタをスタックに置く
     R1 = base_GHCziTopHandler_runMainIO_closure;
     R2 = Main_main_closure;
     Sp = Sp - 16;
     jump stg_ap_p_fast ();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment