old-cross-binutils/gdb/testsuite/gdb.base/constvars.c
Pedro Alves 924437bc13 gdb/doc/
2011-12-13  Pedro Alves  <pedro@codesourcery.com>

	* gdb.texinfo (Implementing a Remote Stub): Explain that you
	should transfer control to the stub in the startup code instead of
	in main.  Mention the need to get past the initial breakpoint.

gdb/testsuite/
2011-12-13  Pedro Alves  <pedro@codesourcery.com>
	    Doug Evans  <dje@google.com>

	* lib/gdb.exp (gdb_run_cmd, runto_main, gdb_compile)
	(clean_restart): Remove references to the gdb_stub target board
	variable.
	(gdb_step_for_stub): Delete.

	* gdb.base/annota1.exp: Remove all references to [target_info
	exists gdb_stub], gdb_step_for_stub and usestubs.
	* gdb.base/annota3.exp: Ditto.
	* gdb.base/async.exp: Ditto.
	* gdb.base/break.exp: Ditto.
	* gdb.base/code-expr.exp: Ditto.
	* gdb.base/commands.exp: Ditto.
	* gdb.base/completion.exp: Ditto.
	* gdb.base/condbreak.exp: Ditto.
	* gdb.base/consecutive.exp: Ditto.
	* gdb.base/cvexpr.exp: Ditto.
	* gdb.base/define.exp: Ditto.
	* gdb.base/display.exp: Ditto.
	* gdb.base/ena-dis-br.exp: Ditto.
	* gdb.base/environ.exp: Ditto.
	* gdb.base/gnu-ifunc.exp: Ditto.
	* gdb.base/maint.exp: Ditto.
	* gdb.base/pending.exp: Ditto.
	* gdb.base/sect-cmd.exp: Ditto.
	* gdb.base/sepdebug.exp: Ditto.
	* gdb.base/unload.exp: Ditto.
	* gdb.base/watchpoint-solib.exp: Ditto.
	* gdb.cp/annota2.exp: Ditto.
	* gdb.cp/annota3.exp: Ditto.
	* gdb.dwarf2/dw2-inline-param.exp: Ditto.
	* gdb.hp/gdb.compat/xdb1.exp: Ditto.
	* gdb.mi/mi-pending.exp: Ditto.
	* gdb.trace/circ.exp: Ditto.
	* gdb.cp/ovldbreak.exp: Ditto.  Adjust expected line numbers.
	* gdb.base/list.exp: Ditto.

	* gdb.base/all-types.c: Remove all calls to set_debug_traps and
	breakpoint function and all references to the usestubs macro.
	* gdb.base/exprs.c: Ditto.
	* gdb.base/freebpcmd.c: Ditto.
	* gdb.base/bitfields.c: Ditto.
	* gdb.base/bitfields2.c: Ditto.
	* gdb.base/break.c: Ditto.
	* gdb.base/call-sc.c: Ditto.
	* gdb.base/call-signals.c: Ditto.
	* gdb.base/callfuncs.c: Ditto.
	* gdb.base/charset.c: Ditto.
	* gdb.base/consecutive.c: Ditto.
	* gdb.base/constvars.c: Ditto.
	* gdb.base/funcargs.c: Ditto.
	* gdb.base/int-type.c: Ditto.
	* gdb.base/interrupt.c: Ditto.
	* gdb.base/langs0.c: Ditto.
	* gdb.base/list0.c: Ditto.
	* gdb.base/mips_pro.c: Ditto.
	* gdb.base/miscexprs.c: Ditto.
	* gdb.base/nodebug.c: Ditto.
	* gdb.base/opaque0.c: Ditto.
	* gdb.base/pointers.c: Ditto.
	* gdb.base/printcmds.c: Ditto.
	* gdb.base/ptype.c: Ditto.
	* gdb.base/recurse.c: Ditto.
	* gdb.base/reread1.c: Ditto.
	* gdb.base/reread2.c: Ditto.
	* gdb.base/restore.c: Ditto.
	* gdb.base/return.c: Ditto.
	* gdb.base/run.c: Ditto.
	* gdb.base/scope0.c: Ditto.
	* gdb.base/sepdebug.c: Ditto.
	* gdb.base/setshow.c: Ditto.
	* gdb.base/setvar.c: Ditto.
	* gdb.base/sigall.c: Ditto.
	* gdb.base/signals.c: Ditto.
	* gdb.base/structs.c: Ditto.
	* gdb.base/structs2.c: Ditto.
	* gdb.base/testenv.c: Ditto.
	* gdb.base/twice.c: Ditto.
	* gdb.base/unwindonsignal.c: Ditto.
	* gdb.base/watchpoint.c: Ditto.
	* gdb.base/watchpoints.c: Ditto.
	* gdb.base/whatis.c: Ditto.
	* gdb.cp/classes.cc: Ditto.
	* gdb.cp/cplusfuncs.cc: Ditto.
	* gdb.cp/derivation.cc: Ditto.
	* gdb.cp/formatted-ref.cc: Ditto.
	* gdb.cp/misc.cc: Ditto.
	* gdb.cp/overload.cc: Ditto.
	* gdb.cp/ovldbreak.cc: Ditto.
	* gdb.cp/ref-params.cc: Ditto.
	* gdb.cp/ref-types.cc: Ditto.
	* gdb.cp/templates.cc: Ditto.
	* gdb.cp/virtfunc.cc: Ditto.
	* gdb.hp/gdb.aCC/run.c: Ditto.
	* gdb.hp/gdb.base-hp/callfwmall.c: Ditto.
	* gdb.hp/gdb.compat/xdb0.c: Ditto.
	* gdb.reverse/consecutive-reverse.c: Ditto.
	* gdb.reverse/sigall-reverse.c: Ditto.
	* gdb.reverse/until-reverse.c: Ditto.
	* gdb.reverse/watch-reverse.c: Ditto.
	* gdb.trace/actions.c: Ditto.
	* gdb.trace/circ.c: Ditto.
	* gdb.trace/collection.c: Ditto.
