Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions PrintCapabilityValue.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*

How do I printf a capability value
we use calloc() and still producing same results
However, the memory allocation with calloc() will be initialized to zero

by Joseph Kaberuka
*/

#include<stdio.h>
#include<stdlib.h>

int main() {

void *x =(void *)calloc(1, 1);
printf("The address in this capability is %p\n", x);
printf("The full capability (incl metadata) is %#p\n", x);
// Freeing the allocated memory
free(x);

return 0;

}
9 changes: 9 additions & 0 deletions buildsuccess.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
1. Following the README file, when adapting the build configuration, the file cheribuild.json can be configured at ~/.config/cheribuild.json

2. However, during my build with this file, unhandled exceptions has been issues time and time and prevented a successful build process

3. I had to remove this file from ~/ directory and also from cheribuild cloned directory

4. Removing the same file from both locations, python3 cheribuild.py run-morello-purecap completed successfully


26 changes: 26 additions & 0 deletions provenanceissue.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include<stdio.h>

void myFunction(int *ptr){
//trying to perform some operations with ptr

}

int main() {

int array_data[5]={1,2,3,4,5};

int *ptr1 =array_data;

//pass ptr to myFunction

myFunction(ptr1);

//attempt to access 'array_data' through 'ptr1' again

int myValue =*ptr1;

printf("myvalue : %d\n", myValue);

return 0;

}