This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem in porting GDB


Hi all
      Currently I am working on porting gdb to a new 16bit little-endian
architecture. For this target address is 24 bits divided as 16 bits
Segment offset and 8 bits of segment number. 
With one of my target memory models, I am facing problems in processing
read-line information. For this memory model 
	1. Pointer size = 16 bits
	2. Segment number is fixed say 0xc0
      
Following is some part of debug information :
The section .debug_info contains:

  Compilation Unit @ 0:
   Length:        141
   Version:       2
   Abbrev Offset: 0
   Pointer Size:  2
 <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
     DW_AT_stmt_list   : 0	
     DW_AT_high_pc     : 0x39a	
     DW_AT_low_pc      : 0x374	
     DW_AT_producer    : GNU C 4.0.0 20050305 (prerelease)	
     DW_AT_language    : 1	(ANSI C)
     DW_AT_name        : temp1.c	
     DW_AT_comp_dir    : /home/shrirangk/samples 	

Dump of debug contents of section .debug_line:

Line Number Statements:
  Extended opcode 2: set Address to 0x374
  Special opcode 7: advance Address by 0 to 0x374 and Line by 2 to 3
  Special opcode 62: advance Address by 8 to 0x37c and Line by 1 to 4
  Advance PC by 10 to 39a
  Extended opcode 1: End of Sequence

Here in both the sections  it is representing PC related information as
16 bits  (e.g 0x374) which is correct. But  actual final address should
be 24 bits (This calculation will be done by processor depending on
segment number) Let's say segment number is 0xc0 ;
so actual address is 0xc00374. 
Like this all the pc related information in all the debug sections is
16.  bits. 
Problem that I am facing is 
When I put a breakpoint (I have added adjust_breakpoint_address) I have
to explicitly generate 24 bits address and then it is putting breakpoint
at proper place , but when I try to step run from that location  , it is
not getting line number info correctly and executing the code up to next
function call.

Is there any way by which I can force all PC related debug information
in my target specific way? 
Is it necessary to do target independent code cleanup. (As far as
possible I don't want to change target independent code).  

Thanking in advance

Regards 
Shrirang Khisti
KPIT Cummins Infosystems Ltd.

 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]