baremetal: build userland/ programs using baremetal path property instead of symlinks

Otherwise I'll go crazy with symlink action.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-24 00:00:00 +00:00
parent edfbe9f0d7
commit 05aa5c7c79
49 changed files with 372 additions and 271 deletions

View File

@@ -1,13 +0,0 @@
#include <assert.h>
int main(void) {
int i, j, k;
i = 1;
/* test-gdb-op1 */
j = 2;
/* test-gdb-op2 */
k = i + j;
/* test-gdb-result */
if (k != 3)
assert(0);
}

View File

@@ -1,9 +0,0 @@
def test(self):
self.sendline('tbreak main')
self.sendline('continue')
self.continue_to('op1')
assert self.get_int('i') == 1
self.continue_to('op2')
assert self.get_int('j') == 2
self.continue_to('result')
assert self.get_int('k') == 3

View File

@@ -1,18 +0,0 @@
/* Let's see what happens when an assert fails.
*
* Outcome on Ubuntu 19.04 shows the failure line:
*
* assert_fail.out: /path/to/linux-kernel-module-cheat/userland/c/assert_fail.c:15: main: Assertion `0' failed.
*
* and exit status 134 == 128 + 6, which corresponds to SIGABORT (6).
*/
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
int main(void) {
assert(0);
puts("here");
return EXIT_SUCCESS;
}

View File

@@ -1,21 +0,0 @@
/* Get on character from stdin, and then print it back out.
*
* Same as getc(stdin).
*
* You have to press enter for the character to go through:
* https://stackoverflow.com/questions/1798511/how-to-avoid-pressing-enter-with-getchar
*
* Used at:
* https://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1/53937376#53937376
*/
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char c;
printf("enter a character: ");
c = getchar();
printf("you entered: %c\n", c);
return EXIT_SUCCESS;
}

View File

@@ -1,9 +0,0 @@
/* Print hello to stdout ;-) */
#include <stdio.h>
#include <stdlib.h>
int main(void) {
puts("hello");
return EXIT_SUCCESS;
}

View File

@@ -1,29 +0,0 @@
/* Loop infinitely. Print an integer whenever a period is reached:
*
* ....
* ./infinite_loop [period]
* ....
*/
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
uintmax_t i, j, period;
if (argc > 1) {
period = strtoumax(argv[1], NULL, 10);
} else {
period = 100000000;
}
i = 0;
j = 0;
while (1) {
i++;
if (i % period == 0) {
printf("%ju\n", j);
j++;
}
}
}

View File

@@ -1,7 +0,0 @@
/* Print hello to stderr. */
#include <stdio.h>
int main(void) {
fputs("hello\n", stderr);
}