This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
symtab/2323: gdwarf-2 register params with backing store cannot be displayed
- From: mblower at chipwrights dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 28 Sep 2007 13:12:35 -0000
- Subject: symtab/2323: gdwarf-2 register params with backing store cannot be displayed
- Reply-to: mblower at chipwrights dot com
>Number: 2323
>Category: symtab
>Synopsis: gdwarf-2 register params with backing store cannot be displayed
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Sep 28 13:18:02 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator: mblower@chipwrights.com
>Release: gdb 6.6 --target=arm-softfloat-elf
>Organization:
>Environment:
redhat linux 7.0, also pc-cygwin, build the c executable with eclipse cdt plugin 200707121445,
>Description:
Using -gdwarf-2 to build debug information, when break inside "stow_it", cannot display parameter r4, instead gdb gets an error stating "Asking for position 0 of stack, stack only contains 0 elements." Similar difficulty with "info frame" and some of the other expression display commands. If I rebuild with -gstabs then gdb does not have this difficulty.
I'm not including all the runtime support stuff--hopefully this is sufficient for you to reconstruct the error. I think the bug is that gdb doesn't know how to decode the dwarf for the param r4. I stepped through gdb, and in evaluating r4 it went into dwarf2_evaluate_loc_desc where I would think it should fall into the "if ctx->in_reg" clause, but it didn't.
>How-To-Repeat:
gdb foo.elf
target sim
break stow_it
load
run
Here's the build info:
**** Build of configuration Release for project test-ipc-armSide ****
make -k all
Building file: H:/views/swapps/chipSupport/ipc/test/arm_main.c
Invoking: C Compiler
arm-elf-gcc -mcpu=arm926ej-s -D__CW5631__ -D__CWARM__ -I../../../../../../commonIncludes -I../../../../../armSupport/inc -I../../../sampleCode/armSamples/inc/cas -I../../../sampleCode/armSamples/inc/cas_lib -I../../../sampleCode/armSamples/inc/shared_c -I../../../sampleCode/armSamples/inc -I../../../../../chipDefs -I../../../../../ipc -I../../../../../rpc -O1 -gdwarf-2 -Wall -c -mfpu=fpa --freestanding -mlong-calls -Wa,-mapcs-32 -o"arm_main.o" "H:/views/swapps/chipSupport/ipc/test/arm_main.c" && \
echo -n 'arm_main.d' ./ > 'arm_main.d' && \
arm-elf-gcc -MM -MG -P -w -mcpu=arm926ej-s -D__CW5631__ -D__CWARM__ -I../../../../../../commonIncludes -I../../../../../armSupport/inc -I../../../sampleCode/armSamples/inc/cas -I../../../sampleCode/armSamples/inc/cas_lib -I../../../sampleCode/armSamples/inc/shared_c -I../../../sampleCode/armSamples/inc -I../../../../../chipDefs -I../../../../../ipc -I../../../../../rpc -O1 -gdwarf-2 -Wall -c -mfpu=fpa --freestanding -mlong-calls -Wa,-mapcs-32 "H:/views/swapps/chipSupport/ipc/test/arm_main.c" >> 'arm_main.d'
H:/views/swapps/chipSupport/ipc/test/arm_main.c: In function 'arm_main':
H:/views/swapps/chipSupport/ipc/test/arm_main.c:58: warning: implicit declaration of function 'my_quit'
H:/views/swapps/chipSupport/ipc/test/arm_main.c: In function 'puts':
H:/views/swapps/chipSupport/ipc/test/arm_main.c:101: warning: passing argument 1 of 'my_strlen' discards qualifiers from pointer target type
H:/views/swapps/chipSupport/ipc/test/arm_main.c: At top level:
H:/views/swapps/chipSupport/ipc/test/arm_main.c:31: warning: 'dram_buff' defined but not used
Finished building: H:/views/swapps/chipSupport/ipc/test/arm_main.c
Building target: test-ipc.elf
Invoking: C Linker
arm-elf-ld ./arm_main.o -o"test-ipc.elf" -T"../../../arm_ipc_test.lcf" -nostdlib -static -lArmSupport -L../../../../../armSupport/projects/armSupport/Release -Map=test-ipc.map
Finished building target: test-ipc.elf
make --no-print-directory post-build
pwd
/cygdrive/h/views/swapps/chipSupport/ipc/test/projects/test-ipc-armSide/Release
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="arm_main.c"
Content-Disposition: inline; filename="arm_main.c"
#include <stdio.h>
#include <string.h>
char output_vec[10000];
int outP = 0;
void my_printf(char *s)
{
while(s){ output_vec[outP++] = s++; }
}
extern int vec[];
int vec[8];
void stow_it( int r1, int r2, int r3, int r4, int r5, int r6, int r7, int r8)
{
vec[0]=r1;
vec[1]=r2;
vec[2]=r3;
vec[3]=r4;
vec[5]=r5;
vec[6]=r6;
vec[7]=r7;
vec[8]=r8;
}
void bye()
{
/* quit here */
}
main()
{
my_printf("calling stow it\n");
stow_it(1,2,3,4,5,6,7,8);
my_printf("calling stow it again\n");
stow_it(1,2,3,4,5,6,7,8);
my_printf("bye\n");
bye();
}