Changeset 826a0a97 in mainline


Ignore:
Timestamp:
2018-06-25T18:53:41Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0a0dff8
Parents:
8751cf3
Message:

Add task ID in the assert failure message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/assert.c

    r8751cf3 r826a0a97  
    3838#include <stacktrace.h>
    3939#include <stdint.h>
     40#include <task.h>
    4041
    4142static atomic_t failed_asserts = { 0 };
     
    4647         * Send the message safely to kio. Nested asserts should not occur.
    4748         */
    48         kio_printf("Assertion failed (%s) in file \"%s\", line %u.\n",
    49             cond, file, line);
     49        kio_printf("Assertion failed (%s) in task %ld, file \"%s\", line %u.\n",
     50            cond, (long) task_get_id(), file, line);
    5051
    5152        stacktrace_kio_print();
     
    6061         * Send the message safely to kio. Nested asserts should not occur.
    6162         */
    62         kio_printf("Assertion failed (%s) in file \"%s\", line %u.\n",
    63             cond, file, line);
     63        kio_printf("Assertion failed (%s) in task %ld, file \"%s\", line %u.\n",
     64            cond, (long) task_get_id(), file, line);
    6465
    6566        stacktrace_kio_print();
     
    7677         * assertions.
    7778         */
    78         printf("Assertion failed (%s) in file \"%s\", line %u.\n",
    79             cond, file, line);
     79        kio_printf("Assertion failed (%s) in task %ld, file \"%s\", line %u.\n",
     80            cond, (long) task_get_id(), file, line);
    8081        stacktrace_print();
    8182
Note: See TracChangeset for help on using the changeset viewer.