I'm trying to debug R using gdb 7.6.50..20130731-19.fc20 on a Fedora 20 arm virtual machine running under QEMU. I seem to get lots of very strange results when I print variables. For example:
Breakpoint 1, tre_tnfa_run_parallel (tnfa=tnfa@entry=0x594c20, string=string@entry=0xc265b0, len=len@entry=-1, type=type@entry=STR_BYTE, match_tags=match_tags@entry=0x38e358, eflags=0, eflags@entry=10, match_end_ofs=0xbeffdbb8, match_end_ofs@entry=0xbeffdbb0) at tre-match-parallel.c:111 111 { 2: *tnfa = {transitions = 0x20f3e8, num_transitions = 6, initial = 0x38e2c8, final = 0x20f49c, submatch_data = 0x594c80, firstpos_chars = 0x0, first_char = 46, num_submatches = 1, tag_directions = 0x594c70, minimal_tags = 0x97a2c8, num_tags = 1, num_minimals = 0, end_tag = 1, num_states = 3, cflags = 129, have_backrefs = 0, have_approx = 0, params_depth = 0} 1: tnfa = (const tre_tnfa_t *) 0x594c20 (gdb) print &tnfa Address requested for identifier "tnfa" which is in register $r0 so here at entry it know that tnfa is set to 0x594x20. And it currently appears to be stored in a register $r0. This continues until I hit an xmalloc() call: 171 buf = xmalloc((unsigned)total_bytes); after which: tre_tnfa_run_parallel (tnfa=0x81, tnfa@entry=0x594c20, string=0x594c20, string@entry=0xc265b0, len=5852192, len@entry=-1, type=STR_WIDE, type@entry=STR_BYTE, match_tags=match_tags@entry=0x38e358, eflags=0, eflags@entry=10, match_end_ofs=0xbeffdbb8, match_end_ofs@entry=0xbeffdbb0) at tre-match-parallel.c:173 173 if (buf == NULL) 2: *tnfa = <error: Cannot access memory at address 0x81> 1: tnfa = (const tre_tnfa_t *) 0x81 (gdb) print &tnfa $5 = (const tre_tnfa_t **) 0xbeffdad8 Can someone explain what is going on? - Orion