2011-12-13 17:22:11 +00:00

198 lines
6.3 KiB
C

void marker1 (void)
{
}
/* misc. function params */
int
qux1 (const char cc, const char /*&*/ccr, const char *ccp, char *const cpc)
{
return 33;
}
int
qux2 (volatile unsigned char vuc, const volatile int cvi,
volatile short /*&*/vsr, volatile long *vlp, float *volatile fpv,
const volatile signed char *const volatile cvscpcv)
{
return 400;
}
int
main (void)
{
char lave = 'B';
unsigned char lavish = 10;
short lax = 20;
unsigned short lecherous = 30;
long lechery = 40;
unsigned long lectern = 50;
float leeway = 60;
double legacy = 70;
signed char lemonade = 35;
const char laconic = 'A';
const unsigned char laggard = 1;
const short lagoon = 2;
const unsigned short laity = 3;
const long lambent = 4;
const unsigned long laminated = 5;
const float lampoon = 6;
const double languid = 7;
/* pointers to constant variables */
const char *legend = &lave;
const unsigned char *legerdemain = &lavish;
const short *leniency = &lax;
const unsigned short *leonine = &lecherous;
const long *lesion = &lechery;
const unsigned long *lethal = &lectern;
const float *lethargic = &leeway;
const double *levity = &legacy;
/* constant pointers to constant variables */
const char *const lewd = &laconic;
const unsigned char *const lexicographer = &laggard;
const short *const lexicon = &lagoon;
const unsigned short *const liaison = &laity;
const long *const libation = &lambent;
const unsigned long *const libelous = &laminated;
const float *const libertine = &lampoon;
const double *const libidinous = &languid;
/* this is the same as const char * legend .... */
char const *languish = &laconic;
unsigned char const *languor = &laggard;
short const *lank = &lagoon;
unsigned short const *lapidary = &laity;
long const *larceny = &lambent;
unsigned long const *largess = &laminated;
float const *lascivious = &lampoon;
double const *lassitude = &languid;
/* constant pointers to variable */
char *const lamprey = &lave;
unsigned char *const lariat = &lavish;
short *const laudanum = &lax;
unsigned short *const lecithin = &lecherous;
long *const leviathan = &lechery;
unsigned long *const libretto = &lectern;
float *const lissome = &leeway;
double *const locust = &legacy;
/* constant arrays */
const char logical[2] = {laconic, laconic};
const unsigned char lugged[2] = {laggard, laggard};
const short luck[2] = {lagoon, lagoon};
const unsigned short lunar[2] = {laity, laity};
const long lumen[2] = {lambent, lambent};
const unsigned long lurk[2] = {laminated, laminated};
const float lush[2] = {lampoon, lampoon};
const double lynx[2] = {languid, languid};
/* volatile variables */
volatile char vox = 'X';
volatile unsigned char victuals = 13;
volatile short vixen = 200;
volatile unsigned short vitriol = 300;
volatile long vellum = 1000;
volatile unsigned long valve = 2000;
volatile float vacuity = 3.0;
volatile double vertigo = 10.3;
/* pointers to volatile variables */
volatile char * vampire = &vox;
volatile unsigned char * viper = &victuals;
volatile short * vigour = &vixen;
volatile unsigned short * vapour = &vitriol;
volatile long * ventricle = &vellum;
volatile unsigned long * vigintillion = &valve;
volatile float * vocation = &vacuity;
volatile double * veracity = &vertigo;
/* volatile pointers to volatile variables */
volatile char * volatile vapidity = &vox;
volatile unsigned char * volatile velocity = &victuals;
volatile short * volatile veneer = &vixen;
volatile unsigned short * volatile video = &vitriol;
volatile long * volatile vacuum = &vellum;
volatile unsigned long * volatile veniality = &valve;
volatile float * volatile vitality = &vacuity;
volatile double * volatile voracity = &vertigo;
/* const volatile vars */
const volatile char victor = 'Y';
const volatile unsigned char vicar = 11;
/* pointers to const volatiles */
const volatile char * victory = &victor;
const volatile unsigned char * vicarage = &vicar;
/* const pointers to volatile vars */
volatile char * const vein = &vox;
volatile unsigned char * const vogue = &victuals;
/* const pointers to const volatile vars */
const volatile char * const cavern = &victor;
const volatile unsigned char * const coverlet = &vicar;
/* volatile pointers to const vars */
const char * volatile caveat = &laconic;
const unsigned char * volatile covenant = &laggard;
/* volatile pointers to const volatile vars */
const volatile char * volatile vizier = &victor;
const volatile unsigned char * volatile vanadium = &vicar;
/* const volatile pointers */
char * const volatile vane = &lave;
unsigned char * const volatile veldt = &lavish;
/* const volatile pointers to const vars */
const char * const volatile cove = &laconic;
const unsigned char * const volatile cavity = &laggard;
/* const volatile pointers to volatile vars */
volatile char * const volatile vagus = &vox;
volatile unsigned char * const volatile vagrancy = &victuals;
/* const volatile pointers to const volatile */
const volatile char * const volatile vagary = &victor;
const volatile unsigned char * const volatile vendor = &vicar;
/* various structs with const members */
struct crass { char * const ptr; } crass = { lamprey };
struct crisp { char * const *ptr; } crisp = { &lamprey };
/* Reference the structs so that they are not discarded. */
struct crass *creed = &crass;
struct crisp *crow = &crisp;
/* misc. references */
/*
const char & radiation = laconic;
volatile signed char & remuneration = lemonade;
*/
marker1 ();
return 0;
}