Skip to content

Commit 7c5ff52

Browse files
committed
v.0.8.13 Now supporting the SREC format.
1 parent cc5a237 commit 7c5ff52

42 files changed

Lines changed: 375 additions & 208 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
# Unreleased
44

5+
- nothing to log
6+
7+
# v.0.8.13 - 2021-09-06
8+
9+
- Now supporting Motorola SRecord
10+
11+
- merged pull-request (#68) from pointbazaar (Alexander Hansen)
12+
- added format reader for motorola hex (SRecord)
13+
- thanks for that :)
14+
15+
- refactored srec format reader (PR #68)
16+
- adjusted style
17+
- fixed some minor bugs
18+
19+
- connected srec format reader to pipeline
20+
21+
- Important: file extension decides which reader will be invoked
22+
- *.hex ==> invokes intel hex reader
23+
- *.srec ==> invokes srec reader
24+
525
- added format reader interface (reader/reader.c)
626
- reader for different file formats can be now added to reader/format/
727
- for example reader/format/ihex.c to read the intel hex format

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int main(const int argc, const char **argv) {
5858

5959
/* ignoring checks for this example */
6060
vmcu_model_t *m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
61-
vmcu_report_t *report = vmcu_analyze_ihex("file.hex", m328p);
61+
vmcu_report_t *report = vmcu_analyze_file("file.hex", m328p);
6262

6363
for(uint32_t i = 0; i < report->cfg->used; i++) {
6464
@@ -127,7 +127,7 @@ int main(const int argc, const char **argv) {
127127

128128
/* ignoring checks for this example */
129129
vmcu_model_t *m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
130-
vmcu_report_t *report = vmcu_analyze_ihex("file.hex", m328p);
130+
vmcu_report_t *report = vmcu_analyze_file("file.srec", m328p);
131131

132132
for(uint32_t i = 0; i < report->progsize; i++) {
133133

@@ -161,7 +161,7 @@ int main(const int argc, const char **argv) {
161161

162162
/* ignoring checks for this example */
163163
vmcu_model_t *m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
164-
vmcu_report_t *report = vmcu_analyze_ihex("file.hex", m328p);
164+
vmcu_report_t *report = vmcu_analyze_file("file.hex", m328p);
165165

166166
for(uint32_t i = 0; i < report->progsize; i++) {
167167

@@ -195,7 +195,7 @@ int main(const int argc, const char **argv) {
195195

196196
/* ignoring checks for this example */
197197
vmcu_model_t *m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
198-
vmcu_report_t *report = vmcu_analyze_ihex("file.hex", m328p);
198+
vmcu_report_t *report = vmcu_analyze_file("file.hex", m328p);
199199

200200
for(uint32_t i = 0; i < report->n_vector; i++) {
201201

@@ -237,7 +237,7 @@ int main(const int argc, const char **argv) {
237237

238238
/* ignoring checks for this example */
239239
vmcu_model_t *m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
240-
vmcu_report_t *report = vmcu_analyze_ihex("file.hex", m328p);
240+
vmcu_report_t *report = vmcu_analyze_file("file.hex", m328p);
241241

242242
for(uint32_t i = 0; i < report->n_label; i++) {
243243

@@ -287,7 +287,7 @@ int main(const int argc, const char **argv) {
287287

288288
/* ignoring checks for this example */
289289
vmcu_model_t *m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
290-
vmcu_report_t *report = vmcu_analyze_ihex("file.hex", m328p);
290+
vmcu_report_t *report = vmcu_analyze_file("file.hex", m328p);
291291

292292
for(uint32_t i = 0; i < report->n_sfr; i++) {
293293

@@ -510,7 +510,7 @@ take a look at engine/*/arch/
510510

511511
- [ ] format reader
512512
- [x] intel hex
513-
- [ ] motorola hex
513+
- [x] motorola hex
514514
- [ ] bin
515515
- [ ] elf
516516

TODO.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ These are a some of my ideas for the future of libvmcu
3232
[10] a python binding would be really great.
3333
[10.1] requires external contributors :( see CONTRIBUTING.txt
3434

35+
[11] make libvmcu thread safe
36+
3537
/********************************* Internal / Cleanup *****************************/
3638

3739
[12] remove usage of basic integers (int) in libvmcu (nearly done)
@@ -41,3 +43,5 @@ These are a some of my ideas for the future of libvmcu
4143
[14] speed up controlflow analysis by adding a lookup table for the cfg nodes
4244

4345
[15] fix inconsistency of xref-to
46+
47+
[16] a consistent way to return readable error codes (not just -1 and 0)

driver/cfg/cfg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ int main(const int argc, const char **argv) {
4343

4444
if(argc != 2) {
4545

46-
printf("Usage: ./skeleton <hexfile>\n");
46+
printf("Usage: ./skeleton <binary>\n");
4747
return EXIT_FAILURE;
4848
}
4949

5050
atexit(cleanup);
5151

5252
m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
53-
report = vmcu_analyze_ihex(argv[1], m328p);
53+
report = vmcu_analyze_file(argv[1], m328p);
5454

5555
if(report == NULL)
5656
return EXIT_FAILURE;

driver/disasm/disasm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ int main(const int argc, const char **argv) {
6464

6565
if(argc != 2) {
6666

67-
printf("Usage: ./skeleton <hexfile>\n");
67+
printf("Usage: ./skeleton <binary>\n");
6868
return EXIT_FAILURE;
6969
}
7070

7171
atexit(cleanup);
7272
m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
7373

7474
uint32_t progsize = 0;
75-
vmcu_instr_t *prog = vmcu_disassemble_ihex(argv[1], &progsize, m328p);
75+
vmcu_instr_t *prog = vmcu_disassemble_file(argv[1], &progsize, m328p);
7676

7777
if(prog == NULL || progsize == 0)
7878
return EXIT_FAILURE;

driver/endloop/endloop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ int main(const int argc, const char **argv) {
4141

4242
if(argc != 2) {
4343

44-
printf("Usage: ./endloop <file.hex>\n");
44+
printf("Usage: ./endloop <binary>\n");
4545
return EXIT_FAILURE;
4646
}
4747

4848
vmcu_model_t *m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
49-
vmcu_report_t *report = vmcu_analyze_ihex(argv[1], m328p);
49+
vmcu_report_t *report = vmcu_analyze_file(argv[1], m328p);
5050

5151
if(report == NULL) {
5252

driver/findgroup/findgroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ int main(const int argc, const char **argv) {
4141

4242
if(argc != 3) {
4343

44-
printf("Usage: ./findgroup <file.hex> <group>\n");
44+
printf("Usage: ./findgroup <binary> <group>\n");
4545
return EXIT_FAILURE;
4646
}
4747

4848
atexit(cleanup);
4949

5050
m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
51-
report = vmcu_analyze_ihex(argv[1], m328p);
51+
report = vmcu_analyze_file(argv[1], m328p);
5252

5353
if(report == NULL)
5454
return EXIT_FAILURE;

driver/findisr/findisr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int main(const int argc, const char **argv) {
5656

5757
if(argc < 2) {
5858

59-
printf("Usage: ./findisr <hexfile>\n");
59+
printf("Usage: ./findisr <binary>\n");
6060
return EXIT_FAILURE;
6161
}
6262

@@ -76,7 +76,7 @@ int main(const int argc, const char **argv) {
7676
const char* filename = argv[argc-1];
7777
m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
7878

79-
if((report = vmcu_analyze_ihex(filename, m328p)) == NULL)
79+
if((report = vmcu_analyze_file(filename, m328p)) == NULL)
8080
return EXIT_FAILURE;
8181

8282
uint32_t start_index = 0;

driver/graph/graph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ int main(const int argc, const char **argv) {
6565

6666
if(argc != 2) {
6767

68-
printf("Usage: ./cfg <hexfile>\n");
68+
printf("Usage: ./cfg <binary>\n");
6969
return EXIT_FAILURE;
7070
}
7171

7272
vmcu_model_t* m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
73-
vmcu_report_t* report = vmcu_analyze_ihex(argv[1], m328p);
73+
vmcu_report_t* report = vmcu_analyze_file(argv[1], m328p);
7474

7575
if(report == NULL)
7676
return EXIT_FAILURE;

driver/labels/labels.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ int main(const int argc, const char **argv) {
1818

1919
if(argc != 2) {
2020

21-
printf("Usage: ./labels <file.hex>\n");
21+
printf("Usage: ./labels <binary>\n");
2222
return EXIT_FAILURE;
2323
}
2424

2525
vmcu_model_t *m328p = vmcu_model_ctor(VMCU_DEVICE_M328P);
26-
vmcu_report_t *report = vmcu_analyze_ihex(argv[1], m328p);
26+
vmcu_report_t *report = vmcu_analyze_file(argv[1], m328p);
2727

2828
if(report == NULL) {
2929

0 commit comments

Comments
 (0)