Commit Graph

29 Commits

Author SHA1 Message Date
Travis Geiselbrecht
74192acef5 [debugcommands][crash] add a variant for cortex-m
Touching around address 0 doesn't cause a cortex-m device to crash, but
branching to an aligned address absolutely will.
2024-02-26 00:58:04 -08:00
gvk51
6a33334c1e [lib][debugcommands] option to input physical address for debug commands
dw/mw and the sister commands take virtual address as input for display
or modify. Option "-p" to the command signifies the address input is
physical, and the address translation is handled by the command.

Newly added option is available with WITH_KERNEL_VM, usage as follows

] dw 0xffffffff05100000 4
0xffffffff05100000: 0000dead
] dw 0x5100000 4 -p
0xffffffff05100000: 0000dead

Signed-off-by: VAMSHI GAJJELA <vamshigajjela@google.com>
2023-12-04 01:07:26 -08:00
Aaron Odell
8fc673fe4a [lib][debugcommands] Add panic command
Add a simple command to generate a test panic.
2023-04-23 17:34:57 -07:00
Aaron Odell
9ac5708eb5 [lib][debugcommands] Add commands to display current time
Add debug commands "time" and "timeh" to display current_time() and
current_time_hires() respectively.
2023-04-23 17:34:51 -07:00
gvk51
8b1335ea7e [lib][debugcommands] sanity check address is mapped before display/modify
Accessing un-mapped address/address-range results in data abort. Ensure
the address and all the pages in the requested range are mapped. Mapping
is checked at page size, also adjusts the stop address to the nearest valid
address mapped.
2022-11-03 00:04:30 -07:00
Travis Geiselbrecht
e798c47e89 [lib][debugcommands] add a workaround for gcc 12.1
GCC 12 seems to be much more aggressive about warnings about any
dereferences near 0. For this particular piece of code, which is
explicitly trying to force a fault by touching address 1, simply disable
the warning around the block of code.
2022-05-21 17:29:30 -07:00
Travis Geiselbrecht
4edb93adde [lib][console] rename some console command types to be prefixed with console_
Some of the structures, notably 'cmd', in the lib console stuff are a
little too generically named and have collided with some other code
so prefix the names a bit more cleanly with console_

The change is largely mechanical, and folks with out of tree code can
easily switch by renaming:
cmd -> console_cmd
cmd_args -> console_cmd_args
cmd_block -> console_cmd_block
console_cmd -> console_cmd_func

Apologies if this breaks you but it should be pretty easy to fix.
2020-07-25 15:59:58 -07:00
Travis Geiselbrecht
6cb02526b7 [include][console] split lib/console.h into two
TL;DR most uses of lib/console.h -> lk/console_cmd.h

Move the part that lets a piece of code somewhere in the system to
define a console command from the actual lib/console api to start an
instance of the console. Move in almost every place the user of the
console command definition to the new header, lk/console_cmd.h which is
always in the include path.

Also remove most uses of testing for WITH_LIB_CONSOLE since you can
almost always just safely define it and then let the linker remove it.
2019-07-13 16:56:33 -07:00
Travis Geiselbrecht
cba9e47987 [license] replace the longer full MIT license with a shorter one
Used scripts/replacelic. Everything seems to build fine.
2019-07-05 17:22:23 -07:00
Travis Geiselbrecht
d8fa82cb91 [formatting] run everything through codestyle
Almost nothing changes here except moving braces to the same line as the
function declaration. Everything else is largely whitespace changes and
a few dangling files with tab indents.

See scripts/codestyle
2019-06-19 21:02:24 -07:00
Travis Geiselbrecht
1b7a28efb8 [include][lk] fixup lk/ include path move 2019-06-19 19:46:11 -07:00
Travis Geiselbrecht
a4ca0a6e00 [vmm] move most users of arch_mmu_query directly to vaddr_to_paddr() 2016-02-14 12:45:53 -08:00
Travis Geiselbrecht
8021643b24 [lib][debugcommands] add 'stackstomp' command which intentionally blows the stack 2015-11-04 18:35:20 -08:00
Travis Geiselbrecht
38f20ec0a1 [lib][console] add pointer type arg, switch some users to it.
Patch courtesy Erik Corry
2015-10-19 12:49:20 -07:00
Travis Geiselbrecht
2e5fe28164 [lib][debugcommands] add a command to intentially crash the system 2015-10-14 13:44:12 -07:00
Gurjant Kalsi
dc1bfa8e30 [style][console][panic shell] Autoformatted console code. 2015-10-12 16:44:56 -07:00
Gurjant Kalsi
fd2fd65207 [shell][console][debug] Enable memory manipulation debug commands in the crash shell. 2015-10-12 16:39:04 -07:00
Travis Geiselbrecht
a84994b914 [lib][debugcommands] add sleep commands 2015-10-01 14:36:21 -07:00
Travis Geiselbrecht
dddd88b1f1 [lib][debugcommands] add endian swapping switches to the memory dump commands 2015-09-29 11:49:39 -07:00
Gurjant Kalsi
a6c8b005db [console] Use STATIC_COMMAND macro for all console command definitions
BUG=

Review URL: https://codereview.chromium.org/1348403002 .
2015-09-16 15:37:33 -07:00
Travis Geiselbrecht
ee9d2927ad [arm] add ability to pass and generically read up to 4 boot args from whoever loaded lk
-Extend arch_chain_load() to pass 4 args
2014-11-21 15:50:18 -08:00
Travis Geiselbrecht
426a385541 [lib][debugcommands] preflight the address to dump with the mmu (if present) 2014-11-20 17:21:02 -08:00
Travis Geiselbrecht
c43118cc4b [lib]][debugcommands] add 'chain' command, which just calls arch_chain_load() 2014-08-12 16:21:27 -07:00
Travis Geiselbrecht
ad7aeddbef [lib][debug] tweak the hexdump and dw debug commands to be a bit more useful
-hexdump8 now stops dumping before it hits the end of the 16 byte line
-d[bhw] remembers the last size and offset you used
2014-06-26 19:14:36 -07:00
Dima Zavin
36c7735533 [libc][stdio] cleanup printf definition and clients
Move implementation to stdio.c to sit next to the other
stdio definitions that use the debug output functions. Keep
the declaration of it, though, in printf.h to sit next to
sprintf, etc.

Don't include printf.h directly in other places, rely on stdio.h
to properly pull in these functions.

Change-Id: I357cb04a5c78185b8fde908193b672326c2ee542
Signed-off-by: Dima Zavin <dima@android.com>
2013-08-05 10:04:29 -07:00
Travis Geiselbrecht
98b4e0938e [make] rename DEBUGLEVEL -> LK_DEBUGLEVEL, remove DEBUG define
-Remove top level DEBUG=<N> define
-Rename DEBUGLEVEL to LK_DEBUGLEVEL to be clear.
-Fix the places that used DEBUGLEVEL and the few spots that #ifdef
on DEBUG.
2013-06-07 22:27:00 -07:00
Travis Geiselbrecht
9b961b4a34 [lib] run all of lib and include through astyle 2012-10-31 21:47:17 -07:00
Travis Geiselbrecht
97cfd0bfa4 [make] update all of the rules.mk to use the new module system 2012-08-31 15:52:24 -07:00
Travis Geiselbrecht
47d5ba245e [lib][debug] broke the command handlers from lib/debug into lib/debugcommands 2012-07-21 13:49:33 -07:00