* [Patch] CR16 Simulator fix for gdb 7.4
@ 2012-05-10 14:24 Kaushik Phatak
2012-05-10 14:39 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Kaushik Phatak @ 2012-05-10 14:24 UTC (permalink / raw)
To: gdb-patches; +Cc: Jayant R. Sonar, Prafulla Thakare
[-- Attachment #1: Type: text/plain, Size: 741 bytes --]
Hi,
The latest version of gdb seems to break the CR16 simulator which had been
working till version 7.2.
I am not able to figure out the reason why the attached hunk (nltvals.def) has
been removed from the sources, maybe regenerate missed it out.
The original patch was posted in 2008 and this hunk was part of 7.2 sources.
http://sourceware.org/ml/gdb-patches/2008-02/msg00385.html
I have attached a patch that places the original code. Please let me know if
this is OK.
We are also working on adding gdb and gdbserver support to this target and
plan to post the patches soon. Parts of the simulator have been modified to
add breakpoint support. These will be posted separately.
Thanks & Best Regards,
Kaushik Phatak
[-- Attachment #2: cr16sim.diff --]
[-- Type: application/octet-stream, Size: 1695 bytes --]
--- ./gdb-7.4.1_orig/sim/common/nltvals.def 2012-05-10 18:28:29.000000000 +0530
+++ ./gdb-7.4.1/sim/common/nltvals.def 2012-05-10 18:11:17.000000000 +0530
@@ -216,32 +216,37 @@
#endif
#ifdef NL_TARGET_cr16
#ifdef sys_defs
-/* from syscall.h */
-/* begin cr16 sys target macros */
- { "SYS_argc", 22 },
- { "SYS_argn", 24 },
- { "SYS_argnlen", 23 },
- { "SYS_argv", 13 },
- { "SYS_argvlen", 12 },
- { "SYS_chdir", 14 },
- { "SYS_chmod", 16 },
- { "SYS_close", 3 },
- { "SYS_exit", 1 },
- { "SYS_fstat", 10 },
- { "SYS_getpid", 8 },
- { "SYS_gettimeofday", 19 },
- { "SYS_kill", 9 },
- { "SYS_link", 21 },
- { "SYS_lseek", 6 },
- { "SYS_open", 2 },
- { "SYS_read", 4 },
- { "SYS_reconfig", 25 },
- { "SYS_stat", 15 },
- { "SYS_time", 18 },
- { "SYS_times", 20 },
- { "SYS_unlink", 7 },
- { "SYS_utime", 17 },
- { "SYS_write", 5 },
+ /* from syscall.h */
+ /* begin cr16 sys target macros */
+ { "SYS_ARG", 24 },
+ { "SYS_chdir", 12 },
+ { "SYS_chmod", 15 },
+ { "SYS_chown", 16 },
+ { "SYS_creat", 8 },
+ { "SYS_execv", 11 },
+ { "SYS_execve", 59 },
+ /*{ "SYS_exit", 1 }, REVISIT*/
+ { "SYS_fork", 2 },
+ { "SYS_fstat", 22 },
+ { "SYS_getpid", 20 },
+ { "SYS_isatty", 21 },
+ { "SYS_kill", 60 },
+ { "SYS_link", 9 },
+ { "SYS_mknod", 14 },
+ { "SYS_pipe", 42 },
+ { "SYS_open", 0x401 },
+ { "SYS_close", 0x402 },
+ { "SYS_read", 0x403 },
+ { "SYS_write", 0x404 },
+ { "SYS_lseek", 0x405 },
+ { "SYS_rename", 0x406 },
+ { "SYS_unlink", 0x407 },
+ { "SYS_exit", 0x410 },
+ { "SYS_stat", 38 },
+ { "SYS_time", 0x300 },
+ { "SYS_utime", 201 },
+ { "SYS_wait", 202 },
+ { "SYS_wait4", 7 },
/* end cr16 sys target macros */
#endif
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Patch] CR16 Simulator fix for gdb 7.4
2012-05-10 14:24 [Patch] CR16 Simulator fix for gdb 7.4 Kaushik Phatak
@ 2012-05-10 14:39 ` Tom Tromey
2012-05-13 19:06 ` Mike Frysinger
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2012-05-10 14:39 UTC (permalink / raw)
To: Kaushik Phatak; +Cc: gdb-patches, Jayant R. Sonar, Prafulla Thakare
>>>>> "Kaushik" == Kaushik Phatak <Kaushik.Phatak@kpitcummins.com> writes:
Kaushik> I am not able to figure out the reason why the attached hunk
Kaushik> (nltvals.def) has been removed from the sources, maybe
Kaushik> regenerate missed it out.
I don't think this patch is ok as-is.
The top of nltvals.def says:
/* This file is machine generated by gennltvals.sh. */
So, I think the bug must either be in gennltvals.sh, or in one of its
input files, and the proper way to fix this would be to find the
original bug, fix it, and re-run gennltvals.sh.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch] CR16 Simulator fix for gdb 7.4
2012-05-10 14:39 ` Tom Tromey
@ 2012-05-13 19:06 ` Mike Frysinger
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2012-05-13 19:06 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey, Kaushik Phatak, Jayant R. Sonar, Prafulla Thakare
[-- Attachment #1: Type: Text/Plain, Size: 752 bytes --]
On Thursday 10 May 2012 10:39:13 Tom Tromey wrote:
> >>>>> "Kaushik" == Kaushik Phatak <Kaushik.Phatak@kpitcummins.com> writes:
> Kaushik> I am not able to figure out the reason why the attached hunk
> Kaushik> (nltvals.def) has been removed from the sources, maybe
> Kaushik> regenerate missed it out.
>
> I don't think this patch is ok as-is.
> The top of nltvals.def says:
>
> /* This file is machine generated by gennltvals.sh. */
>
> So, I think the bug must either be in gennltvals.sh, or in one of its
> input files, and the proper way to fix this would be to find the
> original bug, fix it, and re-run gennltvals.sh.
correct, this patch is wrong. please see:
http://sourceware.org/bugzilla/show_bug.cgi?id=12862
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-13 19:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-10 14:24 [Patch] CR16 Simulator fix for gdb 7.4 Kaushik Phatak
2012-05-10 14:39 ` Tom Tromey
2012-05-13 19:06 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox