What function of gdbserver handle g_packet send from gdb

fei ding <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAGmPkfJwwiMpf96jGaMAm2-1SaxeMLJVHSeWDV5G2dsHh9uYDQ@mail.gmail.com>
Hi, guys:

I'm tracing "set architecture xxx" command when using gdb/gdbserver,
and I've noticed that, every time we use "set architecture xxx", gdb
will re-read the registers, and if we use gdbserver/gdb, gdb will use
"fetch_register_using_g()" function to get remote's regs, and I cannot
find the function in the source code of gdbserver, which receive and
process g_packet. I've check the "process_serial_event()" in
gdbserver/server.c, and it just take care the "info reg" command every
time. Could anybody help me?

Thanks.

BR.


======
and here is some bt info in gdb(not gdbserver):

#0  regcache_raw_supply (regcache=0xe1eef0, regnum=0,
buf=0x7fffffffd8e0) at regcache.c:1003
==>!!!#1  0x000000000047b432 in process_g_packet (regcache=0xe1eef0)
at remote.c:6136
#2  0x000000000047b471 in fetch_registers_using_g (regcache=0xe1eef0)
at remote.c:6146
#3  0x000000000047b5b0 in remote_fetch_registers (ops=0xc71cc0,
regcache=0xe1eef0, regnum=16) at remote.c:6194
#4  0x00000000005cc668 in delegate_fetch_registers (self=0xc71cc0,
arg1=0xe1eef0, arg2=16) at target-delegates.c:73
#5  0x00000000005d547c in target_fetch_registers (regcache=0xe1eef0,
regno=16) at target.c:3255
#6  0x00000000005226f1 in regcache_raw_read (regcache=0xe1eef0,
regnum=16, buf=0xe342a0 "") at regcache.c:619
#7  0x0000000000522d88 in regcache_cooked_read (regcache=0xe1eef0,
regnum=16, buf=0xe342a0 "") at regcache.c:710
#8  0x0000000000523098 in regcache_cooked_read_value
(regcache=0xe1eef0, regnum=16) at regcache.c:772
#9  0x000000000068da3a in sentinel_frame_prev_register
(this_frame=0xd4ded0, this_prologue_cache=0xd4dee8, regnum=16) at
sentinel-frame.c:52
#10 0x00000000006b8ed9 in frame_unwind_register_value (frame=0xd4ded0,
regnum=16) at frame.c:1114
#11 0x00000000006b8aa2 in frame_register_unwind (frame=0xd4ded0,
regnum=16, optimizedp=0x7fffffffddc0, unavailablep=0x7fffffffddc4,
lvalp=0x7fffffffddcc,
    addrp=0x7fffffffddb8, realnump=0x7fffffffddc8,
bufferp=0x7fffffffddf0 " \336\377\377\377\177") at frame.c:1019
#12 0x00000000006b8d81 in frame_unwind_register (frame=0xd4ded0,
regnum=16, buf=0x7fffffffddf0 " \336\377\377\377\177") at frame.c:1073
#13 0x000000000042b855 in i386_unwind_pc (gdbarch=0xe532b0,
next_frame=0xd4ded0) at i386-tdep.c:1945
#14 0x00000000005b33f9 in gdbarch_unwind_pc (gdbarch=0xe532b0,
next_frame=0xd4ded0) at gdbarch.c:2779
#15 0x00000000006b84d7 in frame_unwind_pc (this_frame=0xd4ded0) at frame.c:814
#16 0x00000000006bb1ad in get_frame_pc_if_available (frame=0xd4ded0,
pc=0x7fffffffded0) at frame.c:2237
#17 0x00000000006baf77 in get_prev_frame (this_frame=0xd4ded0) at frame.c:2136
#18 0x00000000006b9b44 in unwind_to_current_frame (ui_out=0xd681c0,
args=0xd4ded0) at frame.c:1450
#19 0x000000000059c51a in catch_exceptions_with_msg
(func_uiout=0xd681c0, func=0x6b9b28 <unwind_to_current_frame>,
func_args=0xd4ded0, gdberrmsg=0x0,
    mask=RETURN_MASK_ERROR) at exceptions.c:458
#20 0x000000000059c49f in catch_exceptions (uiout=0xd681c0,
func=0x6b9b28 <unwind_to_current_frame>, func_args=0xd4ded0,
mask=RETURN_MASK_ERROR)
    at exceptions.c:438
#21 0x00000000006b9d11 in get_current_frame () at frame.c:1492
#22 0x00000000006b9e6a in get_selected_frame (message=0x0) at frame.c:1547
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.