Subject: Cross GDB questions

From: Jungjun Kim <[email-masked]>
Date: Thu, 4 May 2000 10:42:47 +0900

Hello,

This is the first time to write email to this mailing list.
If you know how to solve my progblem, please let me know.

I'm currently porting "cross GDB&Angel" to our platform. The platform I'm using
is based on the ARM720 which is made by my company. 
I downloaded GDB (gdb+dejagnu-20000426) from sourceware.cygnus.com, and it is built after I added
some my codes. I already ported Angel debugging agent to our platform.

Now I have the following questions.

1. Register display
There is no command to show registers in the both GDB 4.18 and
gdb+dejagnu-20000426.
Even more, I  get general pupose register value only in the current mode.
For instance, the cpu is in USR32 mode, then I cannot get the register value in
FIQ mode.

So I added "show_regs()" function to get GP registers and CP15 registers.

But I wonder that there is a  patch code for this Register display.

2. next command, finish command

I place linux kernel image in RAM after I compiled linux kernel with -g -O
options.  There is already Angel Image in ROM started at 0. Most of gdb
commands are working fine.
But with next command, the program couldn't stop at the next line and keep
running. So I added some codes in "gdb/infrun.c:1872" for this problem as
follows.

Orignal code in gdb/infrun.c
   1866           {
   1867         /* This breakpoint matches--either it is the right
   1868            thread or it's a generic breakpoint for all threads.
   1869            Remember that we'll need to step just _this_ thread
   1870            on any following user continuation! */
   1871         thread_step_needed = 1;
   1872            }
My code
   1866           {
   1867         /* This breakpoint matches--either it is the right
   1868            thread or it's a generic breakpoint for all threads.
   1869            Remember that we'll need to step just _this_ thread
   1870            on any following user continuation! */
   1871         thread_step_needed = 1;
   1872         // by SAMI
   1873         if(step_resume_breakpoint != NULL && step_resume_breakpoint->address == stop_pc)
   1874             step_resume_breakpoint = NULL;
   1875           }

After fix like above, the next command is working fine so far.
The finish command doesn't work too. The linux kernel program doesn't stop
at next line in previous frame with the finish command.

In fact, i'm not an expert on complier and debugger, so I canbe wrong, and I
don't touch any code myself.
I just want to know  the way to figure out this problem.

3. Baudrate
With angel, I want to change baudare in runtime. Actually, there is
"set remotebaud" command, but it doesn't seems to work with angel.

Does anyone have solutions or  suggestions?

 -----------------------------------o00--(_)--00o-------    
Jungjun Kim       System Software Engineer                       Mobile-SOC
Team, Hyundai Electronics     Office) +82-2-3459-3205     FAX)   
+82-2-3459-5843                                                .oooO Oooo.    
mailto:[email-masked]                     (   ) (   )
------------------------------------------------\ (---) /---------             
                                    \_) (_/

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
++        Please use [email-masked] for           ++
++                        kernel-related discussions.                      ++

---

From: Jungjun Kim <[email-masked]>
Date: Tue, 16 May 2000 16:41:11 +0900

Hi!!!!

Because no one answer for my question and I have some progress in GDB/ANGEL
these days, I answer myself.

> But I wonder that there is a  patch code for this Register display.
I can get GP register values using "info registers", but it shows only GP
registers in  the current mode.
So to get GP register in other mode and CP15 registers, I defined more registers
in gdb/config/arm/tm-arm.h.

> running. So I added some codes in "gdb/infrun.c:1872" for this problem as

I downloaded gdb-4.95.1 from "sourceware.cysgnu.com", and I compiled again.
With that version, it's OK for the "next" and the "finish" command.

> "set remotebaud" command, but it doesn't seems to work with angel.

Now I can change baudrate using "target" command as follows

(gdb) target rdi /dev/cua0 57600
(gdb) load vmlinux
(gdb) target rdi /dev/cua0 19200

----------------------------------------------o00--(_)--00o-------
    Jungjun Kim       System Software Engineer
                      Application Team, Hyundai Electronics
    Office) +82-2-3459-3205
    FAX)    +82-2-3459-5843
                                               .oooO Oooo.
    mailto:[email-masked]                     (   ) (   )
------------------------------------------------\ (---) /---------
                                                 \_) (_/