This is the mail archive of the gdb@sources.redhat.com 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]

Re: Query regarding assembly level debugging support


On Wed, Dec 08, 2004 at 12:32:12PM +0530, Tarun wrote:
> Thanks for the information. But my query still remains "Can we step
> through assembly code?"
> I know GDB supports assembly-level debugging but that refers to inline
> assembly. To make the point clear, please look at snip below. For the
> sample code segment:
> <snip>
>        /* Print the top of the stack if no index is specified. */
>        if (which < 0)
>          {
>            which = stack->top - 1;
>            if (which < 0)   
> <snip>
> 
> The inline assembly is (assume) represented as: 
> <snip>
>        /* Print the top of the stack if no index is specified. */
>        if (which < 0)
> 		.frame	$fp,16,$31	<-
> 		.mask	0x40000000,-8  <-
> 		.fmask	0x00000000,0   <-
> 		subu	$sp,$sp,16        <-
>          {
>            which = stack->top - 1;
> 		li	$2,20	            <-
> 		sw	$2,0($fp)           <-
>            if (which < 0)   
> <snip>
> 
> 
> Does GDB refer to stepping through the above code as assembly-level
> debugging?

No.

> If yes, then my requirement is little different. I want to debug the
> assembly code itself keeping it as the source code (and not the C
> source). To be more specific I want to debug hand written assembly code
> (and not the one generated by compiler)

Please see my earlier response:

  Are you saying that your source code is assembly, and your assembler
  creates debug information for it?  This should work in GDB; make sure
  that the .debug_line information is correct.

-- 
Daniel Jacobowitz


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