* [rfc] [05/09] Get rid of current_gdbarch (macros in mn10300 target)
@ 2007-11-05 12:23 Markus Deuling
2007-11-05 15:53 ` Ulrich Weigand
0 siblings, 1 reply; 4+ messages in thread
From: Markus Deuling @ 2007-11-05 12:23 UTC (permalink / raw)
To: GDB Patches; +Cc: Ulrich Weigand
[-- Attachment #1: Type: text/plain, Size: 466 bytes --]
Hi,
this patch replaces AM33 macro from n10300 target and then replaces current_gdbarch
by appropriate methods.
Tested building with --target=mn10300. Ok to commit?
ChangeLog:
* mn10300-tdep.c (set_reg_offsets,mn10300_analyze_prologue): Replace
AM33 by its expression. Use get_frame_arch to get at the current
architecture by frame_info.
* mn10300-tdep.h (AM33_MODE): Remove.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
[-- Attachment #2: diff-mn10300 --]
[-- Type: text/plain, Size: 1420 bytes --]
diff -urpN src/gdb/mn10300-tdep.c dev2/gdb/mn10300-tdep.c
--- src/gdb/mn10300-tdep.c 2007-11-05 05:32:22.000000000 +0100
+++ dev2/gdb/mn10300-tdep.c 2007-11-05 09:10:03.000000000 +0100
@@ -328,7 +328,7 @@ set_reg_offsets (struct frame_info *fi,
trad_frame_set_this_base (cache, base);
- if (AM33_MODE == 2)
+ if (gdbarch_tdep (get_frame_arch (fi))->am33_mode == 2)
{
/* If bit N is set in fpregmask, fsN is saved on the stack.
The floating point registers are saved in ascending order.
@@ -384,7 +384,7 @@ set_reg_offsets (struct frame_info *fi,
trad_frame_set_reg_addr (cache, E_D2_REGNUM, base + offset);
offset += 4;
}
- if (AM33_MODE)
+ if (gdbarch_tdep (get_frame_arch (fi))->am33_mode)
{
if (movm_args & movm_exother_bit)
{
@@ -603,7 +603,7 @@ mn10300_analyze_prologue (struct frame_i
goto finish_prologue;
}
- if (AM33_MODE == 2)
+ if (gdbarch_tdep (get_frame_arch (fi))->am33_mode == 2)
{
/* Determine if any floating point registers are to be saved.
Look for one of the following three prologue formats:
diff -urpN src/gdb/mn10300-tdep.h dev2/gdb/mn10300-tdep.h
--- src/gdb/mn10300-tdep.h 2007-08-23 20:08:36.000000000 +0200
+++ dev2/gdb/mn10300-tdep.h 2007-11-05 09:10:12.000000000 +0100
@@ -77,4 +77,3 @@ struct gdbarch_tdep
int am33_mode;
};
-#define AM33_MODE (gdbarch_tdep (current_gdbarch)->am33_mode)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [rfc] [05/09] Get rid of current_gdbarch (macros in mn10300 target)
2007-11-05 12:23 [rfc] [05/09] Get rid of current_gdbarch (macros in mn10300 target) Markus Deuling
@ 2007-11-05 15:53 ` Ulrich Weigand
2007-11-06 12:07 ` Markus Deuling
0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2007-11-05 15:53 UTC (permalink / raw)
To: Markus Deuling; +Cc: GDB Patches
Markus Deuling wrote:
> * mn10300-tdep.c (set_reg_offsets,mn10300_analyze_prologue): Replace
> AM33 by its expression. Use get_frame_arch to get at the current
> architecture by frame_info.
> * mn10300-tdep.h (AM33_MODE): Remove.
Sorry, but this is not OK. Unfortunately, the mn10300_analyze_prologue
routine is called both from within the unwinder (where we always have
a frame), *and* from mn10300_skip_prologue, where frame information is
not available. Thus "fi" may actually be NULL.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [rfc] [05/09] Get rid of current_gdbarch (macros in mn10300 target)
2007-11-05 15:53 ` Ulrich Weigand
@ 2007-11-06 12:07 ` Markus Deuling
2007-11-06 18:37 ` Ulrich Weigand
0 siblings, 1 reply; 4+ messages in thread
From: Markus Deuling @ 2007-11-06 12:07 UTC (permalink / raw)
To: Ulrich Weigand; +Cc: GDB Patches
[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]
Ulrich Weigand schrieb:
> Markus Deuling wrote:
>
>> * mn10300-tdep.c (set_reg_offsets,mn10300_analyze_prologue): Replace
>> AM33 by its expression. Use get_frame_arch to get at the current
>> architecture by frame_info.
>> * mn10300-tdep.h (AM33_MODE): Remove.
>
> Sorry, but this is not OK. Unfortunately, the mn10300_analyze_prologue
> routine is called both from within the unwinder (where we always have
> a frame), *and* from mn10300_skip_prologue, where frame information is
> not available. Thus "fi" may actually be NULL.
Ok, I see. Your're right. I attached a patch which just replaces AM33_MODe macro to
get rid of current_gdbarch in mn10300-tdep.h file. Later on I'll come up with a patch
to get rid of the newly introduced current_gdbarch's in mn10300-tdep.c.
Tested by building with --target=mn10300. Ok to commit?
ChangeLog:
* mn10300-tdep.c (set_reg_offsets,mn10300_analyze_prologue): Replace
AM33 by its expression.
* mn10300-tdep.h (AM33_MODE): Remove.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
[-- Attachment #2: diff-mn10300 --]
[-- Type: text/plain, Size: 1401 bytes --]
diff -urpN src/gdb/mn10300-tdep.c dev/gdb/mn10300-tdep.c
--- src/gdb/mn10300-tdep.c 2007-11-05 05:32:22.000000000 +0100
+++ dev/gdb/mn10300-tdep.c 2007-11-06 10:37:39.000000000 +0100
@@ -328,7 +328,7 @@ set_reg_offsets (struct frame_info *fi,
trad_frame_set_this_base (cache, base);
- if (AM33_MODE == 2)
+ if (gdbarch_tdep (current_gdbarch)->am33_mode == 2)
{
/* If bit N is set in fpregmask, fsN is saved on the stack.
The floating point registers are saved in ascending order.
@@ -384,7 +384,7 @@ set_reg_offsets (struct frame_info *fi,
trad_frame_set_reg_addr (cache, E_D2_REGNUM, base + offset);
offset += 4;
}
- if (AM33_MODE)
+ if (gdbarch_tdep (current_gdbarch)->am33_mode)
{
if (movm_args & movm_exother_bit)
{
@@ -603,7 +603,7 @@ mn10300_analyze_prologue (struct frame_i
goto finish_prologue;
}
- if (AM33_MODE == 2)
+ if (gdbarch_tdep (current_gdbarch)->am33_mode == 2)
{
/* Determine if any floating point registers are to be saved.
Look for one of the following three prologue formats:
diff -urpN src/gdb/mn10300-tdep.h dev/gdb/mn10300-tdep.h
--- src/gdb/mn10300-tdep.h 2007-08-23 20:08:36.000000000 +0200
+++ dev/gdb/mn10300-tdep.h 2007-11-06 10:38:52.000000000 +0100
@@ -77,4 +77,3 @@ struct gdbarch_tdep
int am33_mode;
};
-#define AM33_MODE (gdbarch_tdep (current_gdbarch)->am33_mode)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [rfc] [05/09] Get rid of current_gdbarch (macros in mn10300 target)
2007-11-06 12:07 ` Markus Deuling
@ 2007-11-06 18:37 ` Ulrich Weigand
0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Weigand @ 2007-11-06 18:37 UTC (permalink / raw)
To: Markus Deuling; +Cc: GDB Patches
Markus Deuling wrote:
> Ok, I see. Your're right. I attached a patch which just replaces AM33_MODe macro to
> get rid of current_gdbarch in mn10300-tdep.h file. Later on I'll come up with a patch
> to get rid of the newly introduced current_gdbarch's in mn10300-tdep.c.
I don't see how this patch alone really helps much; we don't we wait for the
real solution and check it in in one go?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-06 18:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-05 12:23 [rfc] [05/09] Get rid of current_gdbarch (macros in mn10300 target) Markus Deuling
2007-11-05 15:53 ` Ulrich Weigand
2007-11-06 12:07 ` Markus Deuling
2007-11-06 18:37 ` Ulrich Weigand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox