From: fei ding <fdingiit@gmail.com>
To: gdb@sourceware.org
Subject: What function of gdbserver handle g_packet send from gdb
Date: Tue, 27 Jan 2015 09:25:00 -0000 [thread overview]
Message-ID: <CAGmPkfJwwiMpf96jGaMAm2-1SaxeMLJVHSeWDV5G2dsHh9uYDQ@mail.gmail.com> (raw)
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
next reply other threads:[~2015-01-27 8:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-27 9:25 fei ding [this message]
2015-01-28 18:46 ` Philippe Waroquiers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGmPkfJwwiMpf96jGaMAm2-1SaxeMLJVHSeWDV5G2dsHh9uYDQ@mail.gmail.com \
--to=fdingiit@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox