From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Nasser To: Scott Bambrough Cc: GDB Patches Mail List Subject: Re: RFA: Testsuite patches... Date: Fri, 28 Jul 2000 11:47:00 -0000 Message-id: <3981D53F.BE84EDCF@cygnus.com> References: <39803B5C.9C31BB15@netwinder.org> X-SW-Source: 2000-07/msg00346.html Scott Bambrough wrote: > > 2000-07-26 Scott Bambrough > > * linux-thread.c (linux_threads_pid_to_str): Change "Pid" to > "process" to allow gdb.base/environ.exp to pass all tests. > Change capitalization on "Thread" for consistency. > I forwarded the above change to the maintainers requesting their approval. > 2000-07-26 Scott Bambrough > > * gdb.base/environ.exp: Run tests for all targets. > * gdb.base/recurse.exp: Run tests for all targets. > These two are OK. > * gdb.base/sect-cmd.exp: Run tests for all targets. Use > 'section .text' clause for Linux in set section command > test. > This is not. The expect code must be changed to memorize if the architecture uses .text or CODE and use it subsequently. > * gdb.base/so-impl-ld.exp: Added wildcard to > handle the gnu-oldld case on ARM. > All right. Godd catch. Thanks. > * gdb.base/so-indr-cl.exp: Run tests for *-*-linux-gnu*. You must also add a comment (as is done in so-impl-ld.exp) explaining that this is also known to run in Linux (version?). The comment there says it *must* be a HP target and we will contradict it with the code. > * gdb.base/watchpoint.exp (test_stepping): Clear xfail > for ARM targets. > You are the boss here :-) Let's add this one. Scott, you can either wait a bit for me to make the changes or, if you find some spare cycles, do the changes yourself. We need to wait for the Linux thread folks to authorize the change to linux-threads.c (which will probably be soon anyways). Thanks for the patch. Regards, Fernando -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@cygnus.com 2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311 Toronto, Ontario M4P 2C9 Fax: 416-482-6299 >From scottb@netwinder.org Fri Jul 28 12:03:00 2000 From: Scott Bambrough To: GDB Patches Mail List Subject: Re: RFA: Testsuite patches... Date: Fri, 28 Jul 2000 12:03:00 -0000 Message-id: <3981D792.20F9AD64@netwinder.org> X-SW-Source: 2000-07/msg00347.html Content-length: 2003 Michael Snyder wrote: > > I don't see any reference to the string "Pid" in environ.exp, > and the references to "process" are not testing the output > that you changed. Why do you want this change? Because the output generated by gdb uses pid_to_str which eventually resolves to the function I have changed. environ.exp expects process instead of Pid. HP has its own version of pid_to_str which uses process as well. Basically this change allows the last test in environ.exp to succeed on ARM and x86 Linux. These are the only systems I have available ATM. > > Change capitalization on "Thread" for consistency. > > Consistency with what? I'm not strongly opposed, but since > SOMEONE may depend on this output, I'd like to know the > motivation for changing it. child_pid_to_str in hppa-nat.c returns either "process pid" child_pid_to_str in inftarg.c returns either "thread tid" or "process pid" child_pid_to_str in lynx-nat.c returns either "process pid thread tid" or "process pid" normal_pid_to_str returns either "thread pid" or "process pid" linuxthreads_pid_to_str returns "Thread tid", "Pid pid", my changes makes this "thread tid", "process pid" cygwin_pid_to_str returns "thread tid.pid" or "process pid" gnu_pid_to_str returns "thread pid.tid" or "process pid" hpux_pid_to_str returns "Thread tid" procfs_pid_to_str returns "LWP tid", "Process pid" uw_thread_pid_to_str returns "LWP tid", "Process pid", "Thread tid" solaris_pid_to_str returns "Thread tid (LWP lwpid)", "Thread tid (defunct)", "LWP lwpid", "Thread tid", "process pid" thread_db_pid_to_str returns "Thread tid (LWP lwpid)", "Thread tid (state str)", "LWP lwpid", "thread tid", "process pid" There is not a whole lot of consistency, but I thought it was more more consistent on the whole with other functions that returned "thread id", "process id". Matter of personal opinion I guess. -- Scott Bambrough - Software Engineer REBEL.COM http://www.rebel.com NetWinder http://www.netwinder.org >From ezannoni@cygnus.com Fri Jul 28 12:23:00 2000 From: Elena Zannoni To: gdb-patches@sourceware.cygnus.com Subject: [REPOST PATCH] Fix double pseudoregs in LE target Date: Fri, 28 Jul 2000 12:23:00 -0000 Message-id: <14721.56729.351998.370048@kwikemart.cygnus.com> X-SW-Source: 2000-07/msg00348.html Content-length: 4198 I am reposting this, the previous post to sources.redhat.com didn't work. I just commited this SH change (see comments in code): 2000-07-28 Elena Zannoni * sh-tdep.c (sh_gdbarch_init): For sh4 initialize register_convert_to_raw, register_convert_to_virtual, register_convertible. (sh_sh4_register_convertible): New function. (sh_sh4_register_convert_to_virtual): New function. (sh_sh4_register_convert_to_raw): New function. Include floatformat.h. Index: sh-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sh-tdep.c,v retrieving revision 1.11 diff -c -u -p -r1.11 sh-tdep.c --- sh-tdep.c 2000/07/26 23:04:44 1.11 +++ sh-tdep.c 2000/07/28 15:13:43 @@ -37,6 +37,7 @@ #include "inferior.h" /* for BEFORE_TEXT_END etc. */ #include "gdb_string.h" #include "arch-utils.h" +#include "floatformat.h" #undef XMALLOC #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) @@ -1530,6 +1531,71 @@ sh_default_register_virtual_type (reg_nr return builtin_type_int; } +/* On the sh4, the DRi pseudo registers are problematic if the target + is little endian. When the user writes one of those registers, for + instance with 'ser var $dr0=1', we want the double to be stored + like this: + fr0 = 0x00 0x00 0x00 0x00 0x00 0xf0 0x3f + fr1 = 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + + This corresponds to little endian byte order & big endian word + order. However if we let gdb write the register w/o conversion, it + will write fr0 and fr1 this way: + fr0 = 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + fr1 = 0x00 0x00 0x00 0x00 0x00 0xf0 0x3f + because it will consider fr0 and fr1 as a single LE stretch of memory. + + To achieve what we want we must force gdb to store things in + floatformat_ieee_double_littlebyte_bigword (which is defined in + include/floatformat.h and libiberty/floatformat.c. + + In case the target is big endian, there is no problem, the + raw bytes will look like: + fr0 = 0x3f 0xf0 0x00 0x00 0x00 0x00 0x00 + fr1 = 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + + The other pseudo registers (the FVs) also don't pose a problem + because they are stored as 4 individual FP elements. */ + +int +sh_sh4_register_convertible (int nr) +{ + if (TARGET_BYTE_ORDER == LITTLE_ENDIAN) + return (gdbarch_tdep (current_gdbarch)->DR0_REGNUM <= nr + && nr <= gdbarch_tdep (current_gdbarch)->DR14_REGNUM); + else + return 0; +} + +void +sh_sh4_register_convert_to_virtual (int regnum, struct type *type, + char *from, char *to) +{ + if (regnum >= gdbarch_tdep (current_gdbarch)->DR0_REGNUM + && regnum <= gdbarch_tdep (current_gdbarch)->DR14_REGNUM) + { + DOUBLEST val; + floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword, from, &val); + store_floating(to, TYPE_LENGTH(type), val); + } + else + error("sh_register_convert_to_virtual called with non DR register number"); +} + +void +sh_sh4_register_convert_to_raw (struct type *type, int regnum, + char *from, char *to) +{ + if (regnum >= gdbarch_tdep (current_gdbarch)->DR0_REGNUM + && regnum <= gdbarch_tdep (current_gdbarch)->DR14_REGNUM) + { + DOUBLEST val = extract_floating (from, TYPE_LENGTH(type)); + floatformat_from_doublest (&floatformat_ieee_double_littlebyte_bigword, &val, to); + } + else + error("sh_register_convert_to_raw called with non DR register number"); +} + void sh_fetch_pseudo_register (int reg_nr) { @@ -1953,6 +2019,9 @@ sh_gdbarch_init (info, arches) set_gdbarch_num_pseudo_regs (gdbarch, 12); set_gdbarch_max_register_raw_size (gdbarch, 4 * 4); set_gdbarch_max_register_virtual_size (gdbarch, 4 * 4); + set_gdbarch_register_convert_to_raw (gdbarch, sh_sh4_register_convert_to_raw); + set_gdbarch_register_convert_to_virtual (gdbarch, sh_sh4_register_convert_to_virtual); + set_gdbarch_register_convertible (gdbarch, sh_sh4_register_convertible); tdep->FPUL_REGNUM = 23; tdep->FPSCR_REGNUM = 24; tdep->FP15_REGNUM = 40;