Skip to content

Commit

Permalink
-Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-gomez-windhover committed Oct 15, 2024
1 parent 7fd74e1 commit 1f9e53b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
12. [Notes On Multiple DWARF Versions](#multiple_dwarf_versions)
13. [Bitfields](#Bitfields)
14. [Docker Dev Environments](#docker_dev_env)
15. [Union Support](#union_support)

## Dependencies <a name="dependencies"></a>
* `libdwarf-dev`
Expand Down Expand Up @@ -322,6 +323,7 @@ As juicer evolves, dwarf support will grow and evolve as well. At the moment, we
| DW_MACRO_define | This tag represents define macros such as "#define CFE_MISSION_ES_PERF_MAX_IDS 128"|
| DW_AT_decl_file | This tag represents the file where a certain symbol is declared. Very useful for traceability of source code.|
| DW_AT_encoding | The encoding of base type. For example; "unsigned int" will have encoding "DW_ATE_unsigned". This is what the "encodings" table is for in the SQLITE db.|
| DW_TAG_union_type | The tag used for unions. For example; `union Object { int32_t id; int32_t bit_field : 10; uint8_t data[4];};`.|

For more details on the DWARF debugging format, go on [here](http://www.dwarfstd.org/doc/DWARF4.pdf).

Expand Down Expand Up @@ -433,5 +435,29 @@ For example `make docker-ubuntu22-build-dev` will start a dev environment inside
The repo is mounted as a volume under "/home/docker/juicer" so developers can make their changes on the host and build inside the container.


# Union Support <a name="union_support"></a>

Given the following union:

```C
union Object
{
int32_t id;
int32_t bit_field : 10;
uint8_t data[4];
};

```

The union is represented as such in the SQLITE db:


![bit_packed_fields](Images/union_symbol_tbl.png "symbols-table")

![bit_packed_fields](Images/union_fields_tbl.png "fields-table")

Notice that the byte_offset is `NULL` for the fields that belong to the union. This is how consumers (such as [auto-yamcs](https://github.com/WindhoverLabs/auto-yamcs)) can make a distinction between unions and structs.



Documentation updated on September 19, 2024

0 comments on commit 1f9e53b

Please sign in to comment.