* command-list does not work in my gdb 7.2 port
@ 2011-09-26 14:58 Triple Yang
2011-09-27 6:19 ` Hui Zhu
0 siblings, 1 reply; 5+ messages in thread
From: Triple Yang @ 2011-09-26 14:58 UTC (permalink / raw)
To: gdb
Hi, everyone.
I am making a gdb 7.2 port recently for a prototype architecture,
which is a remote debug target in my case. The port is almost done to
achieve my purposes, say:
1. Connecting to remote target and loading program image work well.
2. Control on the debugged program is OK.
3. Inserting/deleting breakpoints OK.
4. and so as some other basic facilities.
But when I tried using gdb command "commands" to specify a command
list after I set a breakpoint, I found this did not work at all. Here
follows a rough example:
(gdb) break main
(gdb) commands
>shell echo test-commands
>end
(gdb) run
In this example, the command list is composed of only one command
"shell echo test-commands". "test-commands" is expected to be output
when the breakpoint is hit, but it does not happen. I tried replacing
"shell echo test-commands" with other similar commands, it still did
not work. but "shell echo" does work well when it is not used in a
command list defined by "commands".
I am not able to find any clue for this situation. Still worse, I can
not provide sufficient information to gdb experts for analysis.
I am hoping that someone who has ever met this problem before can help
me with his/her invaluable suggestions.
Thank you and best regards.
--
Yang Yong-Yong
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: command-list does not work in my gdb 7.2 port 2011-09-26 14:58 command-list does not work in my gdb 7.2 port Triple Yang @ 2011-09-27 6:19 ` Hui Zhu 2011-09-27 7:07 ` Triple Yang 0 siblings, 1 reply; 5+ messages in thread From: Hui Zhu @ 2011-09-27 6:19 UTC (permalink / raw) To: Triple Yang; +Cc: gdb (gdb) b mainBreakpoint 1 at 0x40056c: file 1.c, line 3.(gdb) commands Type commands for breakpoint(s) 1, one per line.End with a line saying just "end".>shell echo 123>end(gdb) rStarting program: /home/teawater/gdb/a.out Breakpoint 1, main () at 1.c:33 {123 Please try the trunk. Best, Hui https://code.google.com/p/gdbt/ On Mon, Sep 26, 2011 at 22:58, Triple Yang <triple.yang@gmail.com> wrote: > Hi, everyone. > > I am making a gdb 7.2 port recently for a prototype architecture, > which is a remote debug target in my case. The port is almost done to > achieve my purposes, say: > > 1. Connecting to remote target and loading program image work well. > 2. Control on the debugged program is OK. > 3. Inserting/deleting breakpoints OK. > 4. and so as some other basic facilities. > > But when I tried using gdb command "commands" to specify a command > list after I set a breakpoint, I found this did not work at all. Here > follows a rough example: > > (gdb) break main > (gdb) commands >>shell echo test-commands >>end > (gdb) run > > In this example, the command list is composed of only one command > "shell echo test-commands". "test-commands" is expected to be output > when the breakpoint is hit, but it does not happen. I tried replacing > "shell echo test-commands" with other similar commands, it still did > not work. but "shell echo" does work well when it is not used in a > command list defined by "commands". > > I am not able to find any clue for this situation. Still worse, I can > not provide sufficient information to gdb experts for analysis. > > I am hoping that someone who has ever met this problem before can help > me with his/her invaluable suggestions. > > Thank you and best regards. > > -- > Yang Yong-Yong > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: command-list does not work in my gdb 7.2 port 2011-09-27 6:19 ` Hui Zhu @ 2011-09-27 7:07 ` Triple Yang 2011-09-30 18:15 ` Liang Cheng 0 siblings, 1 reply; 5+ messages in thread From: Triple Yang @ 2011-09-27 7:07 UTC (permalink / raw) To: Hui Zhu; +Cc: gdb sorry, I do not understand what you are trying to say. 2011/9/27 Hui Zhu <teawater@gmail.com>: > (gdb) b mainBreakpoint 1 at 0x40056c: file 1.c, line 3.(gdb) commands > Type commands for breakpoint(s) 1, one per line.End with a line saying > just "end".>shell echo 123>end(gdb) rStarting program: > /home/teawater/gdb/a.out > Breakpoint 1, main () at 1.c:33 {123 > Please try the trunk. > > Best, > Hui > https://code.google.com/p/gdbt/ > > On Mon, Sep 26, 2011 at 22:58, Triple Yang <triple.yang@gmail.com> wrote: >> Hi, everyone. >> >> I am making a gdb 7.2 port recently for a prototype architecture, >> which is a remote debug target in my case. The port is almost done to >> achieve my purposes, say: >> >> 1. Connecting to remote target and loading program image work well. >> 2. Control on the debugged program is OK. >> 3. Inserting/deleting breakpoints OK. >> 4. and so as some other basic facilities. >> >> But when I tried using gdb command "commands" to specify a command >> list after I set a breakpoint, I found this did not work at all. Here >> follows a rough example: >> >> (gdb) break main >> (gdb) commands >>>shell echo test-commands >>>end >> (gdb) run >> >> In this example, the command list is composed of only one command >> "shell echo test-commands". "test-commands" is expected to be output >> when the breakpoint is hit, but it does not happen. I tried replacing >> "shell echo test-commands" with other similar commands, it still did >> not work. but "shell echo" does work well when it is not used in a >> command list defined by "commands". >> >> I am not able to find any clue for this situation. Still worse, I can >> not provide sufficient information to gdb experts for analysis. >> >> I am hoping that someone who has ever met this problem before can help >> me with his/her invaluable suggestions. >> >> Thank you and best regards. >> >> -- >> Yang Yong-Yong >> > -- Yang Yong-Yong ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: command-list does not work in my gdb 7.2 port 2011-09-27 7:07 ` Triple Yang @ 2011-09-30 18:15 ` Liang Cheng 2011-10-01 5:34 ` Triple Yang 0 siblings, 1 reply; 5+ messages in thread From: Liang Cheng @ 2011-09-30 18:15 UTC (permalink / raw) To: Triple Yang; +Cc: Hui Zhu, gdb He probably means you can try the latest gdb release as he did not see such an issue. On Tue, Sep 27, 2011 at 2:06 AM, Triple Yang <triple.yang@gmail.com> wrote: > sorry, I do not understand what you are trying to say. > > 2011/9/27 Hui Zhu <teawater@gmail.com>: >> (gdb) b mainBreakpoint 1 at 0x40056c: file 1.c, line 3.(gdb) commands >> Type commands for breakpoint(s) 1, one per line.End with a line saying >> just "end".>shell echo 123>end(gdb) rStarting program: >> /home/teawater/gdb/a.out >> Breakpoint 1, main () at 1.c:33 {123 >> Please try the trunk. >> >> Best, >> Hui >> https://code.google.com/p/gdbt/ >> >> On Mon, Sep 26, 2011 at 22:58, Triple Yang <triple.yang@gmail.com> wrote: >>> Hi, everyone. >>> >>> I am making a gdb 7.2 port recently for a prototype architecture, >>> which is a remote debug target in my case. The port is almost done to >>> achieve my purposes, say: >>> >>> 1. Connecting to remote target and loading program image work well. >>> 2. Control on the debugged program is OK. >>> 3. Inserting/deleting breakpoints OK. >>> 4. and so as some other basic facilities. >>> >>> But when I tried using gdb command "commands" to specify a command >>> list after I set a breakpoint, I found this did not work at all. Here >>> follows a rough example: >>> >>> (gdb) break main >>> (gdb) commands >>>>shell echo test-commands >>>>end >>> (gdb) run >>> >>> In this example, the command list is composed of only one command >>> "shell echo test-commands". "test-commands" is expected to be output >>> when the breakpoint is hit, but it does not happen. I tried replacing >>> "shell echo test-commands" with other similar commands, it still did >>> not work. but "shell echo" does work well when it is not used in a >>> command list defined by "commands". >>> >>> I am not able to find any clue for this situation. Still worse, I can >>> not provide sufficient information to gdb experts for analysis. >>> >>> I am hoping that someone who has ever met this problem before can help >>> me with his/her invaluable suggestions. >>> >>> Thank you and best regards. >>> >>> -- >>> Yang Yong-Yong >>> >> > > > > -- > Yang Yong-Yong > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: command-list does not work in my gdb 7.2 port 2011-09-30 18:15 ` Liang Cheng @ 2011-10-01 5:34 ` Triple Yang 0 siblings, 0 replies; 5+ messages in thread From: Triple Yang @ 2011-10-01 5:34 UTC (permalink / raw) To: Liang Cheng; +Cc: Hui Zhu, gdb I guess so. Anyway, I find out what goes wrong in my port. In <targ>-remote.c, we need to implement function <target>_wait(struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options), wherein STATUS is an output parameter to store the target stop status. For a breakpoint hit, it needs to be assigned with a trap signal, otherwise, COMMANDS won't work. Best regards. 2011/10/1 Liang Cheng <liang.cheng555@gmail.com>: > He probably means you can try the latest gdb release as he did not see > such an issue. > > On Tue, Sep 27, 2011 at 2:06 AM, Triple Yang <triple.yang@gmail.com> wrote: >> sorry, I do not understand what you are trying to say. >> >> 2011/9/27 Hui Zhu <teawater@gmail.com>: >>> (gdb) b mainBreakpoint 1 at 0x40056c: file 1.c, line 3.(gdb) commands >>> Type commands for breakpoint(s) 1, one per line.End with a line saying >>> just "end".>shell echo 123>end(gdb) rStarting program: >>> /home/teawater/gdb/a.out >>> Breakpoint 1, main () at 1.c:33 {123 >>> Please try the trunk. >>> >>> Best, >>> Hui >>> https://code.google.com/p/gdbt/ >>> >>> On Mon, Sep 26, 2011 at 22:58, Triple Yang <triple.yang@gmail.com> wrote: >>>> Hi, everyone. >>>> >>>> I am making a gdb 7.2 port recently for a prototype architecture, >>>> which is a remote debug target in my case. The port is almost done to >>>> achieve my purposes, say: >>>> >>>> 1. Connecting to remote target and loading program image work well. >>>> 2. Control on the debugged program is OK. >>>> 3. Inserting/deleting breakpoints OK. >>>> 4. and so as some other basic facilities. >>>> >>>> But when I tried using gdb command "commands" to specify a command >>>> list after I set a breakpoint, I found this did not work at all. Here >>>> follows a rough example: >>>> >>>> (gdb) break main >>>> (gdb) commands >>>>>shell echo test-commands >>>>>end >>>> (gdb) run >>>> >>>> In this example, the command list is composed of only one command >>>> "shell echo test-commands". "test-commands" is expected to be output >>>> when the breakpoint is hit, but it does not happen. I tried replacing >>>> "shell echo test-commands" with other similar commands, it still did >>>> not work. but "shell echo" does work well when it is not used in a >>>> command list defined by "commands". >>>> >>>> I am not able to find any clue for this situation. Still worse, I can >>>> not provide sufficient information to gdb experts for analysis. >>>> >>>> I am hoping that someone who has ever met this problem before can help >>>> me with his/her invaluable suggestions. >>>> >>>> Thank you and best regards. >>>> >>>> -- >>>> Yang Yong-Yong >>>> >>> >> >> >> >> -- >> Yang Yong-Yong >> > -- Yang Yong-Yong ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-01 5:34 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-09-26 14:58 command-list does not work in my gdb 7.2 port Triple Yang 2011-09-27 6:19 ` Hui Zhu 2011-09-27 7:07 ` Triple Yang 2011-09-30 18:15 ` Liang Cheng 2011-10-01 5:34 ` Triple Yang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).