From: Daniel Jacobowitz <drow@false.org>
To: Hiroshi DOYU <Hiroshi_DOYU@montavista.co.jp>
Cc: gdb@sources.redhat.com
Subject: Re: Where is the contents of target_fetch_registers ()
Date: Thu, 13 May 2004 13:37:00 -0000 [thread overview]
Message-ID: <20040513133723.GB23187@nevyn.them.org> (raw)
In-Reply-To: <20040513185017.6220543b.Hiroshi_DOYU@montavista.co.jp>
On Thu, May 13, 2004 at 06:50:17PM +0900, Hiroshi DOYU wrote:
> Hi all,
Hello, Hiroshi-san :)
> Now I am implementing gdb support on Linux kernel, Hitachi
> SH-Mobile3 (SH73180CP01) and found that the following function
> seems not to work correctly when compared with other gdb behavior
> which work correctly.
> # I can get this with "set debug target 1" option in gdb.
> (gdb) r
> Starting program: /root/a.out
> target_acknowledge_created_inferior (103)
> target_reported_exec_events_per_exec_call () = 1
> target_wait (-1, status) = 103, status->kind = stopped, signal = SIGTRAP
> target_fetch_registers (pc) = a06b5529 0x29556ba0 693463968
This first wait is the shell which GDB invoked to start your program...
> target_terminal_init ()
> target_terminal_inferior ()
> target_terminal_inferior ()
> target_resume (-1, continue, 0)
> target_wait (-1, status) = 103, status->kind = stopped, signal = SIGTRAP
> target_fetch_registers (pc) = a06b5529 0x29556ba0 693463968
This one is the program starging...
> target_resume (-1, continue, 0)
> target_wait (-1, status) = 103, status->kind = stopped, signal = SIGTRAP
And this one is probably the dynamic linker breakpoint. What this
means is that GDB will read some memory from the inferior, figure out
the list of loaded shared libraries, and then try to read symbol
information for them.
If this is where GDB is stopping, it probably means that it is either
loading the library symbols (this can take a _long_ time) or ran out of
memory and crashed.
> I guess the following should have appeaer at this <freeze> line.
>
> target_fetch_registers (r14) = 34f9ff7b 0x7bfff934 2080373044
>
>
> I would like to look into the problem which it hang at the above
> point but I dont know much about gdb. So could anyone tell me
> how to find where is the contents of "target_fetch_registers ()"?
> In other words, in Linux, how can gdb get the registers from
> kernel?
See the -nat file associated with your target. In this case it's
sh-linux-nat.c, if I remember right - which isn't in the FSF GDB
sources (was never contributed :(). Look for PTRACE_GETREGS or
PTRACE_PEEKUSER, which are the two standard mechanisms of reading
registers.
--
Daniel Jacobowitz
next prev parent reply other threads:[~2004-05-13 13:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-13 9:50 Hiroshi DOYU
2004-05-13 13:37 ` Daniel Jacobowitz [this message]
2004-05-14 8:47 ` Hiroshi DOYU
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=20040513133723.GB23187@nevyn.them.org \
--to=drow@false.org \
--cc=Hiroshi_DOYU@montavista.co.jp \
--cc=gdb@sources.redhat.com \
/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