mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
gdb/testsuite/
* gdb.base/dprintf.c (main): Add extra parameter when calling printf and fprintf. (bar): New function. It is a dead function, but to ensure 'malloc' is linked explicitly.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2012-06-06 Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
|
* gdb.base/dprintf.c (main): Add extra parameter when calling
|
||||||
|
printf and fprintf.
|
||||||
|
(bar): New function. It is a dead function, but to ensure
|
||||||
|
'malloc' is linked explicitly.
|
||||||
|
|
||||||
2012-06-06 Yao Qi <yao@codesourcery.com>
|
2012-06-06 Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
* gdb.base/info-proc.exp: Return if target doesn't support
|
* gdb.base/info-proc.exp: Return if target doesn't support
|
||||||
|
@ -33,8 +33,8 @@ main (int argc, char *argv[])
|
|||||||
int loc = 1234;
|
int loc = 1234;
|
||||||
|
|
||||||
/* Ensure these functions are available. */
|
/* Ensure these functions are available. */
|
||||||
printf ("kickoff\n");
|
printf ("kickoff %d\n", loc);
|
||||||
fprintf (stderr, "also to stderr\n");
|
fprintf (stderr, "also to stderr %d\n", loc);
|
||||||
|
|
||||||
foo (loc++);
|
foo (loc++);
|
||||||
foo (loc++);
|
foo (loc++);
|
||||||
@ -42,3 +42,17 @@ main (int argc, char *argv[])
|
|||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
/* Make sure function 'malloc' is linked into program. One some bare-metal
|
||||||
|
port, if we don't use 'malloc', it will not be linked in program. 'malloc'
|
||||||
|
is needed, otherwise we'll see such error message
|
||||||
|
|
||||||
|
evaluation of this expression requires the program to have a function
|
||||||
|
"malloc". */
|
||||||
|
void
|
||||||
|
bar (void)
|
||||||
|
{
|
||||||
|
void *p = malloc (16);
|
||||||
|
|
||||||
|
free (p);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user