[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-rt
Subject:    Re: [rtl] RTLinux debugging
From:       V C Ravi <vcravi () cair ! res ! in>
Date:       2002-06-26 18:29:12
[Download RAW message or body]

Thanx a lot! I figured out the part abt the optimization just a while
back and was abt 2 post it, too! There does seem to be some problem with
the floating point vars (even after setting fp ops in the thread
init)...

VC

PS: OOC, what does the warning abt the shared lib handler mean actually?

Stelian Pop wrote:
> 
> On Tue, Jun 25, 2002 at 12:50:14PM -0500, V C Ravi wrote:
> 
> > > $1 = 116 't'
> >
> > 1. What do the warning messages in gdb-5.1.90CVS-5 mean ?
> 
> Here is my session:
>         # /sbin/insmod hello.o
>         Warning: loading hello.o will taint the kernel: no license
>         # gdb hello.o
>         GNU gdb Red Hat Linux (5.1.90CVS-5)
>         Copyright 2002 Free Software Foundation, Inc.
>         GDB is free software, covered by the GNU General Public License, and you are
>         welcome to change it and/or distribute copies of it under certain conditions.
>         Type "show copying" to see the conditions.
>         There is absolutely no warranty for GDB.  Type "show warranty" for details.
>         This GDB was configured as "i386-redhat-linux"...
>         (gdb) l
>         1       #include <rtl.h>
>         2       #include <time.h>
>         3       #include <pthread.h>
>         4       #include <rtl_debug.h>
>         5
>         6       pthread_t thread = NULL;
>         7
>         8       float gen_count = 0;
>         9       void * start_routine(void *arg) {
>         10
>         (gdb) target remote /dev/rtf10
>         Remote debugging using /dev/rtf10
>         [New Thread -1035141120]
>         [Switching to Thread -1035141120]
>         start_routine (arg=0x1) at hello.c:23
>         23                      pthread_wait_np ();
>         warning: shared library handler failed to enable breakpoint
>         (gdb) n
>         24                      rtl_printf("Debug count = %d %c\n", (int)gen_count, option);
>         (gdb) n
>         25                      gen_count += 1.0;
>         (gdb) info locals
>         gen_var = 0
>         gen_str = "test string\0\0\0\0\0\0\0\0"
>         option = 116 't'
>         (gdb) q
>         The program is running.  Exit anyway? (y or n) y
> 
> As you see, there is only ONE warning printed, if you remember to do the 'list'
> command before the 'target remote' command.
> 
> > 2. Why are all the symbols not read in completely in gdb-4.18-11 ?
> 
> The symbols are read completly. What is happenning in your example is that the
> compiler is optimizing the source and since 'option' (for example) is not used
> later in your function the compiler is removing it completly. Just use normally
> the variables and they will show up in the debugger.
> 
> Note however that the float variables seem to be more difficult to trace with
> the debugger. You need to use pthread_setfp_np() to enable floating poing
> operations in your thread anyway (you aren't doing it in your example), but even
> after that the debugger doesn't seem to access the value correctly...
> 
> > 3. Why are all the symbols visible *when declared static* ?
> 
> When declared static, the compiler cannot remove the variables, even if they
> are not used, since an external object file could reference them.
> 
> > 4. What does the 116 in the output of "print option" stand for ?
> 
> 't' is ASCII 116.
> 
> Stelian.
> --
> Stelian Pop <stelian.pop@fr.alcove.com>
> Alcove - http://www.alcove.com
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic