Skip to contentSkip to conversation

How can I debug the function of malloc_in_range?

DISCUSSION Zhang 2 participants 2 messages Aug 7, 2019 – Oct 2, 2019

lore
Share & tools
lore

Zhang

author
#0 lore raw

Hi All,
I want to study the function malloc_in_range of the grub2.02. So I set the followings in the grub.cfg.

serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1

terminal_input serial console

terminal_output serial console

set debug=all

But when I add some grub_printf to the function of malloc_in_range, the serial and VGA both display messy code.

So how can I debug the function of malloc_in_range

#1 lore raw
Quoted 8 lines · Zhang

Hi All,
I want to study the function malloc_in_range of the grub2.02. So I set the followings in the grub.cfg.

serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1

terminal_input serial console

Quoted 7 lines

terminal_output serial console

set debug=all

But when I add some grub_printf to the function of malloc_in_range, the serial and VGA both display messy code.

So how can I debug the function of malloc_in_range

Please try grub_dprintf() instead of grub_printf(). However, be careful. You are dealing with memory allocators...

Daniel